@kombai/cli 0.2.2 → 0.2.3-alpha.1
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/ds-kit.mjs +115 -115
- package/dist/files.json +1 -0
- package/dist/kombai.mjs +463 -54
- package/dist/launch.mjs +1 -1
- package/dist/mcp-apps/access.js +48 -43
- package/dist/mcp-apps/design-system.js +2797 -0
- package/dist/mcp-apps/design-taste.js +208 -203
- package/dist/mcp-apps/plans.js +43 -38
- package/dist/mcp-apps/sign-in.js +65 -60
- package/dist/mcp-apps/starters.js +64 -59
- package/package.json +1 -1
package/dist/kombai.mjs
CHANGED
|
@@ -62,9 +62,9 @@ var init_env = __esm({
|
|
|
62
62
|
preprod: { api: "https://api.assistant.preprod.kombai.com", web: "https://agent.preprod.kombai.com" },
|
|
63
63
|
prod: { api: "https://api.assistant.app.kombai.com", web: "https://agent.kombai.com" }
|
|
64
64
|
});
|
|
65
|
-
DEFAULT_ENV = Object.hasOwn(ENVIRONMENTS, "
|
|
65
|
+
DEFAULT_ENV = Object.hasOwn(ENVIRONMENTS, "dev") ? (
|
|
66
66
|
/** @type {EnvName} */
|
|
67
|
-
"
|
|
67
|
+
"dev"
|
|
68
68
|
) : "prod";
|
|
69
69
|
}
|
|
70
70
|
});
|
|
@@ -1050,13 +1050,13 @@ var init_version = __esm({
|
|
|
1050
1050
|
init_define_KOMBAI_TELEMETRY();
|
|
1051
1051
|
init_codexKombaiEntry();
|
|
1052
1052
|
init_place();
|
|
1053
|
-
CLI_VERSION = true ? "0.2.
|
|
1053
|
+
CLI_VERSION = true ? "0.2.3-alpha.1" : (
|
|
1054
1054
|
/** @type {{ version: string }} */
|
|
1055
1055
|
JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version
|
|
1056
1056
|
);
|
|
1057
|
-
CLI_NPX_RUN = true ? "npx -y @kombai/cli@
|
|
1057
|
+
CLI_NPX_RUN = true ? "npx -y @kombai/cli@alpha" : `npx -y ${KOMBAI_CLI_PACKAGE}`;
|
|
1058
1058
|
CLI_RUN = runLineOf(fileURLToPath(import.meta.url), CLI_VERSION, CLI_NPX_RUN);
|
|
1059
|
-
CLI_PACKAGE = true ? "@kombai/cli@
|
|
1059
|
+
CLI_PACKAGE = true ? "@kombai/cli@alpha" : KOMBAI_CLI_PACKAGE;
|
|
1060
1060
|
CLI_OUTDATED_NEXT = "A newer Kombai CLI is out; update the Kombai plugin.";
|
|
1061
1061
|
}
|
|
1062
1062
|
});
|
|
@@ -1742,7 +1742,7 @@ function checkingCommandOf(argv2) {
|
|
|
1742
1742
|
const words = tokens.slice(0, i);
|
|
1743
1743
|
if (words[0] === "update" && words.length === 1) return "update";
|
|
1744
1744
|
if (words[0] === "mcp" && words[1] === "install") return "mcp install";
|
|
1745
|
-
if (words[0] === "skill"
|
|
1745
|
+
if (words[0] === "skill") return "skill";
|
|
1746
1746
|
return null;
|
|
1747
1747
|
}
|
|
1748
1748
|
function report(fields = {}) {
|
|
@@ -1764,6 +1764,7 @@ function report(fields = {}) {
|
|
|
1764
1764
|
current: null,
|
|
1765
1765
|
entry: null,
|
|
1766
1766
|
error: null,
|
|
1767
|
+
withdrawn: null,
|
|
1767
1768
|
startedAs: fields.install ?? "other",
|
|
1768
1769
|
...fields
|
|
1769
1770
|
};
|
|
@@ -1996,6 +1997,10 @@ async function prerun(argv2, deps = realDeps()) {
|
|
|
1996
1997
|
}
|
|
1997
1998
|
}
|
|
1998
1999
|
}
|
|
2000
|
+
const recorded = place.kind === "managed" ? result.bootstrap : null;
|
|
2001
|
+
if (checking && recorded !== null && blocked.includes(deps.version) && isManagedVersion(recorded) && channelOfVersion(recorded) === channel && !blocked.includes(recorded)) {
|
|
2002
|
+
result.withdrawn = { version: deps.version, bootstrap: recorded };
|
|
2003
|
+
}
|
|
1999
2004
|
return { handedOff: false, overrides: { selfUpdate: result, ...entryPackage(result.entry ?? null, channel) } };
|
|
2000
2005
|
}
|
|
2001
2006
|
async function entryVersion(paths, result, blocked) {
|
|
@@ -10483,12 +10488,15 @@ var init_credits = __esm({
|
|
|
10483
10488
|
});
|
|
10484
10489
|
|
|
10485
10490
|
// src/lib/dskit.js
|
|
10486
|
-
async function
|
|
10491
|
+
async function loadDsKit() {
|
|
10487
10492
|
const url2 = new URL(BUNDLED ? "./ds-kit.mjs" : "./dskit-entry.js", import.meta.url).href;
|
|
10488
|
-
|
|
10493
|
+
return (
|
|
10489
10494
|
/** @type {typeof import('./dskit-entry.js')} */
|
|
10490
10495
|
await import(url2)
|
|
10491
10496
|
);
|
|
10497
|
+
}
|
|
10498
|
+
async function lintDesignSystem(markdown) {
|
|
10499
|
+
const { lintSource, parse: parse3 } = await loadDsKit();
|
|
10492
10500
|
const result = lintSource(markdown);
|
|
10493
10501
|
return {
|
|
10494
10502
|
...result,
|
|
@@ -10500,12 +10508,36 @@ async function lintDesignSystem(markdown) {
|
|
|
10500
10508
|
) }
|
|
10501
10509
|
};
|
|
10502
10510
|
}
|
|
10503
|
-
|
|
10511
|
+
function shortDescription(text) {
|
|
10512
|
+
const whole = text.trim();
|
|
10513
|
+
if (!whole) return null;
|
|
10514
|
+
const sentence2 = whole.match(/^.*?[.!?](?=\s|$)/s)?.[0];
|
|
10515
|
+
const first = sentence2 && sentence2.length >= SENTENCE_MIN ? sentence2 : whole;
|
|
10516
|
+
if (first.length <= DESCRIPTION_MAX) return first;
|
|
10517
|
+
const cut = first.slice(0, DESCRIPTION_MAX);
|
|
10518
|
+
return `${cut.slice(0, cut.lastIndexOf(" ") > 0 ? cut.lastIndexOf(" ") : DESCRIPTION_MAX).replace(/[\s,;:–—-]+$/, "")}\u2026`;
|
|
10519
|
+
}
|
|
10520
|
+
async function designSystemFacts(markdown, slug) {
|
|
10521
|
+
const { parse: parse3, toPreview } = await loadDsKit();
|
|
10522
|
+
const system = parse3(markdown, slug);
|
|
10523
|
+
return {
|
|
10524
|
+
preview: toPreview(system).preview,
|
|
10525
|
+
description: shortDescription(system.body?.description ?? ""),
|
|
10526
|
+
counts: {
|
|
10527
|
+
colors: Object.keys(system.color?.palette ?? {}).length,
|
|
10528
|
+
text_styles: Object.keys(system.typography?.textStyle ?? {}).length,
|
|
10529
|
+
components: Object.keys(system.components ?? {}).length
|
|
10530
|
+
}
|
|
10531
|
+
};
|
|
10532
|
+
}
|
|
10533
|
+
var BUNDLED, DESCRIPTION_MAX, SENTENCE_MIN;
|
|
10504
10534
|
var init_dskit = __esm({
|
|
10505
10535
|
"src/lib/dskit.js"() {
|
|
10506
10536
|
"use strict";
|
|
10507
10537
|
init_define_KOMBAI_TELEMETRY();
|
|
10508
10538
|
BUNDLED = true;
|
|
10539
|
+
DESCRIPTION_MAX = 280;
|
|
10540
|
+
SENTENCE_MIN = 40;
|
|
10509
10541
|
}
|
|
10510
10542
|
});
|
|
10511
10543
|
|
|
@@ -10666,6 +10698,7 @@ function dsPaths(home, env, ownerKey, slug) {
|
|
|
10666
10698
|
file: path19.join(dir, `${slug}.ds`),
|
|
10667
10699
|
baseCopy: path19.join(dir, ".base", `${slug}.ds`),
|
|
10668
10700
|
baseJson: path19.join(dir, ".base", `${slug}.json`),
|
|
10701
|
+
previousCopy: path19.join(dir, ".base", `${slug}.previous.ds`),
|
|
10669
10702
|
remote: path19.join(dir, ".remote"),
|
|
10670
10703
|
orig: path19.join(dir, ".txn", "orig"),
|
|
10671
10704
|
lock: path19.join(dir, `.${slug}.lock`)
|
|
@@ -10674,6 +10707,28 @@ function dsPaths(home, env, ownerKey, slug) {
|
|
|
10674
10707
|
function publicDir(home, env) {
|
|
10675
10708
|
return path19.join(home, env, "design-systems", "public");
|
|
10676
10709
|
}
|
|
10710
|
+
function pageUrl(web, kind, id) {
|
|
10711
|
+
return `${web}${kind === "mine" ? `/ds/${encodeURIComponent(id)}` : `/ds?preset=${encodeURIComponent(id)}`}`;
|
|
10712
|
+
}
|
|
10713
|
+
function dsPage(ctx, web, kind, id, shared = false) {
|
|
10714
|
+
return linkField(ctx, shared ? null : pageUrl(web, kind, id));
|
|
10715
|
+
}
|
|
10716
|
+
async function ownPageUrl(api, web, slug, ownerKey, owners) {
|
|
10717
|
+
const held = owners ?? (await listAll(api)).filter((i) => i.slug === slug).map((i) => i.ownerKey);
|
|
10718
|
+
return held.length === 1 && held[0] === ownerKey ? pageUrl(web, "mine", slug) : null;
|
|
10719
|
+
}
|
|
10720
|
+
async function ownPage(ctx, session, slug, ownerKey, owners) {
|
|
10721
|
+
if (ctx.codexDesktop) return {};
|
|
10722
|
+
const url2 = await ownPageUrl(session.api, session.hosts.web, slug, ownerKey, owners).catch((error2) => {
|
|
10723
|
+
if (!(error2 instanceof CliError)) ctx.telemetry.capture(error2, "ds page link");
|
|
10724
|
+
ctx.warnings.add({
|
|
10725
|
+
code: error2 instanceof CliError ? error2.code : "CLI_INTERNAL",
|
|
10726
|
+
message: `No page link for ${slug}: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
10727
|
+
});
|
|
10728
|
+
return null;
|
|
10729
|
+
});
|
|
10730
|
+
return { url: url2 };
|
|
10731
|
+
}
|
|
10677
10732
|
async function pullPublic(ctx, id) {
|
|
10678
10733
|
if (!isSafePresetId(id)) {
|
|
10679
10734
|
throw badValues("ds pull", [`"${id}" is not a public design system id (letters, digits, _ and -)`]);
|
|
@@ -10694,7 +10749,7 @@ async function pullPublic(ctx, id) {
|
|
|
10694
10749
|
const file2 = path19.join(publicDir(ctx.home, session.env), `${id}.ds`);
|
|
10695
10750
|
await ensureDir(path19.dirname(file2));
|
|
10696
10751
|
await writeFileAtomic(file2, doc, { mode: 420 });
|
|
10697
|
-
return { id, name: found.name, public: true, file: file2 };
|
|
10752
|
+
return { id, name: found.name, public: true, file: file2, ...dsPage(ctx, session.hosts.web, "public", id) };
|
|
10698
10753
|
}
|
|
10699
10754
|
async function forgetDesignSystem(paths, slug, ownerKey) {
|
|
10700
10755
|
if (!await fs19.stat(paths.dir).catch(() => null)) return null;
|
|
@@ -10707,13 +10762,19 @@ async function forgetDesignSystem(paths, slug, ownerKey) {
|
|
|
10707
10762
|
const edited = observed !== null && observed !== base?.hash;
|
|
10708
10763
|
await dropRemotes(paths, slug);
|
|
10709
10764
|
if (edited) {
|
|
10710
|
-
|
|
10765
|
+
const { previous: _gone, ...kept } = (
|
|
10766
|
+
/** @type {Partial<DsBase>} */
|
|
10767
|
+
base ?? {}
|
|
10768
|
+
);
|
|
10769
|
+
await writeJsonAtomic(paths.baseJson, { slug, ownerKey, hash: "", ...kept, version: 0 }, { mode: 420 });
|
|
10770
|
+
await fs19.rm(paths.previousCopy, { force: true });
|
|
10711
10771
|
return paths.file;
|
|
10712
10772
|
}
|
|
10713
10773
|
await Promise.all([
|
|
10714
10774
|
fs19.rm(paths.file, { force: true }),
|
|
10715
10775
|
fs19.rm(paths.baseCopy, { force: true }),
|
|
10716
|
-
fs19.rm(paths.baseJson, { force: true })
|
|
10776
|
+
fs19.rm(paths.baseJson, { force: true }),
|
|
10777
|
+
fs19.rm(paths.previousCopy, { force: true })
|
|
10717
10778
|
]);
|
|
10718
10779
|
return null;
|
|
10719
10780
|
});
|
|
@@ -10784,7 +10845,11 @@ function normalized(text) {
|
|
|
10784
10845
|
async function deletedSinceRead(ctx, env, slug, file2, pulled, owner, error2) {
|
|
10785
10846
|
if (pulled) {
|
|
10786
10847
|
const paths = dsPaths(ctx.home, env, pulled.ownerKey, slug);
|
|
10787
|
-
|
|
10848
|
+
const { previous: _gone, ...kept } = pulled;
|
|
10849
|
+
await withLock(paths.lock, async () => {
|
|
10850
|
+
await writeJsonAtomic(paths.baseJson, { ...kept, version: 0 }, { mode: 420 });
|
|
10851
|
+
await fs19.rm(paths.previousCopy, { force: true });
|
|
10852
|
+
});
|
|
10788
10853
|
}
|
|
10789
10854
|
const ownerKey = pulled?.ownerKey ?? owner.ownerKey ?? (owner.orgId ? `org:${owner.orgId}` : void 0);
|
|
10790
10855
|
error2.message = `${slug} was deleted${pulled ? ` from ${pulled.ownerKey} since you pulled it` : ""}. Push it again to save it anew, or leave it deleted.`;
|
|
@@ -10792,10 +10857,33 @@ async function deletedSinceRead(ctx, env, slug, file2, pulled, owner, error2) {
|
|
|
10792
10857
|
error2.details = { ...error2.details, slug, ...ownerKey ? { ownerKey } : {} };
|
|
10793
10858
|
return error2;
|
|
10794
10859
|
}
|
|
10795
|
-
async function writeBase(paths, base, bytes) {
|
|
10860
|
+
async function writeBase(paths, base, bytes, previous = null) {
|
|
10861
|
+
if (previous && base.previous) await writeFileAtomic(paths.previousCopy, previous, { mode: 420 });
|
|
10862
|
+
else await fs19.rm(paths.previousCopy, { force: true });
|
|
10796
10863
|
await writeFileAtomic(paths.baseCopy, bytes, { mode: 420 });
|
|
10797
10864
|
await writeJsonAtomic(paths.baseJson, base, { mode: 420 });
|
|
10798
10865
|
}
|
|
10866
|
+
async function previousPushed(home, env, ownerKey, slug, version2, hash2) {
|
|
10867
|
+
const paths = dsPaths(home, env, ownerKey, slug);
|
|
10868
|
+
if (await readJson(paths.baseJson) === void 0) return null;
|
|
10869
|
+
return withLock(paths.lock, async () => {
|
|
10870
|
+
const base = (
|
|
10871
|
+
/** @type {DsBase | undefined} */
|
|
10872
|
+
await readJson(paths.baseJson)
|
|
10873
|
+
);
|
|
10874
|
+
if (!base || base.version !== version2 || base.hash !== hash2 || base.previous !== version2 - 1) return null;
|
|
10875
|
+
const markdown = await readIfThere(paths.previousCopy);
|
|
10876
|
+
return markdown === null ? null : { version: base.previous, markdown: markdown.toString("utf8") };
|
|
10877
|
+
});
|
|
10878
|
+
}
|
|
10879
|
+
async function readIfThere(file2) {
|
|
10880
|
+
try {
|
|
10881
|
+
return await fs19.readFile(file2);
|
|
10882
|
+
} catch (error2) {
|
|
10883
|
+
if (isErrno(error2, "ENOENT")) return null;
|
|
10884
|
+
throw error2;
|
|
10885
|
+
}
|
|
10886
|
+
}
|
|
10799
10887
|
async function latestRemote(paths, slug) {
|
|
10800
10888
|
const names = await fs19.readdir(paths.remote).catch(() => (
|
|
10801
10889
|
/** @type {string[]} */
|
|
@@ -10900,6 +10988,7 @@ var init_ds = __esm({
|
|
|
10900
10988
|
init_define_KOMBAI_TELEMETRY();
|
|
10901
10989
|
init_api();
|
|
10902
10990
|
init_canvasdir();
|
|
10991
|
+
init_codex_app();
|
|
10903
10992
|
init_contract();
|
|
10904
10993
|
init_dskit();
|
|
10905
10994
|
init_fsx();
|
|
@@ -10912,7 +11001,7 @@ var init_ds = __esm({
|
|
|
10912
11001
|
UTF8 = new TextDecoder("utf-8", { fatal: true });
|
|
10913
11002
|
dsList = {
|
|
10914
11003
|
name: "ds list",
|
|
10915
|
-
summary: "The user's design systems, across their organizations and their own, and in publicDesignSystems Kombai's public ones (read-only; null, with a warning, when they cannot be read). file is null when not pulled here.",
|
|
11004
|
+
summary: "The user's design systems, across their organizations and their own, and in publicDesignSystems Kombai's public ones (read-only; null, with a warning, when they cannot be read). file is null when not pulled here; url is each one's page on the canvas site (null for a slug in several scopes, whose page may show the other one; none in the Codex app).",
|
|
10916
11005
|
async run(ctx) {
|
|
10917
11006
|
const session = await openSession(ctx);
|
|
10918
11007
|
const [items, listed] = await Promise.all([
|
|
@@ -10924,6 +11013,8 @@ var init_ds = __esm({
|
|
|
10924
11013
|
})
|
|
10925
11014
|
]);
|
|
10926
11015
|
const publicFolder = publicDir(ctx.home, session.env);
|
|
11016
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
11017
|
+
for (const item of items) scopes.set(item.slug, (scopes.get(item.slug) ?? 0) + 1);
|
|
10927
11018
|
const publicDesignSystems = listed && await Promise.all(
|
|
10928
11019
|
listed.map(async (item) => {
|
|
10929
11020
|
const file2 = path19.join(publicFolder, `${item.id}.ds`);
|
|
@@ -10931,7 +11022,8 @@ var init_ds = __esm({
|
|
|
10931
11022
|
id: item.id,
|
|
10932
11023
|
name: item.name,
|
|
10933
11024
|
description: item.description,
|
|
10934
|
-
file: await exists(file2) ? file2 : null
|
|
11025
|
+
file: await exists(file2) ? file2 : null,
|
|
11026
|
+
...dsPage(ctx, session.hosts.web, "public", item.id)
|
|
10935
11027
|
};
|
|
10936
11028
|
})
|
|
10937
11029
|
);
|
|
@@ -10945,7 +11037,8 @@ var init_ds = __esm({
|
|
|
10945
11037
|
ownerKey: item.ownerKey,
|
|
10946
11038
|
version: item.version,
|
|
10947
11039
|
modified: item.modified,
|
|
10948
|
-
file: await hashFile(file2) === null ? null : file2
|
|
11040
|
+
file: await hashFile(file2) === null ? null : file2,
|
|
11041
|
+
...dsPage(ctx, session.hosts.web, "mine", item.slug, (scopes.get(item.slug) ?? 0) > 1)
|
|
10949
11042
|
};
|
|
10950
11043
|
})
|
|
10951
11044
|
),
|
|
@@ -10955,7 +11048,7 @@ var init_ds = __esm({
|
|
|
10955
11048
|
};
|
|
10956
11049
|
dsPull = {
|
|
10957
11050
|
name: "ds pull",
|
|
10958
|
-
summary: "Get a design system as a .ds file. --owner picks one when the slug is in several scopes. Refused (exit 2) over an edit that was not pushed, unless --discard. --public gets one of Kombai's public design systems by its id (ds list's publicDesignSystems): read-only, written over the last copy.",
|
|
11051
|
+
summary: "Get a design system as a .ds file, and its page on the canvas site as url (null when the slug is in several scopes; none in the Codex app). --owner picks one when the slug is in several scopes. Refused (exit 2) over an edit that was not pushed, unless --discard. --public gets one of Kombai's public design systems by its id (ds list's publicDesignSystems): read-only, written over the last copy.",
|
|
10959
11052
|
args: [{ name: "slug", required: true }],
|
|
10960
11053
|
flags: {
|
|
10961
11054
|
owner: { type: "string", placeholder: "<ownerKey>" },
|
|
@@ -10979,8 +11072,9 @@ var init_ds = __esm({
|
|
|
10979
11072
|
);
|
|
10980
11073
|
if (problems.length) throw badValues("ds pull", problems);
|
|
10981
11074
|
const session = await openSession(ctx);
|
|
11075
|
+
let owners;
|
|
10982
11076
|
if (!ownerKey) {
|
|
10983
|
-
|
|
11077
|
+
owners = (await listAll(session.api)).filter((i) => i.slug === slug).map((i) => i.ownerKey);
|
|
10984
11078
|
if (owners.length > 1) {
|
|
10985
11079
|
throw new CliError("CLI_OWNER_REQUIRED", `${slug} exists in several scopes; say which with --owner.`, {
|
|
10986
11080
|
next: `kombai ds pull ${slug} --owner <ownerKey>`,
|
|
@@ -11013,12 +11107,19 @@ var init_ds = __esm({
|
|
|
11013
11107
|
await replaceWorking(paths, observed, bytes, [base?.hash]);
|
|
11014
11108
|
await writeBase(paths, { slug, ownerKey: read2.ownerKey, version: read2.version, hash: sha256(bytes) }, bytes);
|
|
11015
11109
|
});
|
|
11016
|
-
return {
|
|
11110
|
+
return {
|
|
11111
|
+
slug,
|
|
11112
|
+
name: read2.name,
|
|
11113
|
+
ownerKey: read2.ownerKey,
|
|
11114
|
+
version: read2.version,
|
|
11115
|
+
file: paths.file,
|
|
11116
|
+
...await ownPage(ctx, session, slug, read2.ownerKey, owners)
|
|
11117
|
+
};
|
|
11017
11118
|
}
|
|
11018
11119
|
};
|
|
11019
11120
|
dsPush = {
|
|
11020
11121
|
name: "ds push",
|
|
11021
|
-
summary: "Validate a .ds file with ds-kit and save it. A pulled file goes back to the owner it came from; a new one takes its slug from its name and its owner from --org, then config org. --merged pushes over the version a conflict saved; --owner says whose, as the conflict's next does.",
|
|
11122
|
+
summary: "Validate a .ds file with ds-kit and save it, and print its page on the canvas site as url (null when the slug is in several scopes; none in the Codex app). A pulled file goes back to the owner it came from; a new one takes its slug from its name and its owner from --org, then config org. --merged pushes over the version a conflict saved; --owner says whose, as the conflict's next does.",
|
|
11022
11123
|
args: [{ name: "file", required: true }],
|
|
11023
11124
|
flags: {
|
|
11024
11125
|
org: { type: "string", placeholder: "<id>", check: orgIdProblem },
|
|
@@ -11100,7 +11201,13 @@ var init_ds = __esm({
|
|
|
11100
11201
|
const paths2 = dsPaths(ctx.home, session.env, pulled.ownerKey, slug);
|
|
11101
11202
|
await withLock(paths2.lock, () => replaceWorking(paths2, sha256(bytes), sent, []));
|
|
11102
11203
|
}
|
|
11103
|
-
return {
|
|
11204
|
+
return {
|
|
11205
|
+
slug,
|
|
11206
|
+
ownerKey: pulled.ownerKey,
|
|
11207
|
+
version: pulled.version,
|
|
11208
|
+
status: "unchanged",
|
|
11209
|
+
...await ownPage(ctx, session, slug, pulled.ownerKey)
|
|
11210
|
+
};
|
|
11104
11211
|
}
|
|
11105
11212
|
owner = scope === "user" ? { ownerKey: pulled.ownerKey } : { orgId: id };
|
|
11106
11213
|
} else {
|
|
@@ -11163,7 +11270,21 @@ var init_ds = __esm({
|
|
|
11163
11270
|
} else if (sha256(bytes) !== hash2) {
|
|
11164
11271
|
await replaceWorking(paths, sha256(bytes), sent, []);
|
|
11165
11272
|
}
|
|
11166
|
-
|
|
11273
|
+
const before = (
|
|
11274
|
+
/** @type {DsBase | undefined} */
|
|
11275
|
+
await readJson(paths.baseJson)
|
|
11276
|
+
);
|
|
11277
|
+
const replaced = before?.version && before.ownerKey === out.ownerKey && out.version === before.version + 1 ? await readIfThere(paths.baseCopy).catch((error2) => {
|
|
11278
|
+
ctx.telemetry.capture(error2, "ds push previous copy");
|
|
11279
|
+
return null;
|
|
11280
|
+
}) : null;
|
|
11281
|
+
const previous = replaced && before && sha256(replaced) === before.hash ? before.version : void 0;
|
|
11282
|
+
await writeBase(
|
|
11283
|
+
paths,
|
|
11284
|
+
{ slug, ownerKey: out.ownerKey, version: out.version, hash: hash2, ...previous ? { previous } : {} },
|
|
11285
|
+
sent,
|
|
11286
|
+
previous ? replaced : null
|
|
11287
|
+
);
|
|
11167
11288
|
});
|
|
11168
11289
|
if (flags.merged) await dropRemotes(paths, slug);
|
|
11169
11290
|
return {
|
|
@@ -11171,7 +11292,8 @@ var init_ds = __esm({
|
|
|
11171
11292
|
ownerKey: out.ownerKey,
|
|
11172
11293
|
version: out.version,
|
|
11173
11294
|
status: res.status === 201 ? "created" : res.status === 304 ? "unchanged" : "updated",
|
|
11174
|
-
file: paths.file
|
|
11295
|
+
file: paths.file,
|
|
11296
|
+
...await ownPage(ctx, session, slug, out.ownerKey)
|
|
11175
11297
|
};
|
|
11176
11298
|
}
|
|
11177
11299
|
};
|
|
@@ -33801,7 +33923,7 @@ function designBriefsOf(envelope) {
|
|
|
33801
33923
|
function explainTasteError(ctx, error2, web) {
|
|
33802
33924
|
return explainRunError(ctx, error2, web, { noCredits: "TASTE_NO_CREDITS", outdated: "TASTE_CLI_OUTDATED" });
|
|
33803
33925
|
}
|
|
33804
|
-
var BRIEF_MAX_CHARS, DEFAULT_TIMEOUT_S2, WORKER_WRAPPER, DEFERRED_VIDEO_INSTRUCTION, DEFERRED_VIDEO_FOR_CLI, IMAGE_EXTENSIONS, RUN_ID, TASTE_CARD_TOOL, tasteStart, tasteWait, tasteLink;
|
|
33926
|
+
var BRIEF_MAX_CHARS, DEFAULT_TIMEOUT_S2, WORKER_WRAPPER, DEFERRED_VIDEO_INSTRUCTION, DEFERRED_VIDEO_FOR_CLI, IMAGE_EXTENSIONS, RUN_ID, TASTE_CARD_TOOL, TASTE_LINK_NEXT, tasteStart, tasteWait, tasteLink;
|
|
33805
33927
|
var init_taste = __esm({
|
|
33806
33928
|
"src/commands/taste.js"() {
|
|
33807
33929
|
"use strict";
|
|
@@ -33822,6 +33944,7 @@ var init_taste = __esm({
|
|
|
33822
33944
|
IMAGE_EXTENSIONS = { "image/png": "png", "image/jpeg": "jpg", "image/webp": "webp", "image/gif": "gif" };
|
|
33823
33945
|
RUN_ID = /^tr_[0-9a-f]{32}$/;
|
|
33824
33946
|
TASTE_CARD_TOOL = "taste_card";
|
|
33947
|
+
TASTE_LINK_NEXT = "Now, before you read directions.md, tell the user the taste run is done and give them this url on its own line: it shows the taste Kombai settled on, for them to review while you build. Do not hold it for your final message. Then follow directions.md.";
|
|
33825
33948
|
tasteStart = {
|
|
33826
33949
|
name: "taste start",
|
|
33827
33950
|
summary: "Start a taste run: Kombai's design directions for a brief you wrote after reading the repo. Uses credits. --cards says this client has a taste_card tool, so `taste wait` answers with card (and then no page link `url`); add it only where that tool is among your tools (the Codex app lists it only in ALL_TOOLS). Kombai makes AI images where a design needs art rather than a photo, each using credits; --no-generate keeps the run to stock photos and videos, for a user who asked for no AI-generated images.",
|
|
@@ -33964,6 +34087,7 @@ var init_taste = __esm({
|
|
|
33964
34087
|
ctx.telemetry.capture(error2, "taste wait");
|
|
33965
34088
|
}
|
|
33966
34089
|
const wantsCard = start?.cards === void 0 || start.cards === true;
|
|
34090
|
+
const link = hasBriefs && !wantsCard ? linkField(ctx, `${session.hosts.web}/t/${run2}`) : {};
|
|
33967
34091
|
return {
|
|
33968
34092
|
run: run2,
|
|
33969
34093
|
status: "done",
|
|
@@ -33973,7 +34097,10 @@ var init_taste = __esm({
|
|
|
33973
34097
|
// The client draws the card where it has one; the plain page link (never a ticket: taste link makes that
|
|
33974
34098
|
// one) is only for a client that cannot, so the answer never carries both.
|
|
33975
34099
|
...hasBriefs && wantsCard ? { card: { tool: TASTE_CARD_TOOL, arguments: { run: run2 } } } : {},
|
|
33976
|
-
...
|
|
34100
|
+
...link,
|
|
34101
|
+
// The skill says to pass the link on (`kombai skill brief`), but that was read before the brief was written;
|
|
34102
|
+
// next says it where the link is, so the agent does not go straight to directions.md.
|
|
34103
|
+
...link.url ? { next: TASTE_LINK_NEXT } : {}
|
|
33977
34104
|
};
|
|
33978
34105
|
}
|
|
33979
34106
|
const code = state.error?.code ?? "TASTE_FAILED";
|
|
@@ -34369,9 +34496,12 @@ var init_client_gate = __esm({
|
|
|
34369
34496
|
CODEX_CLIENT_NAME = "codex-mcp-client";
|
|
34370
34497
|
CLAUDE_CODE_CLIENT_NAME = "claude-code";
|
|
34371
34498
|
Cards = Object.freeze({
|
|
34372
|
-
/** The taste card and the plans card, and the CLI's own sign-in
|
|
34499
|
+
/** The taste card and the plans card, and the CLI's own sign-in, starters, access and design system cards. */
|
|
34373
34500
|
All: "all",
|
|
34374
|
-
/**
|
|
34501
|
+
/**
|
|
34502
|
+
* The cards that call no tool of their own, which Claude desktop refuses (cards.js specsIn): the taste card and the
|
|
34503
|
+
* design system card. Named for the gateway's ClientCards.Taste, which is the taste card alone.
|
|
34504
|
+
*/
|
|
34375
34505
|
Taste: "taste",
|
|
34376
34506
|
None: "none"
|
|
34377
34507
|
});
|
|
@@ -34491,7 +34621,7 @@ function toolDescriptors(resourceUri) {
|
|
|
34491
34621
|
{
|
|
34492
34622
|
name: CANVAS_APP_TOOL,
|
|
34493
34623
|
title: "Kombai",
|
|
34494
|
-
description: "Open a Kombai canvas in this conversation, beside the chat: the way to show one here, in place of any browser or link. Call it right after kombai canvas create, before any design. Pass the canvas id (cnv_\u2026) or its link; node is a design id to focus. With no canvas it shows every canvas the person can open when signed in, the guest home to a guest or to someone who never signed in, and asks someone who signed in before to sign in there. Open a canvas once, again only when the person asks to see it: every canvas_app call opens another tab. The canvas is the live Kombai page, so it shows every change as it lands. Changes go through the work-with-kombai skill's commands, never through this tool. Put no canvas or design link in your replies: name designs by their labels. A person who wants a link copies it from the view (the canvas's Share, or a design's Copy link); never open one yourself.",
|
|
34624
|
+
description: "Open a Kombai canvas in this conversation, beside the chat: the way to show one here, in place of any browser or link. Call it right after kombai canvas create, before any design. Pass the canvas id (cnv_\u2026) or its link; node is a design id to focus. With no canvas it shows every canvas the person can open when signed in, the guest home to a guest or to someone who never signed in, and asks someone who signed in before to sign in there. Open a canvas once, again only when the person asks to see it: every canvas_app call opens another tab. The canvas is the live Kombai page, so it shows every change as it lands. Changes go through the work-with-kombai skill's commands, never through this tool. Put no canvas or design link in your replies: name designs by their labels. A person who wants a link copies it from the view (the canvas's Share, or a design's Copy link); never open one yourself. To show a design system instead of a canvas, pass designSystem (its slug, from `kombai ds list` or `kombai ds push`) or publicDesignSystem (a public one's id, from `kombai ds list`). Do it once per design system per reply, after that reply's last `kombai ds push` that created or updated it (after its design_system_card), and when the user asks to see one: every call opens another tab.",
|
|
34495
34625
|
inputSchema: {
|
|
34496
34626
|
type: "object",
|
|
34497
34627
|
properties: {
|
|
@@ -34499,7 +34629,15 @@ function toolDescriptors(resourceUri) {
|
|
|
34499
34629
|
type: "string",
|
|
34500
34630
|
description: "A canvas id (cnv_\u2026), a canvas link (/c/<id>) or a design link (/n/<id>/<node>). Leave it out to show every canvas."
|
|
34501
34631
|
},
|
|
34502
|
-
node: { type: "string", description: "A design id on that canvas to focus." }
|
|
34632
|
+
node: { type: "string", description: "A design id on that canvas to focus." },
|
|
34633
|
+
designSystem: {
|
|
34634
|
+
type: "string",
|
|
34635
|
+
description: "One of the user's design systems to show, by its slug. Give no canvas with it."
|
|
34636
|
+
},
|
|
34637
|
+
publicDesignSystem: {
|
|
34638
|
+
type: "string",
|
|
34639
|
+
description: "One of Kombai's public design systems to show, by its id. Give no canvas with it."
|
|
34640
|
+
}
|
|
34503
34641
|
},
|
|
34504
34642
|
additionalProperties: false
|
|
34505
34643
|
},
|
|
@@ -34582,7 +34720,40 @@ async function readCanvas(session, canvasId) {
|
|
|
34582
34720
|
}
|
|
34583
34721
|
return { projectId: body.projectId, name };
|
|
34584
34722
|
}
|
|
34723
|
+
function designSystemFromArgs(args) {
|
|
34724
|
+
const own = given(args.designSystem);
|
|
34725
|
+
const pub = given(args.publicDesignSystem);
|
|
34726
|
+
if (!own && !pub) return null;
|
|
34727
|
+
if (own && pub) throw badArgument("Give designSystem or publicDesignSystem, not both.");
|
|
34728
|
+
if (given(args.canvas) || given(args.node)) {
|
|
34729
|
+
throw badArgument("A design system is shown on its own: leave canvas and node out.");
|
|
34730
|
+
}
|
|
34731
|
+
if (own) {
|
|
34732
|
+
if (typeof args.designSystem !== "string" || !DESIGN_ID.slug.test(args.designSystem)) {
|
|
34733
|
+
throw badArgument("designSystem must be a design system slug, as `kombai ds list` prints it.");
|
|
34734
|
+
}
|
|
34735
|
+
return { designSystem: args.designSystem };
|
|
34736
|
+
}
|
|
34737
|
+
const id = args.publicDesignSystem;
|
|
34738
|
+
if (typeof id !== "string" || id.length > PUBLIC_DESIGN_SYSTEM_ID_MAX || !isSafePresetId(id)) {
|
|
34739
|
+
throw badArgument("publicDesignSystem must be a public design system's id, as `kombai ds list` prints it.");
|
|
34740
|
+
}
|
|
34741
|
+
return { publicDesignSystem: id };
|
|
34742
|
+
}
|
|
34585
34743
|
async function callCanvasApp(ctx, args) {
|
|
34744
|
+
const shown = designSystemFromArgs(args);
|
|
34745
|
+
if (shown) {
|
|
34746
|
+
const id = "designSystem" in shown ? shown.designSystem : shown.publicDesignSystem;
|
|
34747
|
+
return {
|
|
34748
|
+
structuredContent: shown,
|
|
34749
|
+
content: [
|
|
34750
|
+
{
|
|
34751
|
+
type: "text",
|
|
34752
|
+
text: `The ${id} design system is open beside this chat. Put no link to it in your reply.`
|
|
34753
|
+
}
|
|
34754
|
+
]
|
|
34755
|
+
};
|
|
34756
|
+
}
|
|
34586
34757
|
const { hosts } = await currentEnv(ctx);
|
|
34587
34758
|
const ref = refFromArgs(args, hosts.web);
|
|
34588
34759
|
if (!ref) {
|
|
@@ -34846,7 +35017,7 @@ function answer(structuredContent, viewOnly = []) {
|
|
|
34846
35017
|
), text: JSON.stringify(text) }]
|
|
34847
35018
|
};
|
|
34848
35019
|
}
|
|
34849
|
-
var CANVAS_APP_TOOL, SESSION_TOOL, RESOURCE_URI_BASE, versionedUri, SIGN_IN_MAX_WAIT_S, INSTRUCTIONS, CODEX_ACCESS, CODEX_INSTRUCTIONS, read, badArgument, given;
|
|
35020
|
+
var CANVAS_APP_TOOL, SESSION_TOOL, RESOURCE_URI_BASE, versionedUri, SIGN_IN_MAX_WAIT_S, INSTRUCTIONS, CODEX_ACCESS, CODEX_INSTRUCTIONS, read, badArgument, given, PUBLIC_DESIGN_SYSTEM_ID_MAX;
|
|
34850
35021
|
var init_tools = __esm({
|
|
34851
35022
|
"src/mcp/tools.js"() {
|
|
34852
35023
|
"use strict";
|
|
@@ -34856,6 +35027,7 @@ var init_tools = __esm({
|
|
|
34856
35027
|
init_api();
|
|
34857
35028
|
init_contract();
|
|
34858
35029
|
init_output();
|
|
35030
|
+
init_presets();
|
|
34859
35031
|
init_project();
|
|
34860
35032
|
init_session();
|
|
34861
35033
|
init_store();
|
|
@@ -34866,12 +35038,13 @@ var init_tools = __esm({
|
|
|
34866
35038
|
RESOURCE_URI_BASE = "ui://kombai/cli-canvas-app";
|
|
34867
35039
|
versionedUri = (base, version2) => `${base}?v=${encodeURIComponent(version2)}`;
|
|
34868
35040
|
SIGN_IN_MAX_WAIT_S = 20;
|
|
34869
|
-
INSTRUCTIONS = `Designs and design systems: follow \`${CLI_RUN} skill\`. Where taste_card is among your tools, even listed by name only, add --cards to every \`kombai taste start\`, and call taste_card when \`kombai taste wait\` answers with card.
|
|
35041
|
+
INSTRUCTIONS = `Designs and design systems: follow \`${CLI_RUN} skill\`. Where taste_card is among your tools, even listed by name only, add --cards to every \`kombai taste start\`, and call taste_card when \`kombai taste wait\` answers with card. Where design_system_card is among your tools, call it after each \`kombai ds push\` that created or updated one, and again, with the same slug and ownerKey, when the user asks to open one again after its card's link expired. Designs go on a Kombai canvas, or where the user asks (taste runs either way); design systems are .ds files in the Kombai account and need no canvas. Questions about Kombai itself (account, credits, data, setup) are answered by \`${CLI_RUN} skill faq\`.`;
|
|
34870
35042
|
CODEX_ACCESS = "Kombai's commands need network access and write ~/.kombai (designs' files are there too) and npm's cache (`npm config get cache`, a local read to run first: not always ~/.npm), and every `kombai mcp install codex`, an upgrade included, writes the folder holding Codex's config.toml ($CODEX_HOME, else ~/.codex; for a symlinked config, its target's folder): get that before the first one, never trying it in the sandbox first. Use sandbox_permissions \"require_escalated\" where this chat can approve escalations; where it can't (a chat with no project picked), get it with request_permissions, whose grant can end with the reply: before the first Kombai command or design-file write of each reply, run `node -p \"'network_off='+(process.env.CODEX_SANDBOX_NETWORK_DISABLED||0)\"` on its own; if it prints network_off=1, call request_permissions first, and if network_off=0, the grant still holds, so do not ask. No output alone does not mean the network was off: poll a running session instead of rerunning it; a command that exits with no output is checked the same way and run again only if it prints network_off=1. Retry only a confirmed sandbox denial before any write was sent; for an unknown write outcome, inspect state first. If a later reply in the chat has to ask again (asking twice in one reply does not count), once that reply's Kombai work is done, call access_card with reason granted, once per chat: it shows the user how to stop the prompt on every message. If neither works, run nothing: call access_card with reason blocked, which shows the user how to allow it with a Continue button, and end your turn with one line. ";
|
|
34871
|
-
CODEX_INSTRUCTIONS = `Show Kombai canvases with canvas_app (find it in ALL_TOOLS): right after kombai canvas create, before any design, or on first use of a canvas not open beside the chat. It is the only way: no browser, no in-app browser, no link. Designs and design systems: follow \`${CLI_RUN} skill\`. ` + CODEX_ACCESS + `A user who wants a link copies it from the view: the canvas's Share, or a design's Copy link. Add --cards to every \`kombai taste start\`, and call taste_card when \`kombai taste wait\` answers with card.
|
|
35043
|
+
CODEX_INSTRUCTIONS = `Show Kombai canvases with canvas_app (find it in ALL_TOOLS): right after kombai canvas create, before any design, or on first use of a canvas not open beside the chat. It is the only way: no browser, no in-app browser, no link. Designs and design systems: follow \`${CLI_RUN} skill\`. ` + CODEX_ACCESS + `A user who wants a link copies it from the view: the canvas's Share, or a design's Copy link. Add --cards to every \`kombai taste start\`, and call taste_card when \`kombai taste wait\` answers with card. After a reply's last \`kombai ds push\` that created or updated a design system, call design_system_card with the slug and ownerKey it printed, then canvas_app with designSystem (its slug): each once per design system per reply. When the user asks to see one, call canvas_app with designSystem, or publicDesignSystem (a public one's id). The push prints no link here: put none in the reply. Designs go on a Kombai canvas, or where the user asks (taste runs either way); design systems are .ds files in the Kombai account and need no canvas. Call canvas_app once per canvas, only to show it (again only when the user asks): make changes with the commands. Questions about Kombai itself (account, credits, data, setup) are answered by \`${CLI_RUN} skill faq\`.`;
|
|
34872
35044
|
read = { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: false };
|
|
34873
35045
|
badArgument = (message) => new CliError("CLI_BAD_ARGUMENT", message);
|
|
34874
35046
|
given = (value) => value !== void 0 && value !== null && value !== "";
|
|
35047
|
+
PUBLIC_DESIGN_SYSTEM_ID_MAX = 128;
|
|
34875
35048
|
}
|
|
34876
35049
|
});
|
|
34877
35050
|
|
|
@@ -35134,6 +35307,7 @@ function createCards(ctx, options) {
|
|
|
35134
35307
|
if (spec === PLANS) return [plansTool(uriOf(spec)), checkoutTool()];
|
|
35135
35308
|
if (spec === STARTERS) return [startersTool(uriOf(spec))];
|
|
35136
35309
|
if (spec === ACCESS) return [accessTool(uriOf(spec))];
|
|
35310
|
+
if (spec === DESIGN_SYSTEM) return [designSystemTool(uriOf(spec))];
|
|
35137
35311
|
if (spec === SIGN_IN) return [signInTool(uriOf(spec)), chatSignInTool(), chatGuestTool()];
|
|
35138
35312
|
return [];
|
|
35139
35313
|
};
|
|
@@ -35189,6 +35363,9 @@ function createCards(ctx, options) {
|
|
|
35189
35363
|
if (name === CHECKOUT_TOOL && specs.includes(PLANS)) return inAppWords(await checkout(ctx, args, signInBuilt));
|
|
35190
35364
|
if (name === STARTERS_CARD_TOOL && specs.includes(STARTERS)) return showStarters(args);
|
|
35191
35365
|
if (name === ACCESS_CARD_TOOL && specs.includes(ACCESS)) return showAccess(ctx, args);
|
|
35366
|
+
if (name === DESIGN_SYSTEM_CARD_TOOL && specs.includes(DESIGN_SYSTEM)) {
|
|
35367
|
+
return showDesignSystem(ctx, args, set2 === Cards.All);
|
|
35368
|
+
}
|
|
35192
35369
|
if (name === SIGN_IN_CARD_TOOL && specs.includes(SIGN_IN)) {
|
|
35193
35370
|
return showSignIn(ctx, args, appBrowser()?.label ?? null);
|
|
35194
35371
|
}
|
|
@@ -35241,6 +35418,97 @@ function showAccess(ctx, args) {
|
|
|
35241
35418
|
]
|
|
35242
35419
|
};
|
|
35243
35420
|
}
|
|
35421
|
+
async function showDesignSystem(ctx, args, inView) {
|
|
35422
|
+
const { slug, ownerKey } = args;
|
|
35423
|
+
if (typeof slug !== "string" || !DESIGN_ID.slug.test(slug) || typeof ownerKey !== "string" || !DESIGN_ID.ownerKey.test(ownerKey)) {
|
|
35424
|
+
return failed("slug and ownerKey must be the ones `kombai ds push` printed.");
|
|
35425
|
+
}
|
|
35426
|
+
try {
|
|
35427
|
+
const session = await openSession(ctx);
|
|
35428
|
+
const [read2, url2] = await Promise.all([
|
|
35429
|
+
session.api.call({ method: "GET", path: `/design/design-systems/${slug}`, query: { ownerKey } }),
|
|
35430
|
+
inView ? null : ownPageUrl(session.api, session.hosts.web, slug, ownerKey).catch((error2) => {
|
|
35431
|
+
if (!(error2 instanceof CliError)) ctx.telemetry.capture(error2, "design system card link");
|
|
35432
|
+
return null;
|
|
35433
|
+
})
|
|
35434
|
+
]);
|
|
35435
|
+
const stored = read2.body ?? {};
|
|
35436
|
+
const name = typeof stored.name === "string" && stored.name.trim() ? stored.name : slug;
|
|
35437
|
+
const version2 = Number.isSafeInteger(stored.version) && Number(stored.version) > 0 ? Number(stored.version) : null;
|
|
35438
|
+
const modified = typeof stored.modified === "string" ? stored.modified : null;
|
|
35439
|
+
const factsOf = (markdown2) => designSystemFacts(markdown2, slug).catch((error2) => {
|
|
35440
|
+
ctx.telemetry.capture(error2, "design system card preview");
|
|
35441
|
+
return null;
|
|
35442
|
+
});
|
|
35443
|
+
const markdown = typeof stored.markdown === "string" ? stored.markdown : null;
|
|
35444
|
+
const [facts, before, opening] = await Promise.all([
|
|
35445
|
+
markdown === null ? null : factsOf(markdown),
|
|
35446
|
+
markdown === null || version2 === null ? null : previousPushed(
|
|
35447
|
+
ctx.home,
|
|
35448
|
+
session.env,
|
|
35449
|
+
ownerKey,
|
|
35450
|
+
slug,
|
|
35451
|
+
version2,
|
|
35452
|
+
sha256(new TextEncoder().encode(markdown))
|
|
35453
|
+
).catch((error2) => {
|
|
35454
|
+
ctx.telemetry.capture(error2, "design system card previous");
|
|
35455
|
+
return null;
|
|
35456
|
+
}),
|
|
35457
|
+
url2 === null ? null : designSystemsPageLink(ctx, session, url2)
|
|
35458
|
+
]);
|
|
35459
|
+
const previousFacts = before ? await factsOf(before.markdown) : null;
|
|
35460
|
+
return {
|
|
35461
|
+
structuredContent: {
|
|
35462
|
+
design_system: {
|
|
35463
|
+
name,
|
|
35464
|
+
version: version2,
|
|
35465
|
+
modified,
|
|
35466
|
+
preview: facts?.preview ?? null,
|
|
35467
|
+
description: facts?.description ?? null,
|
|
35468
|
+
counts: facts?.counts ?? null,
|
|
35469
|
+
previous: before && previousFacts ? { version: before.version, preview: previousFacts.preview } : null,
|
|
35470
|
+
open_link: opening?.link ?? null,
|
|
35471
|
+
open_link_expires_at: opening?.expiresAt ?? null,
|
|
35472
|
+
shown_in_view: inView
|
|
35473
|
+
}
|
|
35474
|
+
},
|
|
35475
|
+
content: [
|
|
35476
|
+
{
|
|
35477
|
+
type: "text",
|
|
35478
|
+
text: inView ? `Showing the ${name} design system in the chat. Then open it beside the chat with canvas_app (designSystem "${slug}"), once per design system this reply. Put no link to it in your reply.` : `Showing the ${name} design system in the chat${url2 ? ", with Open for its page" : ""}. Put no link to it in your reply.`
|
|
35479
|
+
}
|
|
35480
|
+
]
|
|
35481
|
+
};
|
|
35482
|
+
} catch (error2) {
|
|
35483
|
+
if (!(error2 instanceof CliError)) throw error2;
|
|
35484
|
+
if (error2.code === SIGNIN_REQUIRED) return refused(SIGNIN_REQUIRED, error2.message);
|
|
35485
|
+
return shownWords(`Kombai could not show this design system: ${error2.message}`);
|
|
35486
|
+
}
|
|
35487
|
+
}
|
|
35488
|
+
async function designSystemsPageLink(ctx, session, url2) {
|
|
35489
|
+
const plain = { link: url2, expiresAt: null };
|
|
35490
|
+
try {
|
|
35491
|
+
const res = await session.api.call({
|
|
35492
|
+
method: "POST",
|
|
35493
|
+
path: "/design/download-tickets",
|
|
35494
|
+
body: { designSystems: true },
|
|
35495
|
+
// A store from before these tickets answers a key caller 401 UNAUTHORIZED ("this route takes x-kombai-pass or
|
|
35496
|
+
// x-kombai-guest-pass"), before it reads the body: that says nothing about the key, so it must not cost it.
|
|
35497
|
+
keepKey: true,
|
|
35498
|
+
// A lost answer hands the plain page at once (a LostAnswer, a CliError): a second ticket is not worth the wait.
|
|
35499
|
+
retry: "once",
|
|
35500
|
+
// A slow or busy store (a hung call, a 503's Retry-After waits) must not hold the card: past this, a
|
|
35501
|
+
// CLI_TIMEOUT (a CliError) hands the plain link.
|
|
35502
|
+
deadline: session.api.deadline.within(DESIGN_SYSTEMS_TICKET_WAIT_MS)
|
|
35503
|
+
});
|
|
35504
|
+
const ticket = res.body?.ticket;
|
|
35505
|
+
const expiresAt = res.body?.expiresAt;
|
|
35506
|
+
return typeof ticket === "string" && READ_TICKET.test(ticket) && typeof expiresAt === "string" && !Number.isNaN(Date.parse(expiresAt)) ? { link: `${url2}#${READ_PARAM}=${encodeURIComponent(ticket)}`, expiresAt } : plain;
|
|
35507
|
+
} catch (error2) {
|
|
35508
|
+
if (!(error2 instanceof CliError)) ctx.telemetry.capture(error2, "design system card ticket");
|
|
35509
|
+
return plain;
|
|
35510
|
+
}
|
|
35511
|
+
}
|
|
35244
35512
|
function showStarters(args) {
|
|
35245
35513
|
const { plugin } = args;
|
|
35246
35514
|
if (plugin !== void 0 && (typeof plugin !== "string" || !KOMBAI_PLUGIN.test(plugin))) {
|
|
@@ -35382,13 +35650,17 @@ function failed(message) {
|
|
|
35382
35650
|
function shownWords(message) {
|
|
35383
35651
|
return { content: [{ type: "text", text: message }] };
|
|
35384
35652
|
}
|
|
35385
|
-
var TASTE_CARD_TOOL2, PLANS_CARD_TOOL, CHECKOUT_TOOL, SIGN_IN_CARD_TOOL, CHAT_SIGN_IN_TOOL, CHAT_GUEST_TOOL, STARTERS_CARD_TOOL, ACCESS_CARD_TOOL, AccessReason, KOMBAI_PLUGIN, STARTER_PROMPTS, SIGNIN_REQUIRED, CARDS_DIR, GOOGLE_FONTS, INLINE, TASTE, PLANS, SIGN_IN, STARTERS, ACCESS, specsIn, reads, acts, icons, tasteTool, plansTool, checkoutTool, signInTool, startersTool, accessTool, chatSignInTool, chatGuestTool;
|
|
35653
|
+
var TASTE_CARD_TOOL2, PLANS_CARD_TOOL, CHECKOUT_TOOL, SIGN_IN_CARD_TOOL, CHAT_SIGN_IN_TOOL, CHAT_GUEST_TOOL, STARTERS_CARD_TOOL, ACCESS_CARD_TOOL, DESIGN_SYSTEM_CARD_TOOL, AccessReason, KOMBAI_PLUGIN, STARTER_PROMPTS, SIGNIN_REQUIRED, CARDS_DIR, GOOGLE_FONTS, INLINE, TASTE, PLANS, SIGN_IN, STARTERS, ACCESS, DESIGN_SYSTEM, specsIn, reads, acts, icons, tasteTool, plansTool, checkoutTool, signInTool, startersTool, accessTool, designSystemTool, chatSignInTool, chatGuestTool, READ_PARAM, READ_TICKET, DESIGN_SYSTEMS_TICKET_WAIT_MS;
|
|
35386
35654
|
var init_cards = __esm({
|
|
35387
35655
|
"src/mcp/cards.js"() {
|
|
35388
35656
|
"use strict";
|
|
35389
35657
|
init_define_KOMBAI_TELEMETRY();
|
|
35390
35658
|
init_kombai_icon();
|
|
35659
|
+
init_ds();
|
|
35391
35660
|
init_taste();
|
|
35661
|
+
init_canvasdir();
|
|
35662
|
+
init_contract();
|
|
35663
|
+
init_dskit();
|
|
35392
35664
|
init_output();
|
|
35393
35665
|
init_session();
|
|
35394
35666
|
init_store();
|
|
@@ -35406,6 +35678,7 @@ var init_cards = __esm({
|
|
|
35406
35678
|
CHAT_GUEST_TOOL = "chat_guest";
|
|
35407
35679
|
STARTERS_CARD_TOOL = "starters_card";
|
|
35408
35680
|
ACCESS_CARD_TOOL = "access_card";
|
|
35681
|
+
DESIGN_SYSTEM_CARD_TOOL = "design_system_card";
|
|
35409
35682
|
AccessReason = Object.freeze({ Granted: "granted", Blocked: "blocked" });
|
|
35410
35683
|
KOMBAI_PLUGIN = /^kombai@[A-Za-z0-9][A-Za-z0-9._~-]{0,199}$/;
|
|
35411
35684
|
STARTER_PROMPTS = Object.freeze([
|
|
@@ -35480,7 +35753,22 @@ var init_cards = __esm({
|
|
|
35480
35753
|
"openai/widgetHeightHint": 300
|
|
35481
35754
|
}
|
|
35482
35755
|
};
|
|
35483
|
-
|
|
35756
|
+
DESIGN_SYSTEM = {
|
|
35757
|
+
uriBase: "ui://kombai/cli-design-system",
|
|
35758
|
+
bundle: "design-system.js",
|
|
35759
|
+
title: "Kombai",
|
|
35760
|
+
rootId: "kombai-design-system",
|
|
35761
|
+
global: "__kombaiDesignSystem",
|
|
35762
|
+
// No fetches of its own: the design system comes in the tool result, and Open (outside Codex) asks the host to open
|
|
35763
|
+
// its page, with the design systems read ticket the CLI minted when it showed the card (designSystemsPageLink). Its
|
|
35764
|
+
// heading and body fonts load from Google Fonts where they are served there, as the taste card's specimens do.
|
|
35765
|
+
meta: {
|
|
35766
|
+
ui: { csp: { connectDomains: [], resourceDomains: GOOGLE_FONTS }, prefersBorder: true },
|
|
35767
|
+
...INLINE,
|
|
35768
|
+
"openai/widgetHeightHint": 320
|
|
35769
|
+
}
|
|
35770
|
+
};
|
|
35771
|
+
specsIn = (set2) => set2 === Cards.All ? [TASTE, PLANS, STARTERS, ACCESS, DESIGN_SYSTEM, SIGN_IN] : set2 === Cards.Taste ? [TASTE, DESIGN_SYSTEM] : [];
|
|
35484
35772
|
reads = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
35485
35773
|
acts = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true };
|
|
35486
35774
|
icons = () => KOMBAI_ICONS.map((icon) => ({ ...icon, sizes: [...icon.sizes] }));
|
|
@@ -35587,6 +35875,23 @@ var init_cards = __esm({
|
|
|
35587
35875
|
annotations: reads,
|
|
35588
35876
|
_meta: { ui: { resourceUri, visibility: ["model", "app"] } }
|
|
35589
35877
|
});
|
|
35878
|
+
designSystemTool = (resourceUri) => ({
|
|
35879
|
+
name: DESIGN_SYSTEM_CARD_TOOL,
|
|
35880
|
+
title: "Kombai design system",
|
|
35881
|
+
description: "Show one of the user's design systems as a card in this chat: its name, colours, fonts and version, and, when this machine pushed it, the change to its colours, fonts, radius and mode. Call it after each `kombai ds push` that created or updated one, with the slug and ownerKey the push printed. Outside Codex, also call it when the user asks to see that design system again (its Open link lasts 10 minutes), with the same slug and ownerKey (`kombai ds list` shows them). In Codex, call it only once per design system per reply, after that reply's last push, then open it with canvas_app. Put no link to the design system in your reply.",
|
|
35882
|
+
inputSchema: {
|
|
35883
|
+
type: "object",
|
|
35884
|
+
properties: {
|
|
35885
|
+
slug: { type: "string", description: "The slug `kombai ds push` printed." },
|
|
35886
|
+
ownerKey: { type: "string", description: "The ownerKey `kombai ds push` printed (org:<id> or user:<id>)." }
|
|
35887
|
+
},
|
|
35888
|
+
required: ["slug", "ownerKey"],
|
|
35889
|
+
additionalProperties: false
|
|
35890
|
+
},
|
|
35891
|
+
icons: icons(),
|
|
35892
|
+
annotations: reads,
|
|
35893
|
+
_meta: { ui: { resourceUri, visibility: ["model", "app"] } }
|
|
35894
|
+
});
|
|
35590
35895
|
chatSignInTool = () => ({
|
|
35591
35896
|
name: CHAT_SIGN_IN_TOOL,
|
|
35592
35897
|
title: "Sign in to Kombai",
|
|
@@ -35613,6 +35918,9 @@ var init_cards = __esm({
|
|
|
35613
35918
|
annotations: acts,
|
|
35614
35919
|
_meta: { ui: { visibility: ["app"] } }
|
|
35615
35920
|
});
|
|
35921
|
+
READ_PARAM = "read";
|
|
35922
|
+
READ_TICKET = /^tk_[A-Za-z0-9_-]{43}$/;
|
|
35923
|
+
DESIGN_SYSTEMS_TICKET_WAIT_MS = 5e3;
|
|
35616
35924
|
}
|
|
35617
35925
|
});
|
|
35618
35926
|
|
|
@@ -35701,12 +36009,14 @@ html.dark #link{background:#262626}
|
|
|
35701
36009
|
html.dark #link b{color:#f0f0f0}
|
|
35702
36010
|
#link .sm{color:var(--sec)}
|
|
35703
36011
|
/* The cover over a page being replaced: a veil in the view's background that takes every click, under the hosted
|
|
35704
|
-
page's logo loader (components/ui/loader.tsx LogoLoader)
|
|
36012
|
+
page's logo loader (components/ui/loader.tsx LogoLoader): the same logo file, read from the hosted origin rather
|
|
36013
|
+
than carried in this page (about 8 KB), at the loader's size and glow. Until the logo has loaded it stays hidden,
|
|
36014
|
+
so the cover is the veil alone, never a bare tile. */
|
|
35705
36015
|
#cover{position:fixed;inset:0;z-index:1;display:grid;place-items:center;cursor:progress;background:rgba(252,251,244,.6)}
|
|
35706
36016
|
html.dark #cover{background:rgba(30,30,30,.6)}
|
|
35707
|
-
#cover
|
|
36017
|
+
#cover img{width:56px;height:56px;animation:glow 1.5s ease-in-out infinite alternate}
|
|
35708
36018
|
@keyframes glow{from{opacity:.35;filter:drop-shadow(0 0 0 rgba(72,222,148,0))}to{opacity:1;filter:drop-shadow(0 0 16px rgba(72,222,148,.55))}}
|
|
35709
|
-
@media (prefers-reduced-motion:reduce){#cover
|
|
36019
|
+
@media (prefers-reduced-motion:reduce){#cover img,#screen.load #title{animation:none}#screen.load #title{color:inherit;background:none}}
|
|
35710
36020
|
[hidden]{display:none!important}
|
|
35711
36021
|
</style>
|
|
35712
36022
|
</head>
|
|
@@ -35715,7 +36025,7 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35715
36025
|
<div id="screen" class="load" role="status"><div id="panel"><div id="head"><span id="lead"></span><b id="title">Kombai</b></div><p id="body">Connecting to {{HOST_LABEL}}…</p></div></div>
|
|
35716
36026
|
<div id="link"><svg class="ic sm" aria-hidden="true"><use href="#i-link"/></svg><span id="link-text"></span><button id="link-dismiss" type="button">Not now</button><button id="link-open" class="primary" type="button">Open</button></div>
|
|
35717
36027
|
<iframe id="frame" title="Kombai canvas" allow="clipboard-write"></iframe>
|
|
35718
|
-
<div id="cover" role="status" aria-label="Loading" hidden></div>
|
|
36028
|
+
<div id="cover" role="status" aria-label="Loading" hidden><img id="cover-logo" alt="" hidden></div>
|
|
35719
36029
|
<script>
|
|
35720
36030
|
(() => {
|
|
35721
36031
|
var CLI_VERSION = '{{CLI_VERSION}}';
|
|
@@ -35732,6 +36042,17 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35732
36042
|
var EMBED = 'embed', PROTOCOL = 1;
|
|
35733
36043
|
var RESULT_WAIT_MS = 2000, SIGN_IN_WAIT_S = 20;
|
|
35734
36044
|
var CANVAS_ID = /^cnv_[0-9a-f]{12}$/;
|
|
36045
|
+
// A design system to frame: the person's own by slug (the store's DESIGN_ID.slug), or a public one by id (the shared
|
|
36046
|
+
// isSafePresetId, capped at 128 as the page and canvas_app cap it). Anything else is none.
|
|
36047
|
+
var DS_SLUG = /^[a-z0-9][a-z0-9-]{0,63}$/, DS_PUBLIC = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
|
|
36048
|
+
function designSystemOf(m) {
|
|
36049
|
+
if (!m || typeof m !== 'object') return null;
|
|
36050
|
+
if (typeof m.designSystem === 'string' && DS_SLUG.test(m.designSystem)) return { pub: false, id: m.designSystem };
|
|
36051
|
+
if (typeof m.publicDesignSystem === 'string' && DS_PUBLIC.test(m.publicDesignSystem)) {
|
|
36052
|
+
return { pub: true, id: m.publicDesignSystem };
|
|
36053
|
+
}
|
|
36054
|
+
return null;
|
|
36055
|
+
}
|
|
35735
36056
|
// An organization id as the view passes it to the page and back to the CLI: anything else is dropped.
|
|
35736
36057
|
var ORG_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
35737
36058
|
var SIGN_IN_STOPPED = 'Sign-in did not finish.';
|
|
@@ -35745,6 +36066,12 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35745
36066
|
var linkBar = document.getElementById('link');
|
|
35746
36067
|
var linkText = document.getElementById('link-text');
|
|
35747
36068
|
var cover = document.getElementById('cover');
|
|
36069
|
+
// The cover's logo: the hosted page's own logo file (components/ui/loader.tsx LOGO_LOADER_SRC, under the hosted
|
|
36070
|
+
// build's /hosted-canvas/ base), read once the session names the hosted origin, so it has usually loaded before
|
|
36071
|
+
// the first switch. Shown only once loaded; a failed read leaves the veil alone.
|
|
36072
|
+
var COVER_LOGO_PATH = '/hosted-canvas/kombai-logo.svg';
|
|
36073
|
+
var coverLogo = document.getElementById('cover-logo');
|
|
36074
|
+
coverLogo.addEventListener('load', function () { coverLogo.hidden = false; });
|
|
35748
36075
|
|
|
35749
36076
|
// A screen of the view's own, in place of the frame: only before the page can load, or when it cannot. opts.icon: a
|
|
35750
36077
|
// symbol in the sprite (#i-<icon>), drawn above the title. opts.tone: 'warn', the icon's colour. opts.load: a loading
|
|
@@ -35817,6 +36144,13 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35817
36144
|
var signInState = null, offeredOrgs = [];
|
|
35818
36145
|
var hosted = null;
|
|
35819
36146
|
var canvas = null, node = null;
|
|
36147
|
+
// The design system framed in place of a canvas ({ pub, id }), or null; and what its Back frames again: the canvas
|
|
36148
|
+
// and design shown before it ({ canvas, node }), or null for the home.
|
|
36149
|
+
var ds = null, back = null;
|
|
36150
|
+
// The status a page framed with no ticket waits on while it shows its sign-in: watch() asks again until the session
|
|
36151
|
+
// tool answers something else. 'guest_home' for a design system a guest, or a machine that never signed in, asked
|
|
36152
|
+
// for (change 15g); 'not_signed_in' otherwise.
|
|
36153
|
+
var signInFor = 'not_signed_in';
|
|
35820
36154
|
var openingResult = null, openingError = null, openingArgs = null;
|
|
35821
36155
|
var claimTries = 0, retryTimer = null;
|
|
35822
36156
|
// Each open's number: only the latest one's answer is used. The cover's own timer (coverFrame).
|
|
@@ -35922,7 +36256,8 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35922
36256
|
function hello() {
|
|
35923
36257
|
// The guest home's facts go only to the loaded guest home.
|
|
35924
36258
|
return {
|
|
35925
|
-
kind: 'hello', theme: theme, canvases: true, signsIn: true, makesGuests: true,
|
|
36259
|
+
kind: 'hello', theme: theme, canvases: true, signsIn: true, makesGuests: true, designSystems: true,
|
|
36260
|
+
opensInAppBrowser: !!APP_BROWSER,
|
|
35926
36261
|
insets: insets, guest: framedHome && framedGuest ? { canvas: guestCanvas, project: guestProject } : null,
|
|
35927
36262
|
};
|
|
35928
36263
|
}
|
|
@@ -35970,6 +36305,9 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35970
36305
|
if (m.kind === 'open-canvas' && typeof m.canvas === 'string' && CANVAS_ID.test(m.canvas)) {
|
|
35971
36306
|
canvas = m.canvas;
|
|
35972
36307
|
node = null;
|
|
36308
|
+
ds = null;
|
|
36309
|
+
back = null;
|
|
36310
|
+
signInFor = 'not_signed_in';
|
|
35973
36311
|
open();
|
|
35974
36312
|
return;
|
|
35975
36313
|
}
|
|
@@ -35978,6 +36316,33 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
35978
36316
|
if (m.kind === 'open-canvases') {
|
|
35979
36317
|
canvas = null;
|
|
35980
36318
|
node = null;
|
|
36319
|
+
ds = null;
|
|
36320
|
+
back = null;
|
|
36321
|
+
signInFor = 'not_signed_in';
|
|
36322
|
+
open();
|
|
36323
|
+
return;
|
|
36324
|
+
}
|
|
36325
|
+
// A card in the page's Design systems panel: that design system's page in the canvas's place, on a no-project
|
|
36326
|
+
// ticket. Only a slug or a public id is taken, so a forged message can show nothing but a design system page, which
|
|
36327
|
+
// the store judges by the person's own pass. Back returns to the canvas the first one replaced.
|
|
36328
|
+
if (m.kind === 'open-design-system') {
|
|
36329
|
+
var picked = designSystemOf(m);
|
|
36330
|
+
if (!picked) return;
|
|
36331
|
+
if (!ds) back = { canvas: canvas, node: node };
|
|
36332
|
+
ds = picked;
|
|
36333
|
+
canvas = null;
|
|
36334
|
+
node = null;
|
|
36335
|
+
open();
|
|
36336
|
+
return;
|
|
36337
|
+
}
|
|
36338
|
+
// Back on a design system's page: the canvas (and design) shown before it, or the home.
|
|
36339
|
+
if (m.kind === 'close-design-system') {
|
|
36340
|
+
if (!ds) return;
|
|
36341
|
+
ds = null;
|
|
36342
|
+
signInFor = 'not_signed_in';
|
|
36343
|
+
canvas = back ? back.canvas : null;
|
|
36344
|
+
node = back ? back.node : null;
|
|
36345
|
+
back = null;
|
|
35981
36346
|
open();
|
|
35982
36347
|
return;
|
|
35983
36348
|
}
|
|
@@ -36059,10 +36424,13 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36059
36424
|
// ticket null: a page with no ticket, the guest home before its guest (guestHome) or a page that draws the sign-in.
|
|
36060
36425
|
function showFrame(ticket, guestHome) {
|
|
36061
36426
|
unwatch();
|
|
36062
|
-
var guest = !!guestHome && !canvas;
|
|
36427
|
+
var guest = !!guestHome && !canvas && !ds;
|
|
36063
36428
|
var page = canvas
|
|
36064
36429
|
? '/c/' + encodeURIComponent(canvas) + '?embed=' + HOST_EMBED + '&theme=' + theme + (node ? '&node=' + encodeURIComponent(node) : '')
|
|
36065
|
-
:
|
|
36430
|
+
: ds
|
|
36431
|
+
? (ds.pub ? '/ds?preset=' + encodeURIComponent(ds.id) + '&' : '/ds/' + encodeURIComponent(ds.id) + '?') +
|
|
36432
|
+
'embed=' + HOST_EMBED + '&theme=' + theme
|
|
36433
|
+
: '/canvases?embed=' + HOST_EMBED + '&theme=' + theme + (guest ? '&guest=1' : '');
|
|
36066
36434
|
var address = hosted + page + (ticket === null ? '' : '#ticket=' + encodeURIComponent(ticket));
|
|
36067
36435
|
// The same page with a new ticket differs only in its fragment, which the browser would not reload for: a
|
|
36068
36436
|
// throwaway query parameter, which the hosted page ignores, makes it a new address.
|
|
@@ -36080,8 +36448,8 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36080
36448
|
closeScreen();
|
|
36081
36449
|
frame.style.display = 'block';
|
|
36082
36450
|
framedSignIn = ticket === null && !guest;
|
|
36083
|
-
// Trusted as the home only once loaded.
|
|
36084
|
-
var home = !canvas;
|
|
36451
|
+
// Trusted as the home only once loaded; a design system's page is never the home.
|
|
36452
|
+
var home = !canvas && !ds;
|
|
36085
36453
|
framedHome = false;
|
|
36086
36454
|
framedGuest = false;
|
|
36087
36455
|
var shown = opens;
|
|
@@ -36120,6 +36488,9 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36120
36488
|
return Object.assign(args, extra || {});
|
|
36121
36489
|
}
|
|
36122
36490
|
function takeIds(answer) {
|
|
36491
|
+
// A design system is framed in a canvas's place: a claim's answer names the guest's canvas, which must not replace
|
|
36492
|
+
// it.
|
|
36493
|
+
if (ds) return;
|
|
36123
36494
|
if (typeof answer.canvas === 'string') canvas = answer.canvas;
|
|
36124
36495
|
if (typeof answer.node === 'string') node = answer.node;
|
|
36125
36496
|
}
|
|
@@ -36135,11 +36506,20 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36135
36506
|
// The statuses every session answer shares. False for one it does not know: the caller words that.
|
|
36136
36507
|
function handle(answer) {
|
|
36137
36508
|
if (typeof answer.hosted === 'string') hosted = answer.hosted;
|
|
36509
|
+
if (hosted && !coverLogo.getAttribute('src')) coverLogo.src = hosted + COVER_LOGO_PATH;
|
|
36138
36510
|
if (answer.status === 'ticket' || answer.status === 'guest_home') {
|
|
36139
36511
|
claimTries = 0;
|
|
36140
36512
|
signInState = null;
|
|
36141
36513
|
offeredOrgs = [];
|
|
36142
36514
|
var home = answer.status === 'guest_home';
|
|
36515
|
+
// A design system needs an account: a guest, or a machine that never signed in, gets its page with no ticket,
|
|
36516
|
+
// which draws the sign-in, and the view asks again now and then.
|
|
36517
|
+
if (home && ds) {
|
|
36518
|
+
signInFor = 'guest_home';
|
|
36519
|
+
showFrame(null, false);
|
|
36520
|
+
watch(signInFor);
|
|
36521
|
+
return true;
|
|
36522
|
+
}
|
|
36143
36523
|
if (home) {
|
|
36144
36524
|
guestCanvas = answer.guestCanvas && typeof answer.guestCanvas === 'object' ? answer.guestCanvas : null;
|
|
36145
36525
|
guestProject = typeof answer.project === 'string' ? answer.project : null;
|
|
@@ -36199,14 +36579,16 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36199
36579
|
if (answer.status === 'not_signed_in' && hosted) {
|
|
36200
36580
|
signInState = null;
|
|
36201
36581
|
offeredOrgs = [];
|
|
36582
|
+
signInFor = 'not_signed_in';
|
|
36202
36583
|
showFrame(null, false);
|
|
36203
|
-
watch(
|
|
36584
|
+
watch(signInFor);
|
|
36204
36585
|
return;
|
|
36205
36586
|
}
|
|
36206
36587
|
askAgent();
|
|
36207
36588
|
}
|
|
36208
36589
|
function askAgent() {
|
|
36209
36590
|
if (canvas) show('This canvas didn’t open', 'Ask your agent to open it again.', { icon: 'msg' });
|
|
36591
|
+
else if (ds) show('This design system didn’t open', 'Ask your agent to open it again.', { icon: 'msg' });
|
|
36210
36592
|
else show('Kombai didn’t open', 'Ask your agent to open Kombai again.', { icon: 'msg' });
|
|
36211
36593
|
}
|
|
36212
36594
|
|
|
@@ -36248,7 +36630,7 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36248
36630
|
if (!hosted) { askAgent(); return; }
|
|
36249
36631
|
needPage();
|
|
36250
36632
|
tellSignIn({ state: 'failed', message: message });
|
|
36251
|
-
if (framedSignIn) watch(
|
|
36633
|
+
if (framedSignIn) watch(signInFor);
|
|
36252
36634
|
}
|
|
36253
36635
|
|
|
36254
36636
|
// "Continue as guest" on the guest home's welcome popup: the CLI makes the guest, and its answer, the guest home with
|
|
@@ -36281,7 +36663,7 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36281
36663
|
framedGuest = false;
|
|
36282
36664
|
coverFrame();
|
|
36283
36665
|
} else if (!retry) {
|
|
36284
|
-
show('Kombai', canvas ? 'Opening the canvas…' : 'Opening Kombai…', { load: true });
|
|
36666
|
+
show('Kombai', canvas ? 'Opening the canvas…' : ds ? 'Opening the design system…' : 'Opening Kombai…', { load: true });
|
|
36285
36667
|
}
|
|
36286
36668
|
callTool(SESSION_TOOL, sessionArgs()).then(function (answer) {
|
|
36287
36669
|
if (mine === opens) settle(answer);
|
|
@@ -36311,6 +36693,9 @@ html.dark #cover{background:rgba(30,30,30,.6)}
|
|
|
36311
36693
|
var result = openingResult || openingArgs;
|
|
36312
36694
|
canvas = result && typeof result.canvas === 'string' ? result.canvas : null;
|
|
36313
36695
|
node = result && typeof result.node === 'string' ? result.node : null;
|
|
36696
|
+
// canvas_app names a design system in place of a canvas, never beside one; Back from it goes to the home.
|
|
36697
|
+
ds = canvas ? null : designSystemOf(result);
|
|
36698
|
+
back = null;
|
|
36314
36699
|
open();
|
|
36315
36700
|
}).catch(function (error) {
|
|
36316
36701
|
show('Couldn\u2019t connect to ' + HOST_LABEL, error.message, { icon: 'unplug', tone: 'warn' });
|
|
@@ -36357,7 +36742,10 @@ function createMcpServer(ctx, options = {}) {
|
|
|
36357
36742
|
const resourceMeta = async () => {
|
|
36358
36743
|
const { hosts } = await currentEnv(ctx);
|
|
36359
36744
|
return {
|
|
36360
|
-
ui: {
|
|
36745
|
+
ui: {
|
|
36746
|
+
csp: { connectDomains: [], resourceDomains: [hosts.web], frameDomains: [hosts.web] },
|
|
36747
|
+
prefersBorder: false
|
|
36748
|
+
},
|
|
36361
36749
|
"openai/ui": { preferredDisplayMode: "fullscreen", availableDisplayModes: ["fullscreen"] },
|
|
36362
36750
|
"openai/widgetShowCodexWidgetInline": false
|
|
36363
36751
|
};
|
|
@@ -36547,7 +36935,7 @@ var init_assets = __esm({
|
|
|
36547
36935
|
var brief_default;
|
|
36548
36936
|
var init_brief = __esm({
|
|
36549
36937
|
"src/skill/brief.md"() {
|
|
36550
|
-
brief_default = '# Writing a taste brief\n\nTaste reads only the brief: it cannot see the repo, the chat or any file. Write everything it needs into\nthe brief, at most 8,000 characters, in a file outside the repo, then pass it to\n`kombai taste start --brief <file> --variants <1-4>`.\n\nGive ground truth, not design advice. Taste\'s job is to bring the design ideas; ideas you add make it\ncopy yours. For "a joyful, light CRM", write "A joyful light-theme CRM application", not "a light CRM\ndashboard with a soft purple gradient".\n\nA brief says:\n\n- What to design, in plain words that name the kind of UI: a pricing section, sign-in, onboarding, a\n dashboard, a data table, an AI chat, an empty state.\n- The scope: a full page, one section, a screen, a multi-screen flow, or one reusable component. For a\n component taste returns lighter options (arrangements, looks, graphic ideas) and no assets.\n- Every fact the design shows: the product and who uses it, the real copy (names, numbers, plans,\n prices, navigation), the content of each section, and the states that matter.\n- What is already decided, from the repo or the user: brand colors, fonts, logo, an existing design\n system (its tokens, copied from tailwind config, globals.css, theme or token files), and what must stay\n as it is. Copy the values; taste cannot open the files.\n- What is still open, only when the user said so: "explore the layout", "keep our colors".\n\nSkip taste when the work copies or reflows a design instead of making a new one: a clone of a page,\nscreenshot or mock the user gave, a build of the repo\'s existing screens, a version of a design for\nanother device or mode, or an edit to part of a design. Then write the HTML straight from the reference\nor the pulled node.\n\nA taste run takes a few minutes. Tell the user it has started, and create the canvas and show it\n(`kombai skill opening`) while it runs. Run `kombai taste wait <run>` in the foreground, one wait at a\ntime: it returns within 90 seconds, so while its status is running, tell the user the run is still going,\nas expected, and wait again.\n\nWhen `kombai taste wait` answers with `card`, call taste_card. When it answers with `url` instead, give the user that\nlink in your
|
|
36938
|
+
brief_default = '# Writing a taste brief\n\nTaste reads only the brief: it cannot see the repo, the chat or any file. Write everything it needs into\nthe brief, at most 8,000 characters, in a file outside the repo, then pass it to\n`kombai taste start --brief <file> --variants <1-4>`.\n\nGive ground truth, not design advice. Taste\'s job is to bring the design ideas; ideas you add make it\ncopy yours. For "a joyful, light CRM", write "A joyful light-theme CRM application", not "a light CRM\ndashboard with a soft purple gradient".\n\nA brief says:\n\n- What to design, in plain words that name the kind of UI: a pricing section, sign-in, onboarding, a\n dashboard, a data table, an AI chat, an empty state.\n- The scope: a full page, one section, a screen, a multi-screen flow, or one reusable component. For a\n component taste returns lighter options (arrangements, looks, graphic ideas) and no assets.\n- Every fact the design shows: the product and who uses it, the real copy (names, numbers, plans,\n prices, navigation), the content of each section, and the states that matter.\n- What is already decided, from the repo or the user: brand colors, fonts, logo, an existing design\n system (its tokens, copied from tailwind config, globals.css, theme or token files), and what must stay\n as it is. Copy the values; taste cannot open the files.\n- What is still open, only when the user said so: "explore the layout", "keep our colors".\n- Where it will be built, if not on a Kombai canvas.\n\nSkip taste when the work copies or reflows a design instead of making a new one: a clone of a page,\nscreenshot or mock the user gave, a build of the repo\'s existing screens, a version of a design for\nanother device or mode, or an edit to part of a design. Then write the HTML straight from the reference\nor the pulled node.\n\nTaste runs the same wherever the design is built. In another design tool (Paper, Figma), or in the\nrepo\'s code when the user asks for that, build and check with that tool\'s own tools, not Kombai\'s canvas\ncommands. "For my site" still means a Kombai canvas. Unsure where: ask.\n\nA taste run takes a few minutes. Tell the user it has started, and create the canvas and show it\n(`kombai skill opening`) while it runs. Run `kombai taste wait <run>` in the foreground, one wait at a\ntime: it returns within 90 seconds, so while its status is running, tell the user the run is still going,\nas expected, and wait again.\n\nWhen `kombai taste wait` answers with `card`, call taste_card. When it answers with `url` instead, give the user that\nlink at once, on its own line, before you read directions.md, and not in your final message: it shows the taste Kombai\nsettled on, for them to review while you build. To look at the page in your own browser panel, open the\nlink from `kombai taste link <run> --in-app` instead, and never show that one to the user.\n\nAfter `kombai taste wait`, follow directions.md: one direction per variant. In it, <stock-image> tags\ndescribe photos and <icon> tags name icons from the library its <icon-library> tag names: put icons in as\ninline SVG from that library, and photos as images, from a public https URL or saved in the repo. Its\nasset links are real; use them as given and never invent one.\n\nTaste finds stock photos and videos for every run, and makes AI images where a design wants art rather than a\nphoto; each image uses credits. Add `--no-generate` to `kombai taste start` only when the user asked for no\nAI-generated images (stock photos only). Taste never makes videos: a <deferred-video-generation> block in\ndirections.md lists the prompts of the videos it did not make, and says when to make them.\n\ndirections.md is written for a page on a canvas, as Kombai\'s own Design mode writes it. What it asks for\nruns there: scroll-driven motion (parallax, reveal or count-up on scroll, pinning), smooth scrolling\n(Lenis, Locomotive), sticky or fixed elements, and the Sticky Layout Rule it may add, once the design has a\nheight of its own (`kombai skill html`, Size and position). A\n<stock-image> or <stock-video> with no link has no asset: draw it as SVG or leave it out. Treat a\n<generate-video> the same, unless the user asked for AI video: then make it as `kombai skill assets`\nsays, with its aspect and duration as --aspect and --duration.\n';
|
|
36551
36939
|
}
|
|
36552
36940
|
});
|
|
36553
36941
|
|
|
@@ -36563,7 +36951,7 @@ var init_claude_desktop = __esm({
|
|
|
36563
36951
|
var codex_desktop_default;
|
|
36564
36952
|
var init_codex_desktop = __esm({
|
|
36565
36953
|
"src/skill/codex-desktop.md"() {
|
|
36566
|
-
codex_desktop_default = "You are running in the Codex app. Notes for it:\n\n- Kombai's tools here (canvas_app, sign_in_card, taste_card, plans_card) are not listed
|
|
36954
|
+
codex_desktop_default = "You are running in the Codex app. Notes for it:\n\n- Kombai's tools here (canvas_app, sign_in_card, taste_card, plans_card, design_system_card) are not listed\n up front. Find them in exec with `ALL_TOOLS.filter((t) => t.name.startsWith('mcp__kombai'))` before you\n decide one is missing. Do that first, before any design work: if none exist, set up Kombai's view as\n `kombai skill opening` says and move the work to a new task, since this one can't show the canvas.\n- Other design tools' tools (Paper's, Figma's) are in ALL_TOOLS too: look there before deciding you have\n none.\n- The canvas: Kombai's view, the canvas_app tool, is the only way to show it here. Call it with the canvas id\n right after `kombai canvas create`, before you write any design, or when you first use a canvas that isn't\n already open beside the chat, as `kombai skill opening` says. Never open a canvas in a browser or the in-app\n browser, and put no canvas or design link in a reply: the commands print none here, and a user who wants one\n copies it from the view (the canvas's Share, or a design's Copy link).\n- Taste: add --cards to every `kombai taste start`, and call taste_card when `kombai taste wait` answers with\n card.\n- Design systems: after a reply's last `kombai ds push` that created or updated one, call\n design_system_card with the slug and ownerKey it printed, then canvas_app with designSystem (its slug)\n instead of a canvas: each once per design system per reply. When the user asks to see one, call\n canvas_app with designSystem, or publicDesignSystem (a public one's id). Never a link: the commands\n print none here.\n";
|
|
36567
36955
|
}
|
|
36568
36956
|
});
|
|
36569
36957
|
|
|
@@ -36571,7 +36959,7 @@ var init_codex_desktop = __esm({
|
|
|
36571
36959
|
var design_system_default;
|
|
36572
36960
|
var init_design_system = __esm({
|
|
36573
36961
|
"src/skill/design-system.md"() {
|
|
36574
|
-
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,
|
|
36962
|
+
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, file (null if not pulled here) and url (its page\n on the canvas site), and in publicDesignSystems Kombai\'s public ones, each with its id, name,\n description, file and url.\n- `kombai ds pull <slug>` writes the file it prints. Edit it, then `kombai ds push <file>`. Both print\n its url too.\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- After a `kombai ds push` that prints status created or updated, call design_system_card with the slug\n and ownerKey it printed when that tool is among yours (even listed by name only): it shows the design\n system as a card, so put no link in your reply. When the user asks to open a design system again\n after its card\'s link expired, call design_system_card again (same slug and ownerKey) for a fresh\n link. Without the tool, give its url as a named link, `[<name> design system](<url>)` with the name\n in the file, never the bare url; give none where url is null or missing. In the Codex app, call it\n once per design system per reply, after that reply\'s last push, then open it with canvas_app, as its\n notes say.\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. To show the user one, give\nthe url `ds list`, `ds pull` or `ds push` prints for it as a named link, `[<name> design system](<url>)`,\nnever bare; never build one yourself. Where the url is null or missing, give none. In the Codex app use\ncanvas_app instead.\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';
|
|
36575
36963
|
}
|
|
36576
36964
|
});
|
|
36577
36965
|
|
|
@@ -36587,7 +36975,7 @@ var init_drawings = __esm({
|
|
|
36587
36975
|
var faq_default;
|
|
36588
36976
|
var init_faq = __esm({
|
|
36589
36977
|
"src/skill/faq.md"() {
|
|
36590
|
-
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, Cursor, VS Code (GitHub Copilot's agent plugins) and
|
|
36978
|
+
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, Cursor, VS Code (GitHub Copilot's agent plugins), Antigravity, OpenCode,\n Grok Build and Devin (its CLI and desktop app) have Kombai plugins, and Gemini CLI has a Kombai extension; any agent\n with a terminal can run the CLI. The Codex app shows the canvas beside the chat and Kombai's cards (a taste run's\n brief, sign-in); the Claude desktop app's Code tab shows the taste card only. Elsewhere the canvas opens in the\n 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, AI images or video, repo images,\n design systems or 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 skill opening` says how to show one to the user.\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 Kombai plugin starts a pinned CLI version with `npx`, which then keeps its own copy under\n ~/.kombai/cli/install and runs every later command from it. At the start of each design request (`kombai skill`,\n and `kombai mcp install`) it asks Kombai which version to be on and, when a newer one is out, downloads it from npm,\n checks it against the checksum Kombai names, and switches; a running command never changes version. Nothing else\n runs in the background. `kombai update` checks now. `KOMBAI_CLI_SELF_UPDATE=0` turns it off (it is off by default\n in CI); the copy already there then stays as it is. A global install (`npm i -g`) is never touched and updates\n with npm.\n- **Reporting a problem.** Email support@kombai.com with the command, the JSON line it printed and the version\n `kombai --version` prints.\n";
|
|
36591
36979
|
}
|
|
36592
36980
|
});
|
|
36593
36981
|
|
|
@@ -36619,7 +37007,7 @@ var init_opening = __esm({
|
|
|
36619
37007
|
var overview_default;
|
|
36620
37008
|
var init_overview = __esm({
|
|
36621
37009
|
"src/skill/overview.md"() {
|
|
36622
|
-
overview_default = '# Kombai design\n\nDesign UI on a hosted Kombai canvas; design systems need no canvas
|
|
37010
|
+
overview_default = '# Kombai design\n\nDesign UI on a hosted Kombai canvas, or where the user asks; design systems need no canvas.\n`kombai <command> --help` gives its flags. Read each JSON result: next can be a command, a link or\nadvice. Follow it after handling the error and 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 Kombai canvas or node (a link, "On my Kombai canvas" message, or its name): 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.\n2. When taste is needed (never for a guest), tell the user their `kombai credits` balance, then run\n `kombai taste start --brief <file> --variants <1-4>`, one per design (--cards if you have a taste_card\n tool). Do step 3 meanwhile, then `kombai taste wait <run>`: show its card or link, then follow\n directions.md. On TASTE_NO_CREDITS, call plans_card if among your tools, else show next\'s plan link; stop.\n3. Unless built elsewhere, `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. Unless built elsewhere, 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';
|
|
36623
37011
|
}
|
|
36624
37012
|
});
|
|
36625
37013
|
|
|
@@ -36723,7 +37111,7 @@ var init_skill = __esm({
|
|
|
36723
37111
|
}
|
|
36724
37112
|
const app = skillAppOf(ctx);
|
|
36725
37113
|
const note = topic === "overview" && app ? await CHANNEL_NOTES[app](ctx) : "";
|
|
36726
|
-
const updated =
|
|
37114
|
+
const updated = updatedLine(ctx.selfUpdate);
|
|
36727
37115
|
ctx.stdout.write(
|
|
36728
37116
|
`${updated ? `${updated}
|
|
36729
37117
|
|
|
@@ -38929,6 +39317,7 @@ ${turnGrant}
|
|
|
38929
39317
|
writeOutcome(ctx.stdout, { version: ctx.version }, ctx.warnings, ctx.pretty);
|
|
38930
39318
|
return Exit.OK;
|
|
38931
39319
|
}
|
|
39320
|
+
if (ctx.selfUpdate?.withdrawn) throw withdrawnHere(ctx.selfUpdate, argv2);
|
|
38932
39321
|
running = parsed.command;
|
|
38933
39322
|
const result = await parsed.command.run(ctx, parsed.input);
|
|
38934
39323
|
const code = typeof result[EXIT_CODE] === "number" ? result[EXIT_CODE] : Exit.OK;
|
|
@@ -39002,6 +39391,26 @@ function sameShape(error2, command) {
|
|
|
39002
39391
|
}
|
|
39003
39392
|
return error2;
|
|
39004
39393
|
}
|
|
39394
|
+
function withdrawnHere(found, argv2) {
|
|
39395
|
+
const { version: version2, bootstrap } = (
|
|
39396
|
+
/** @type {NonNullable<typeof found.withdrawn>} */
|
|
39397
|
+
found.withdrawn
|
|
39398
|
+
);
|
|
39399
|
+
const failed2 = found.failed ?? null;
|
|
39400
|
+
const replacement = failed2 ? `, and its replacement (${failed2.version}) could not be installed here` : "";
|
|
39401
|
+
return new CliError(
|
|
39402
|
+
"CLI_VERSION_WITHDRAWN",
|
|
39403
|
+
`Kombai CLI ${version2} has been withdrawn${replacement}. Run the next command instead.`,
|
|
39404
|
+
{
|
|
39405
|
+
next: [`npx -y ${PACKAGE_NAME}@${bootstrap}`, ...argv2.map(shellArg)].join(" "),
|
|
39406
|
+
details: {
|
|
39407
|
+
version: version2,
|
|
39408
|
+
runWith: bootstrap,
|
|
39409
|
+
...failed2 ? { replacement: failed2.version, reason: failed2.reason } : {}
|
|
39410
|
+
}
|
|
39411
|
+
}
|
|
39412
|
+
);
|
|
39413
|
+
}
|
|
39005
39414
|
function upgradeRequired(ctx, failure) {
|
|
39006
39415
|
const required2 = typeof failure.details?.required === "string" ? failure.details.required : null;
|
|
39007
39416
|
const needs = `Kombai now needs CLI ${required2 ?? "a newer version"}${required2 ? " or newer" : ""} for this; this is ${ctx.version}.`;
|