@kombai/cli 0.1.2-beta.4 → 0.1.2-beta.5
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 +82 -57
- package/dist/mcp-apps/design-taste.js +330 -342
- package/dist/mcp-apps/plans.js +344 -380
- package/dist/mcp-apps/sign-in.js +261 -276
- package/package.json +1 -1
package/dist/kombai.mjs
CHANGED
|
@@ -1161,7 +1161,7 @@ function writeOutcome(stdout, outcome, warnings, pretty) {
|
|
|
1161
1161
|
stdout.write(`${formatJson(body, pretty)}
|
|
1162
1162
|
`);
|
|
1163
1163
|
}
|
|
1164
|
-
var Exit, EXIT_CODE, CliError, Warnings;
|
|
1164
|
+
var Exit, EXIT_CODE, SIGN_IN_NEXT, CliError, Warnings;
|
|
1165
1165
|
var init_output = __esm({
|
|
1166
1166
|
"src/lib/output.js"() {
|
|
1167
1167
|
"use strict";
|
|
@@ -1175,6 +1175,7 @@ var init_output = __esm({
|
|
|
1175
1175
|
TIMED_OUT: 4
|
|
1176
1176
|
});
|
|
1177
1177
|
EXIT_CODE = "__exitCode";
|
|
1178
|
+
SIGN_IN_NEXT = "kombai skill sign-in";
|
|
1178
1179
|
CliError = class extends Error {
|
|
1179
1180
|
/**
|
|
1180
1181
|
* @param {string} code the backend's `errorCode`, or a `CLI_*` code the CLI found itself
|
|
@@ -1465,6 +1466,9 @@ function nameProblem(value, flag) {
|
|
|
1465
1466
|
function orgIdProblem(value) {
|
|
1466
1467
|
return DESIGN_ID.orgId.test(String(value)) ? void 0 : `--org "${value}" is not an organization id`;
|
|
1467
1468
|
}
|
|
1469
|
+
function projectIdProblem(value) {
|
|
1470
|
+
return DESIGN_ID.project.test(String(value)) ? void 0 : `--project "${value}" is not a project id (prj_\u2026)`;
|
|
1471
|
+
}
|
|
1468
1472
|
function badValue(problem) {
|
|
1469
1473
|
return new CliError("CLI_BAD_FLAG", `${problem}.`, { details: { problems: [problem] } });
|
|
1470
1474
|
}
|
|
@@ -1758,7 +1762,7 @@ var init_version = __esm({
|
|
|
1758
1762
|
"src/lib/version.js"() {
|
|
1759
1763
|
"use strict";
|
|
1760
1764
|
init_define_KOMBAI_TELEMETRY();
|
|
1761
|
-
CLI_VERSION = true ? "0.1.2-beta.
|
|
1765
|
+
CLI_VERSION = true ? "0.1.2-beta.5" : (
|
|
1762
1766
|
/** @type {{ version: string }} */
|
|
1763
1767
|
JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version
|
|
1764
1768
|
);
|
|
@@ -1807,10 +1811,12 @@ function apiError(status, body, method, path25) {
|
|
|
1807
1811
|
const guestRow = GUEST_ERRORS[code2];
|
|
1808
1812
|
const needsLogin = status === 401 || guestRow !== void 0;
|
|
1809
1813
|
const text = guestRow?.message?.(rest, typeof apiMessage === "string" ? apiMessage : "") ?? message;
|
|
1814
|
+
const secondCanvas = code2 === "DESIGN_GUEST_LIMIT" && typeof rest.canvasId === "string";
|
|
1815
|
+
const next = needsLogin && !secondCanvas ? SIGN_IN_NEXT : void 0;
|
|
1810
1816
|
return new CliError(code2, text, {
|
|
1811
1817
|
status,
|
|
1812
1818
|
exit: guestRow?.exit ?? (status === 401 ? Exit.NOT_SIGNED_IN : Exit.FAILED),
|
|
1813
|
-
next
|
|
1819
|
+
next,
|
|
1814
1820
|
details: Object.keys(rest).length ? rest : void 0
|
|
1815
1821
|
});
|
|
1816
1822
|
}
|
|
@@ -2052,15 +2058,15 @@ var init_api = __esm({
|
|
|
2052
2058
|
DESIGN_SIGNIN_REQUIRED: { exit: Exit.NOT_SIGNED_IN },
|
|
2053
2059
|
SIGNIN_GUEST_EXPIRED: {
|
|
2054
2060
|
exit: Exit.NOT_SIGNED_IN,
|
|
2055
|
-
message: () => "This guest canvas has expired. Sign in
|
|
2061
|
+
message: () => "This guest canvas has expired. Sign in, or run kombai guest to start again."
|
|
2056
2062
|
},
|
|
2057
2063
|
SIGNIN_GUEST_CLAIMED: {
|
|
2058
2064
|
exit: Exit.NOT_SIGNED_IN,
|
|
2059
|
-
message: () => "This guest canvas now belongs to a Kombai account; sign in
|
|
2065
|
+
message: () => "This guest canvas now belongs to a Kombai account; sign in to reach it."
|
|
2060
2066
|
},
|
|
2061
2067
|
DESIGN_GUEST_LIMIT: {
|
|
2062
2068
|
exit: Exit.FAILED,
|
|
2063
|
-
message: (details, apiMessage) => typeof details.canvasId === "string" ? `A guest has one canvas, ${details.canvasId}: use it, or sign in
|
|
2069
|
+
message: (details, apiMessage) => typeof details.canvasId === "string" ? `A guest has one canvas, ${details.canvasId}: use it, or sign in for more.` : `This guest canvas is full: ${sentence(apiMessage || "it has no room left")} Sign in to keep going; signing in keeps the canvas.`
|
|
2064
2070
|
},
|
|
2065
2071
|
SIGNIN_GUEST_RATE: { exit: Exit.FAILED }
|
|
2066
2072
|
};
|
|
@@ -2371,7 +2377,7 @@ var init_store = __esm({
|
|
|
2371
2377
|
init_fsx();
|
|
2372
2378
|
init_lock();
|
|
2373
2379
|
init_output();
|
|
2374
|
-
SIGN_IN_AGAIN = "that signs this machine out, so
|
|
2380
|
+
SIGN_IN_AGAIN = "that signs this machine out, so sign in again after.";
|
|
2375
2381
|
NEW_MACHINE_ID = "the CLI then makes a new machine id.";
|
|
2376
2382
|
KEY_FIELDS = Object.freeze(["key", "keyId", "userId", "email", "expires"]);
|
|
2377
2383
|
GUEST_FIELDS = Object.freeze(["guest", "guestId", "canvasId", "guestExpires", "claimOrgs"]);
|
|
@@ -2382,7 +2388,7 @@ var init_store = __esm({
|
|
|
2382
2388
|
async function openSession(ctx, options = {}) {
|
|
2383
2389
|
const session = await openAnySession(ctx, options);
|
|
2384
2390
|
if (session.kind === "guest") {
|
|
2385
|
-
throw signInRequired("This needs a Kombai account, and this machine is a guest
|
|
2391
|
+
throw signInRequired("This needs a Kombai account, and this machine is a guest: sign in first.");
|
|
2386
2392
|
}
|
|
2387
2393
|
return session;
|
|
2388
2394
|
}
|
|
@@ -2420,7 +2426,7 @@ function isPureGuest(entry) {
|
|
|
2420
2426
|
async function refuseGuest(ctx) {
|
|
2421
2427
|
const { env } = await currentEnv(ctx);
|
|
2422
2428
|
if (isPureGuest(await readEntry(ctx.home, env)))
|
|
2423
|
-
throw signInRequired("This needs a Kombai account, and this machine is a guest
|
|
2429
|
+
throw signInRequired("This needs a Kombai account, and this machine is a guest: sign in first.");
|
|
2424
2430
|
}
|
|
2425
2431
|
function guestHooks(ctx, env, guest2) {
|
|
2426
2432
|
if (!guest2) return {};
|
|
@@ -2440,7 +2446,7 @@ function guestHooks(ctx, env, guest2) {
|
|
|
2440
2446
|
function notSignedIn(message, reason) {
|
|
2441
2447
|
return new CliError("CLI_NOT_SIGNED_IN", message, {
|
|
2442
2448
|
exit: Exit.NOT_SIGNED_IN,
|
|
2443
|
-
next:
|
|
2449
|
+
next: SIGN_IN_NEXT,
|
|
2444
2450
|
details: { reason }
|
|
2445
2451
|
});
|
|
2446
2452
|
}
|
|
@@ -2452,7 +2458,7 @@ function holdsAccount(entry) {
|
|
|
2452
2458
|
return typeof entry.key === "string" && entry.key !== "" || entry.signedIn !== void 0;
|
|
2453
2459
|
}
|
|
2454
2460
|
function signInRequired(message, details) {
|
|
2455
|
-
return new CliError("CLI_SIGNIN_REQUIRED", message, { exit: Exit.NOT_SIGNED_IN, next:
|
|
2461
|
+
return new CliError("CLI_SIGNIN_REQUIRED", message, { exit: Exit.NOT_SIGNED_IN, next: SIGN_IN_NEXT, details });
|
|
2456
2462
|
}
|
|
2457
2463
|
async function forgetKey(home, env, key, reason) {
|
|
2458
2464
|
await updateEntry(home, env, (entry) => {
|
|
@@ -3459,10 +3465,7 @@ function heldLine(ctx, env, entry) {
|
|
|
3459
3465
|
const credential = keyOf(entry);
|
|
3460
3466
|
if (credential && Date.parse(credential.expires) > ctx.now()) return keyLine(credential, env, entry);
|
|
3461
3467
|
if (holdsAccount(entry)) {
|
|
3462
|
-
throw notSignedIn(
|
|
3463
|
-
"This machine has signed in to Kombai before; sign in again with kombai login.",
|
|
3464
|
-
notSignedInReason(entry)
|
|
3465
|
-
);
|
|
3468
|
+
throw notSignedIn("This machine has signed in to Kombai before; sign in again.", notSignedInReason(entry));
|
|
3466
3469
|
}
|
|
3467
3470
|
return hasGuest(entry) ? guestLine(entry, env) : null;
|
|
3468
3471
|
}
|
|
@@ -3482,8 +3485,8 @@ function whoamiLine(ctx, env, entry) {
|
|
|
3482
3485
|
status: "guest",
|
|
3483
3486
|
guestId: entry.guestId,
|
|
3484
3487
|
canvas: entry.canvasId ?? null,
|
|
3485
|
-
expires: entry.guestExpires ?? null
|
|
3486
|
-
next:
|
|
3488
|
+
expires: entry.guestExpires ?? null
|
|
3489
|
+
// No next: a guest already chose to try Kombai without an account, and the sign-in topic says to work on as one.
|
|
3487
3490
|
};
|
|
3488
3491
|
}
|
|
3489
3492
|
function keyLine(credential, env, entry) {
|
|
@@ -3510,10 +3513,10 @@ function unavailable(error2, again) {
|
|
|
3510
3513
|
error2.next = again;
|
|
3511
3514
|
return error2;
|
|
3512
3515
|
}
|
|
3513
|
-
function loginExpired() {
|
|
3516
|
+
function loginExpired(again) {
|
|
3514
3517
|
return new CliError("CLI_LOGIN_EXPIRED", "The sign-in code expired before it was approved.", {
|
|
3515
3518
|
exit: Exit.TIMED_OUT,
|
|
3516
|
-
next:
|
|
3519
|
+
next: again
|
|
3517
3520
|
});
|
|
3518
3521
|
}
|
|
3519
3522
|
var REUSE_KEY_MS, POLL_MS2, RSA_BITS, LOGIN_WINDOW_MS, login, logout, whoami, guest, claim;
|
|
@@ -3536,13 +3539,15 @@ var init_auth = __esm({
|
|
|
3536
3539
|
LOGIN_WINDOW_MS = 6e5;
|
|
3537
3540
|
login = {
|
|
3538
3541
|
name: "login",
|
|
3539
|
-
summary: "Sign in through the browser. Prints a waiting line with a match code at once, then the signed-in line. A key with more than 3 days left is reused. With a guest token here, it then claims the guest canvas into the account.",
|
|
3542
|
+
summary: "Sign in through the browser. Prints a waiting line with a match code at once, then the signed-in line. --no-browser opens nothing: an agent with a browser panel the user can see runs it so and opens the waiting line's url there. A key with more than 3 days left is reused. With a guest token here, it then claims the guest canvas into the account.",
|
|
3540
3543
|
flags: {
|
|
3541
3544
|
force: { type: "boolean" },
|
|
3542
3545
|
"no-browser": { type: "boolean" }
|
|
3543
3546
|
},
|
|
3544
3547
|
example: "kombai login",
|
|
3545
3548
|
async run(ctx, { flags }) {
|
|
3549
|
+
const asked = ["kombai login", flags.force ? "--force" : "", flags["no-browser"] ? "--no-browser" : ""].filter(Boolean).join(" ");
|
|
3550
|
+
const again = asked === "kombai login" ? SIGN_IN_NEXT : asked;
|
|
3546
3551
|
const { env, hosts } = await currentEnv(ctx);
|
|
3547
3552
|
const existing = await readCredential(ctx.home, env);
|
|
3548
3553
|
if (!flags.force && existing && Date.parse(existing.expires) - ctx.now() > REUSE_KEY_MS) {
|
|
@@ -3570,11 +3575,11 @@ var init_auth = __esm({
|
|
|
3570
3575
|
});
|
|
3571
3576
|
const b = res.body;
|
|
3572
3577
|
if (!b || typeof b.code !== "string" || typeof b.matchCode !== "string" || typeof b.approveUrl !== "string" || !b.approveUrl.startsWith(`${hosts.web}/`) || !Number.isFinite(Date.parse(b.expiresAt)))
|
|
3573
|
-
throw new CliError("CLI_BAD_ANSWER", "The sign-in answer was not a login code.", { next:
|
|
3578
|
+
throw new CliError("CLI_BAD_ANSWER", "The sign-in answer was not a login code.", { next: again });
|
|
3574
3579
|
started = b;
|
|
3575
3580
|
serverDate = res.headers.get("date");
|
|
3576
3581
|
} catch (error2) {
|
|
3577
|
-
if (error2 instanceof LostAnswer) error2.next =
|
|
3582
|
+
if (error2 instanceof LostAnswer) error2.next = again;
|
|
3578
3583
|
throw error2;
|
|
3579
3584
|
}
|
|
3580
3585
|
ctx.emit({
|
|
@@ -3597,9 +3602,9 @@ var init_auth = __esm({
|
|
|
3597
3602
|
})).body;
|
|
3598
3603
|
} catch (error2) {
|
|
3599
3604
|
if (!(error2 instanceof CliError)) throw error2;
|
|
3600
|
-
if (error2.code === "CLI_TIMEOUT") throw loginExpired();
|
|
3605
|
+
if (error2.code === "CLI_TIMEOUT") throw loginExpired(again);
|
|
3601
3606
|
if (error2.code === "SIGNIN_LOGIN_GONE") {
|
|
3602
|
-
error2.next =
|
|
3607
|
+
error2.next = again;
|
|
3603
3608
|
throw error2;
|
|
3604
3609
|
}
|
|
3605
3610
|
if (!(error2 instanceof LostAnswer) && error2.status !== 503) throw error2;
|
|
@@ -3620,7 +3625,7 @@ var init_auth = __esm({
|
|
|
3620
3625
|
await writeCredential(ctx.home, env, credential);
|
|
3621
3626
|
return { status: "signed_in", ...identity(credential, env), ...await claimGuest(ctx, env) };
|
|
3622
3627
|
}
|
|
3623
|
-
if (deadline.remaining() <= POLL_MS2) throw loginExpired();
|
|
3628
|
+
if (deadline.remaining() <= POLL_MS2) throw loginExpired(again);
|
|
3624
3629
|
await ctx.sleep(POLL_MS2);
|
|
3625
3630
|
}
|
|
3626
3631
|
}
|
|
@@ -3676,7 +3681,7 @@ var init_auth = __esm({
|
|
|
3676
3681
|
};
|
|
3677
3682
|
guest = {
|
|
3678
3683
|
name: "guest",
|
|
3679
|
-
summary: "Try Kombai without an account: one canvas, no taste runs, repo images, design systems or sharing. Run it only when the user chose that.
|
|
3684
|
+
summary: "Try Kombai without an account: one canvas, no taste runs, repo images, design systems or sharing. Run it only when the user chose that. Signing in later keeps the canvas.",
|
|
3680
3685
|
async run(ctx) {
|
|
3681
3686
|
const { env, hosts } = await currentEnv(ctx);
|
|
3682
3687
|
const held = heldLine(ctx, env, await readEntry(ctx.home, env));
|
|
@@ -8290,9 +8295,7 @@ var init_canvas = __esm({
|
|
|
8290
8295
|
}
|
|
8291
8296
|
);
|
|
8292
8297
|
}
|
|
8293
|
-
if (error2 instanceof CliError && error2.code === "DESIGN_ORG_REQUIRED")
|
|
8294
|
-
error2.next = `kombai canvas create --name ${JSON.stringify(name)} --org <id>`;
|
|
8295
|
-
}
|
|
8298
|
+
if (error2 instanceof CliError && error2.code === "DESIGN_ORG_REQUIRED") error2.next = "kombai config org <id>";
|
|
8296
8299
|
if (error2 instanceof CliError && error2.code === "DESIGN_GUEST_LIMIT" && typeof error2.details?.canvasId === "string")
|
|
8297
8300
|
await rememberGuestCanvas(ctx, cc, error2.details.canvasId);
|
|
8298
8301
|
throw error2;
|
|
@@ -8336,13 +8339,18 @@ var init_canvas = __esm({
|
|
|
8336
8339
|
};
|
|
8337
8340
|
canvasList = {
|
|
8338
8341
|
name: "canvas list",
|
|
8339
|
-
summary: "List this repo's
|
|
8340
|
-
flags: {
|
|
8341
|
-
|
|
8342
|
+
summary: "List every canvas you can see, in every project: this repo's first, then the rest, each newest first within each owner; with --project, only that project's. projectId names each one's project and checkoutProjectId this repo's; dir is null for a canvas not pulled in this checkout. deleted names canvases deleted since, whose folders here were kept for work that was not pushed.",
|
|
8343
|
+
flags: {
|
|
8344
|
+
project: { type: "string", placeholder: "<id>", check: projectIdProblem },
|
|
8345
|
+
// Every project is the default; kept so an older skill's `canvas list --all` still runs.
|
|
8346
|
+
all: { type: "boolean", hidden: true }
|
|
8347
|
+
},
|
|
8348
|
+
exclusive: [["project", "all"]],
|
|
8349
|
+
example: "kombai canvas list --project prj_0123456789abcdef",
|
|
8342
8350
|
async run(ctx, { flags }) {
|
|
8343
8351
|
const cc = await canvasContext(ctx, flags, { allowGuest: flags.all !== true });
|
|
8344
|
-
const
|
|
8345
|
-
const listPath =
|
|
8352
|
+
const project = typeof flags.project === "string" ? flags.project : cc.session.kind === "guest" ? cc.checkout.projectId : null;
|
|
8353
|
+
const listPath = project ? `/design/projects/${project}/canvases` : "/design/canvases";
|
|
8346
8354
|
const items = [];
|
|
8347
8355
|
let cursor;
|
|
8348
8356
|
do {
|
|
@@ -8354,9 +8362,15 @@ var init_canvas = __esm({
|
|
|
8354
8362
|
items.push(...res.body.items);
|
|
8355
8363
|
cursor = res.body.nextCursor ?? void 0;
|
|
8356
8364
|
} while (cursor);
|
|
8357
|
-
const
|
|
8365
|
+
const named2 = items.map((item) => ({
|
|
8366
|
+
item,
|
|
8367
|
+
/** @type {string | null} */
|
|
8368
|
+
projectId: typeof item.projectId === "string" && item.projectId ? item.projectId : project
|
|
8369
|
+
}));
|
|
8370
|
+
const here = (entry) => entry.projectId === cc.checkout.projectId;
|
|
8371
|
+
const listed = [...named2.filter(here), ...named2.filter((entry) => !here(entry))];
|
|
8358
8372
|
const ws = await loadWorkspace(cc.work, cc.checkout, (ws2) => {
|
|
8359
|
-
for (const item of
|
|
8373
|
+
for (const { item, projectId } of listed) if (projectId) ws2.canvases[item.id] = projectId;
|
|
8360
8374
|
});
|
|
8361
8375
|
const deleted = [];
|
|
8362
8376
|
for (const [canvasId, at] of Object.entries(ws.deleted)) {
|
|
@@ -8371,8 +8385,7 @@ var init_canvas = __esm({
|
|
|
8371
8385
|
});
|
|
8372
8386
|
}
|
|
8373
8387
|
const canvases = await Promise.all(
|
|
8374
|
-
|
|
8375
|
-
const projectId = projectOfItem(item);
|
|
8388
|
+
listed.map(async ({ item, projectId }) => {
|
|
8376
8389
|
const dir = canvasPaths(cc.work, item.id).dir;
|
|
8377
8390
|
return {
|
|
8378
8391
|
canvasId: item.id,
|
|
@@ -8383,11 +8396,11 @@ var init_canvas = __esm({
|
|
|
8383
8396
|
sharing: item.sharing,
|
|
8384
8397
|
ownerKey: item.ownerKey,
|
|
8385
8398
|
projectId,
|
|
8386
|
-
dir:
|
|
8399
|
+
dir: await exists(dir) ? dir : null
|
|
8387
8400
|
};
|
|
8388
8401
|
})
|
|
8389
8402
|
);
|
|
8390
|
-
return { canvases, ...deleted.length ? { deleted } : {} };
|
|
8403
|
+
return { checkoutProjectId: cc.checkout.projectId, canvases, ...deleted.length ? { deleted } : {} };
|
|
8391
8404
|
}
|
|
8392
8405
|
};
|
|
8393
8406
|
canvasDelete = {
|
|
@@ -8748,14 +8761,13 @@ var init_canvas = __esm({
|
|
|
8748
8761
|
flags: { canvas: { type: "string", required: true, placeholder: "<id|link>", check: canvasRefProblem } },
|
|
8749
8762
|
async run(ctx, { flags }) {
|
|
8750
8763
|
const cc = await canvasContext(ctx, flags, { allowGuest: true });
|
|
8751
|
-
const inApp = `kombai canvas url --canvas ${cc.canvasId} --in-app`;
|
|
8752
8764
|
if (!ctx.hasDisplay) {
|
|
8753
8765
|
await readForLink(cc);
|
|
8754
|
-
return { url: `${cc.session.hosts.web}/c/${cc.canvasId}`, opened: false
|
|
8766
|
+
return { url: `${cc.session.hosts.web}/c/${cc.canvasId}`, opened: false };
|
|
8755
8767
|
}
|
|
8756
8768
|
const url2 = await ticketedUrl(ctx, cc);
|
|
8757
8769
|
const opened = await ctx.openUrl(url2);
|
|
8758
|
-
return { url: url2.split("#")[0], opened
|
|
8770
|
+
return { url: url2.split("#")[0], opened };
|
|
8759
8771
|
}
|
|
8760
8772
|
};
|
|
8761
8773
|
}
|
|
@@ -8809,9 +8821,7 @@ var init_config = __esm({
|
|
|
8809
8821
|
if (!credential) {
|
|
8810
8822
|
const entry = await readEntry(ctx.home, env);
|
|
8811
8823
|
if (isPureGuest(entry))
|
|
8812
|
-
throw signInRequired(
|
|
8813
|
-
"The preference is kept per signed-in user, and this machine is a guest. Sign in with kombai login."
|
|
8814
|
-
);
|
|
8824
|
+
throw signInRequired("The preference is kept per signed-in user, and this machine is a guest: sign in first.");
|
|
8815
8825
|
throw notSignedIn("Sign in first: the preference is kept per signed-in user.", notSignedInReason(entry));
|
|
8816
8826
|
}
|
|
8817
8827
|
if (org !== void 0) await checkMember(ctx, org);
|
|
@@ -33261,7 +33271,7 @@ var init_cards = __esm({
|
|
|
33261
33271
|
signInTool = (resourceUri) => ({
|
|
33262
33272
|
name: SIGN_IN_CARD_TOOL,
|
|
33263
33273
|
title: "Kombai",
|
|
33264
|
-
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; 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. When they say they have signed in, run kombai whoami.",
|
|
33274
|
+
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; 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, and 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.",
|
|
33265
33275
|
inputSchema: {
|
|
33266
33276
|
type: "object",
|
|
33267
33277
|
properties: { reason: { type: "string", enum: Object.values(SignInReason) } },
|
|
@@ -33698,6 +33708,21 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
33698
33708
|
postToFrame({ kind: 'download-failed', canvasId: id, message: error.message, code: error.code || null });
|
|
33699
33709
|
});
|
|
33700
33710
|
}
|
|
33711
|
+
// A draft's blocks (draftContent in the file header).
|
|
33712
|
+
var PARTS_MAX = 100, TITLE_MAX = 200;
|
|
33713
|
+
function draftContent(m) {
|
|
33714
|
+
var parts = m.parts;
|
|
33715
|
+
var valid = Array.isArray(parts) && parts.length > 0 && parts.length <= PARTS_MAX &&
|
|
33716
|
+
parts.every(function (p) { return !!p && typeof p.text === 'string' && p.text.length > 0; });
|
|
33717
|
+
if (!valid) return [{ type: 'text', text: m.text }];
|
|
33718
|
+
return parts.map(function (p) {
|
|
33719
|
+
var block = { type: 'text', text: p.text };
|
|
33720
|
+
if (typeof p.title === 'string' && p.title.length > 0 && p.title.length <= TITLE_MAX) {
|
|
33721
|
+
block._meta = { 'openai/title': p.title };
|
|
33722
|
+
}
|
|
33723
|
+
return block;
|
|
33724
|
+
});
|
|
33725
|
+
}
|
|
33701
33726
|
function fromPage(m) {
|
|
33702
33727
|
if (!m || m.kombai !== EMBED || m.v !== PROTOCOL || typeof m.kind !== 'string') return;
|
|
33703
33728
|
if (m.kind === 'ready') { postToFrame(hello()); return; }
|
|
@@ -33716,7 +33741,7 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
33716
33741
|
var send = SEND_ACTIONS && m.kind === 'action';
|
|
33717
33742
|
request('ui/message', {
|
|
33718
33743
|
role: 'user',
|
|
33719
|
-
content:
|
|
33744
|
+
content: draftContent(m),
|
|
33720
33745
|
_meta: { 'openai/message': { target: 'active', send: send } },
|
|
33721
33746
|
}).catch(function () {});
|
|
33722
33747
|
return;
|
|
@@ -34211,7 +34236,7 @@ var init_server3 = __esm({
|
|
|
34211
34236
|
var actions_default;
|
|
34212
34237
|
var init_actions = __esm({
|
|
34213
34238
|
"src/skill/actions.md"() {
|
|
34214
|
-
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. Each request is one sentence
|
|
34239
|
+
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 copied from the canvas comes from a page the user has open: don\'t show\nthe canvas again. A canvas the user only named: show 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, and before each fix after a push (the push\nends it). If you stop without pushing, or drop your edit with node pull --discard, run\n`kombai node unlock --canvas <link> --node <node>`. If node lock fails, go on without it; a drawing takes\nno 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';
|
|
34215
34240
|
}
|
|
34216
34241
|
});
|
|
34217
34242
|
|
|
@@ -34235,7 +34260,7 @@ var init_claude_desktop = __esm({
|
|
|
34235
34260
|
var design_system_default;
|
|
34236
34261
|
var init_design_system = __esm({
|
|
34237
34262
|
"src/skill/design-system.md"() {
|
|
34238
|
-
design_system_default = '# Design systems\n\nA design system is a .ds file in the user\'s Kombai account, not the repo: YAML front matter between\n`---` lines holds the tokens; the markdown after it says how to use them. Read a pulled one as the\nmodel. `kombai ds push` checks it with ds-kit.\n\n- `name` (required) and `modes`: `[light]`, `[dark]` or `[light, dark]`.\n- `color.palette` (required): named colors as quoted hex, rgb() or hsl().\n- `color.semantic`: the 11 roles in the example. Each is a ref, or `{ light: <ref>, dark: <ref> }`.\n- `typography.family`, and `typography.textStyle` with fontFamily, fontSize, fontWeight, lineHeight.\n- Optional: spacing, radius, shadow, border, opacity, motion, breakpoint, components.\n\nEvery ref must name a key you defined: `{colors.X}` (palette, also written `{color.palette.X}`), `{typography.X}` (textStyle),\n`{radius.X}`, `{spacing.X}`, `{shadow.X}`. One ref per value. The body starts with a `>` line, then\noptional `##` sections: Instructions, Brand & Accent, Surface, Text, Status & Semantic, Fonts, Layout,\nComponents, Do, Don\'t, Notes. At most 1 MB.\n\n```\n---\nname: Acme\nmodes: [light]\ncolor:\n palette: { brand: "#3b5bdb", white: "#ffffff", ink: "#16181d", line: "#e4e7ec" }\n semantic:\n background.canvas: "{colors.white}"\n surface.default: "{colors.white}"\n surface.raised: "{colors.white}"\n text.primary: "{colors.ink}"\n text.secondary: "{colors.ink}"\n text.tertiary: "{colors.ink}"\n text.link: "{colors.brand}"\n border.default: "{colors.line}"\n border.focus: "{colors.brand}"\n primary.bg: "{colors.brand}"\n primary.fg: "{colors.white}"\ntypography:\n family: { sans: "Inter" }\n textStyle:\n body: { fontFamily: "Inter", fontSize: "16px", fontWeight: 400, lineHeight: 1.5 }\ncomponents:\n button: { type: button, label: "Get started", backgroundColor: "{colors.brand}", textColor: "{colors.white}", typography: "{typography.body}", padding: "10px 18px" }\n---\n\n> One indigo accent on white, Inter throughout.\n```\n\n## Commands\n\n- `kombai ds list`: each one\'s slug, name, ownerKey, and file (null if not pulled here), and in\n publicDesignSystems Kombai\'s public ones, each with its id, name, description and file.\n- `kombai ds pull <slug>` writes the file it prints. Edit it, then `kombai ds push <file>`.\n- A public one is read-only: `kombai ds pull <id> --public` writes the file it prints. Use it as it is;\n never push or delete it.\n- To make one, write `<slug>.ds` outside the repo and push it. The file name gives the slug (lowercase\n letters, digits, dashes; a leading `ds-` is dropped); pick one `ds list` does not show. Then edit\n the file the push prints: pushing your first file again is a conflict.\n- A refused file exits 1 with CLI_INVALID_DESIGN_SYSTEM naming each problem: fix them and push again.\n Fix its warnings too.\n- `kombai ds delete <slug>` deletes one for everyone. Run it only when the user asks.\n\nownerKey is `org:<id>` (an organization\'s) or `user:<id>` (the user\'s own). A pulled file goes back to\nits owner; a new one goes to `--org <id>`, else the organization `kombai config org` saved. On\nDESIGN_ORG_REQUIRED, ask the user which of details.orgIds, then push with `--org <id>`. On\nCLI_OWNER_REQUIRED (a slug in several scopes), add `--owner <ownerKey>` from details.ownerKeys, asking\nthe user if unclear.\n\n## From a repo\n\n1. Read the Tailwind config, CSS custom properties (globals.css :root and .dark), theme or token\n files, the font setup and the shared components.\n2. Copy values; never invent a color. Name keys as the code does. Write `--primary: 222 47% 11%` as\n `"hsl(222 47% 11%)"`, and oklch or named colors as hex.\n3. Map each role by how the code uses a color: page, cards, text levels, links, dividers, focus ring,\n primary button and its text. With no match, reuse the closest ref.\n4. `[light, dark]` only when the code has dark values; roles that change become light/dark maps.\n5. Add text styles (headings, body, labels) and the spacing, radius, shadow and breakpoint scales the\n code defines.\n6. Add each real component and variant, typed button, link, icon, icon-round, input, tab, badge, nav,\n avatar, logo, section, card, divider or check, with a label from the UI.\n7. Body: up to 8 Instructions (which token for what), color sections naming `{colors.X}`, Fonts,\n Layout (max width, grid, gutters), a line per component, Do and Don\'t, and Notes for gaps.\n8. Check every ref, then push.\n\n## In designs\n\nDesigns do not link to a design system: canvas.json and nodes have no field for it. Pull it and write\nits values into the HTML (`bg-[#3b5bdb]`, or CSS variables in a `<style>`), following its\nInstructions, Do and Don\'t. The canvas\'s Apply menu asks to regenerate a design "with the <name>\ndesign system": find it by name in `kombai ds list`, pull it and the node, restyle the design keeping\nits content, and push the node. A pasted `
|
|
34263
|
+
design_system_default = '# Design systems\n\nA design system is a .ds file in the user\'s Kombai account, not the repo: YAML front matter between\n`---` lines holds the tokens; the markdown after it says how to use them. Read a pulled one as the\nmodel. `kombai ds push` checks it with ds-kit.\n\n- `name` (required) and `modes`: `[light]`, `[dark]` or `[light, dark]`.\n- `color.palette` (required): named colors as quoted hex, rgb() or hsl().\n- `color.semantic`: the 11 roles in the example. Each is a ref, or `{ light: <ref>, dark: <ref> }`.\n- `typography.family`, and `typography.textStyle` with fontFamily, fontSize, fontWeight, lineHeight.\n- Optional: spacing, radius, shadow, border, opacity, motion, breakpoint, components.\n\nEvery ref must name a key you defined: `{colors.X}` (palette, also written `{color.palette.X}`), `{typography.X}` (textStyle),\n`{radius.X}`, `{spacing.X}`, `{shadow.X}`. One ref per value. The body starts with a `>` line, then\noptional `##` sections: Instructions, Brand & Accent, Surface, Text, Status & Semantic, Fonts, Layout,\nComponents, Do, Don\'t, Notes. At most 1 MB.\n\n```\n---\nname: Acme\nmodes: [light]\ncolor:\n palette: { brand: "#3b5bdb", white: "#ffffff", ink: "#16181d", line: "#e4e7ec" }\n semantic:\n background.canvas: "{colors.white}"\n surface.default: "{colors.white}"\n surface.raised: "{colors.white}"\n text.primary: "{colors.ink}"\n text.secondary: "{colors.ink}"\n text.tertiary: "{colors.ink}"\n text.link: "{colors.brand}"\n border.default: "{colors.line}"\n border.focus: "{colors.brand}"\n primary.bg: "{colors.brand}"\n primary.fg: "{colors.white}"\ntypography:\n family: { sans: "Inter" }\n textStyle:\n body: { fontFamily: "Inter", fontSize: "16px", fontWeight: 400, lineHeight: 1.5 }\ncomponents:\n button: { type: button, label: "Get started", backgroundColor: "{colors.brand}", textColor: "{colors.white}", typography: "{typography.body}", padding: "10px 18px" }\n---\n\n> One indigo accent on white, Inter throughout.\n```\n\n## Commands\n\n- `kombai ds list`: each one\'s slug, name, ownerKey, and file (null if not pulled here), and in\n publicDesignSystems Kombai\'s public ones, each with its id, name, description and file.\n- `kombai ds pull <slug>` writes the file it prints. Edit it, then `kombai ds push <file>`.\n- A public one is read-only: `kombai ds pull <id> --public` writes the file it prints. Use it as it is;\n never push or delete it.\n- To make one, write `<slug>.ds` outside the repo and push it. The file name gives the slug (lowercase\n letters, digits, dashes; a leading `ds-` is dropped); pick one `ds list` does not show. Then edit\n the file the push prints: pushing your first file again is a conflict.\n- A refused file exits 1 with CLI_INVALID_DESIGN_SYSTEM naming each problem: fix them and push again.\n Fix its warnings too.\n- `kombai ds delete <slug>` deletes one for everyone. Run it only when the user asks.\n\nownerKey is `org:<id>` (an organization\'s) or `user:<id>` (the user\'s own). A pulled file goes back to\nits owner; a new one goes to `--org <id>`, else the organization `kombai config org` saved. On\nDESIGN_ORG_REQUIRED, ask the user which of details.orgIds, then push with `--org <id>`. On\nCLI_OWNER_REQUIRED (a slug in several scopes), add `--owner <ownerKey>` from details.ownerKeys, asking\nthe user if unclear.\n\n## From a repo\n\n1. Read the Tailwind config, CSS custom properties (globals.css :root and .dark), theme or token\n files, the font setup and the shared components.\n2. Copy values; never invent a color. Name keys as the code does. Write `--primary: 222 47% 11%` as\n `"hsl(222 47% 11%)"`, and oklch or named colors as hex.\n3. Map each role by how the code uses a color: page, cards, text levels, links, dividers, focus ring,\n primary button and its text. With no match, reuse the closest ref.\n4. `[light, dark]` only when the code has dark values; roles that change become light/dark maps.\n5. Add text styles (headings, body, labels) and the spacing, radius, shadow and breakpoint scales the\n code defines.\n6. Add each real component and variant, typed button, link, icon, icon-round, input, tab, badge, nav,\n avatar, logo, section, card, divider or check, with a label from the UI.\n7. Body: up to 8 Instructions (which token for what), color sections naming `{colors.X}`, Fonts,\n Layout (max width, grid, gutters), a line per component, Do and Don\'t, and Notes for gaps.\n8. Check every ref, then push.\n\n## In designs\n\nDesigns do not link to a design system: canvas.json and nodes have no field for it. Pull it and write\nits values into the HTML (`bg-[#3b5bdb]`, or CSS variables in a `<style>`), following its\nInstructions, Do and Don\'t. The canvas\'s Apply menu asks to regenerate a design "with the <name>\ndesign system": find it by name in `kombai ds list`, pull it and the node, restyle the design keeping\nits content, and push the node. A pasted `refer design system: <name>` (Add to context in the Design\nsystems panel) names it: find that name in `kombai ds list`, in designSystems (pull with `kombai ds\npull <slug>`) or publicDesignSystems (`kombai ds pull <id> --public`), and use it for the user\'s\nrequest in the same message. If the name matches more than one, ask which. The user can view one at\n/ds/<slug>, a public one at /ds?preset=<id>, on the canvas site.\n\n## Conflicts\n\nExit 2 on a push (DESIGN_DESIGN_SYSTEM_CHANGED): it changed since you pulled it, or already existed.\nThe stored version is saved at details.remote. Merge it into your file and run the error\'s next\n(`kombai ds push <file> --merged`); if it is a different design system, rename your file instead.\n`kombai ds pull <slug> --discard` takes the stored one. Exit 2 on a pull: push your edits first, or\npull with --discard.\n';
|
|
34239
34264
|
}
|
|
34240
34265
|
});
|
|
34241
34266
|
|
|
@@ -34251,7 +34276,7 @@ var init_drawings = __esm({
|
|
|
34251
34276
|
var faq_default;
|
|
34252
34277
|
var init_faq = __esm({
|
|
34253
34278
|
"src/skill/faq.md"() {
|
|
34254
|
-
faq_default = "# Questions about Kombai\n\nAnswer the user's question from this text, briefly and in your own words. To answer, run only commands that\nchange nothing (`kombai whoami`, `kombai credits`, `kombai canvas list`). If the answer is not here, say so and\npoint them to support@kombai.com; don't guess. For design work, run `kombai skill` and follow it.\n\n## What Kombai is\n\n- **What it does.** Kombai is an AI design engineer. The coding agent runs the Kombai CLI: Kombai's taste agent\n writes design directions grounded in the user's brief and repo, and the agent builds each design as HTML on a\n hosted Kombai canvas, where the user compares, edits and refines the designs in the browser.\n- **Which agents.** Claude Code, Codex and Cursor have Kombai plugins; any agent with a terminal can run the CLI.\n
|
|
34279
|
+
faq_default = "# Questions about Kombai\n\nAnswer the user's question from this text, briefly and in your own words. To answer, run only commands that\nchange nothing (`kombai whoami`, `kombai credits`, `kombai canvas list`). If the answer is not here, say so and\npoint them to support@kombai.com; don't guess. For design work, run `kombai skill` and follow it.\n\n## What Kombai is\n\n- **What it does.** Kombai is an AI design engineer. The coding agent runs the Kombai CLI: Kombai's taste agent\n writes design directions grounded in the user's brief and repo, and the agent builds each design as HTML on a\n hosted Kombai canvas, where the user compares, edits and refines the designs in the browser.\n- **Which agents.** Claude Code, Codex and Cursor have Kombai plugins; any agent with a terminal can run the CLI.\n The Codex app shows the canvas beside the chat, and it and the Claude desktop app's Code tab show Kombai's cards\n (a taste run's brief, sign-in); elsewhere the canvas opens in the agent's own browser panel or the browser.\n- **The Kombai desktop app** is not needed: the CLI designs on a hosted canvas whether or not it is installed.\n- **Requirements.** Node.js 20 or later, and a Kombai account or guest mode. Thumbnails need a Chromium browser\n (Chrome, Edge, Brave, Arc or Chromium); without one, `kombai browser install` downloads a headless Chromium of\n about 100 MB, after asking.\n\n## Account and credits\n\n- **Without an account.** `kombai guest` gives one canvas, with no taste runs, repo images, design systems or\n sharing. The guest canvas ends on the date `kombai whoami` shows; signing in keeps it.\n- **Signing in.** `kombai login` shows a match code and opens a Kombai page in the browser, or in the agent's own\n browser panel: approve there only if the codes match. `kombai whoami` shows who is signed in. `kombai logout`\n signs this machine out; `kombai logout --everywhere` also signs out every other key, the Kombai app and the website.\n- **Credits.** Taste runs spend Kombai credits; `kombai credits` shows what is left, the plan and when it refills.\n On a team plan they are the team's shared pool. With none left, its next is the plans page. The designs\n themselves are written by the user's own coding agent, on that agent's usage.\n- **Organizations.** With several, `kombai config org <id>` sets which one owns new canvases and design systems.\n\n## Designs and data\n\n- **Where designs live.** On hosted canvases in the user's Kombai account. `kombai canvas list` lists every\n one (`--project <id>` one project's; this repo's carry its `checkoutProjectId`), and\n `kombai canvas open --canvas <id>` opens one in the browser.\n- **Editing.** The user can edit text, styles and layout on the canvas, or ask for a change from it: the canvas\n gives them a request to paste into this chat.\n- **Into code.** Ask the agent to build a design in this project: it writes it in the repo's own framework,\n components and styles, with the design as the reference.\n- **Design systems** are .ds files in the Kombai account and need no canvas; `kombai ds list` lists them.\n- **Sharing.** A new canvas is private. `kombai canvas share --canvas <id> --on` lets anyone with the link view it\n and teammates edit it; `--off` turns that off. Only the canvas's owner can.\n- **What Kombai receives.** The brief the agent writes for a taste run, each design's HTML, the repo images a\n design uses, files the agent uploads, design systems it pushes, and the thumbnails rendered on this machine.\n The rest of the repo is not uploaded.\n- **What stays here.** The sign-in key and the working copies of canvases, under ~/.kombai/cli.\n- **Usage data.** The CLI sends Kombai an event for each command (which ran, how it ended, how long it took) and\n reports unexpected errors. `DO_NOT_TRACK=1` turns both off.\n- **Deleting.** `kombai canvas delete --canvas <id>` and `kombai ds delete <slug>` delete for everyone. Deleting\n ~/.kombai removes what is stored on this machine. To close the account, email support@kombai.com.\n\n## Setup and problems\n\n- **Permissions.** Kombai needs network access and writes ~/.kombai, so an agent with a sandbox asks to run it\n outside.\n- **The desktop app's skills.** The first Kombai command on a machine removes the skills the Kombai desktop app\n wrote into the agents' skills folders (`design-with-kombai`, `kombai-faq`, `kombai-status` and the rest), which\n drive the app instead of the CLI. Only the app's own copies go; other skills, the user's own included, stay. An\n agent session that was already open lists them until it restarts.\n- **Updates.** The plugins run the CLI through npx, which fetches the newest release itself; a global install\n updates with npm. The plugin updates through the agent's own plugin manager.\n- **Reporting a problem.** Email support@kombai.com with the command, the JSON line it printed and the version\n `kombai --version` prints.\n";
|
|
34255
34280
|
}
|
|
34256
34281
|
});
|
|
34257
34282
|
|
|
@@ -34267,7 +34292,7 @@ var init_html = __esm({
|
|
|
34267
34292
|
var opening_default;
|
|
34268
34293
|
var init_opening = __esm({
|
|
34269
34294
|
"src/skill/opening.md"() {
|
|
34270
|
-
opening_default = "# Showing the canvas\n\nShow a canvas to the user once, when you create or first use it. The page updates live as you push, so\nnever open it again after a push. Pick the first of these that fits:\n\n1. **A `canvas_app` tool is listed** (the Kombai view): call `canvas_app` with the canvas id, and `node`\n set to a design id to focus one. It shows the canvas beside the chat. Call it once per canvas: each\n call opens another view. Make changes with the commands, never through the view.\n2. **You have a browser panel
|
|
34295
|
+
opening_default = "# Showing the canvas\n\nShow a canvas to the user once, when you create or first use it. The page updates live as you push, so\nnever open it again after a push. Pick the first of these that fits:\n\n1. **A `canvas_app` tool is listed** (the Kombai view): call `canvas_app` with the canvas id, and `node`\n set to a design id to focus one. It shows the canvas beside the chat. Call it once per canvas: each\n call opens another view. Make changes with the commands, never through the view.\n2. **You have a browser panel the user can see** (the one you sign in with, `kombai skill sign-in`):\n `kombai canvas url --canvas <id> --in-app` prints a signed-in link. Open it in your panel. It works once,\n within 10 minutes; for a later visit, run it again.\n3. **Otherwise**: `kombai canvas open --canvas <id>` opens the canvas in the user's browser, signed in.\n If it answers opened: false (no browser on this machine), give the user the link it printed instead.\n\nTo point the user at one design, give the `url` node start, node pull or node push printed for it, or\nadd ?node=<node> to the canvas link. Never the design's .html file, and never a link that holds a\n#ticket=; it signs in whoever opens it first.\n\n**Beside the chat, no links.** Once `canvas_app` shows the canvas, the user watches every change there.\nEnd with a short line on what you made or changed, naming designs by their labels. Put no canvas or\ndesign link in your replies, and don't ask the user to open the canvas. Give a link only when the user\nasks for one.\n\n**A new canvas is private.** When you give the user a link, don't suggest they send it to anyone before sharing it.\n\n**Never turn sharing on by yourself.** Run `kombai canvas share --on` only when the user asks for a link others can open, and tell them in the reply that anyone with the link can now view it and teammates can edit it.\n";
|
|
34271
34296
|
}
|
|
34272
34297
|
});
|
|
34273
34298
|
|
|
@@ -34275,7 +34300,7 @@ var init_opening = __esm({
|
|
|
34275
34300
|
var overview_default;
|
|
34276
34301
|
var init_overview = __esm({
|
|
34277
34302
|
"src/skill/overview.md"() {
|
|
34278
|
-
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
|
|
34303
|
+
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- 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 listed, 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.\nRun node lock, fix and push again, 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';
|
|
34279
34304
|
}
|
|
34280
34305
|
});
|
|
34281
34306
|
|
|
@@ -34283,7 +34308,7 @@ var init_overview = __esm({
|
|
|
34283
34308
|
var sign_in_default;
|
|
34284
34309
|
var init_sign_in = __esm({
|
|
34285
34310
|
"src/skill/sign-in.md"() {
|
|
34286
|
-
sign_in_default = "# Signing in, or trying Kombai as a guest\n\nWhat `kombai whoami` printed decides. The reasons
|
|
34311
|
+
sign_in_default = "# Signing in, or trying Kombai as a guest\n\nWhat `kombai whoami` printed decides. Where your tools list `sign_in_card`, it asks the sign-in questions below in\nyour place (read The sign-in card at the end first); you still ask the claim needs_org question yourself. The reasons\nbelow apply to any exit-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- 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 run `kombai login --no-browser`, show the matchCode from its first line, and open the url from that line in your\n panel. The user signs in and approves there. With 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- The canvas link is the user's own. Open it for them; don't suggest sending it 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: signing in unlocks taste directions, 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 in one line that the old guest\n canvas expired and is gone. Never offer `kombai guest`.\n- SIGNIN_GUEST_CLAIMED as an error from a guest's own command: the canvas moved into an account; signing in reaches\n it. As a warning on a signed-in line: nothing to do.\n\n## The sign-in card\n\nWhere your tools list `sign_in_card`, call it in place of the lines above, with the moment's reason, and end your\nturn; don't run or offer `kombai login` in text:\n\n- start: whoami exits 3, in place of asking whether to sign in or try it without an account. The user chooses on the\n 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- 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";
|
|
34287
34312
|
}
|
|
34288
34313
|
});
|
|
34289
34314
|
|
|
@@ -34767,7 +34792,7 @@ async function storeDrawingPicture(cc, projectId, drawing, file2, nodeId, stored
|
|
|
34767
34792
|
}
|
|
34768
34793
|
function repoImagesRefused({ nodeId, images }) {
|
|
34769
34794
|
return signInRequired(
|
|
34770
|
-
"Repo images need a Kombai account. Use CSS, inline SVG or a public https image instead, or sign in
|
|
34795
|
+
"Repo images need a Kombai account. Use CSS, inline SVG or a public https image instead, or sign in.",
|
|
34771
34796
|
{ ...nodeId === void 0 ? {} : { nodeId }, images }
|
|
34772
34797
|
);
|
|
34773
34798
|
}
|
|
@@ -35269,7 +35294,7 @@ var init_node = __esm({
|
|
|
35269
35294
|
};
|
|
35270
35295
|
nodeLock = {
|
|
35271
35296
|
name: "node lock",
|
|
35272
|
-
summary: "Mark a design as being edited, so the canvas shows it busy: run it
|
|
35297
|
+
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, and before each fix after a push. 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.",
|
|
35273
35298
|
flags: {
|
|
35274
35299
|
canvas: { type: "string", required: true, placeholder: "<id|link>", check: canvasRefProblem },
|
|
35275
35300
|
node: { type: "string", required: true, placeholder: "<id>", check: (value) => nodeIdProblem(value) }
|
|
@@ -35685,7 +35710,7 @@ var init_screenshot = __esm({
|
|
|
35685
35710
|
if (result.signedOut)
|
|
35686
35711
|
throw new CliError("UNAUTHORIZED", "The key stopped working.", {
|
|
35687
35712
|
exit: Exit.NOT_SIGNED_IN,
|
|
35688
|
-
next:
|
|
35713
|
+
next: SIGN_IN_NEXT,
|
|
35689
35714
|
details: lists()
|
|
35690
35715
|
});
|
|
35691
35716
|
if (result.guestFull) {
|