@iksnerd/blazon 0.2.0 → 0.3.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/README.md +8 -7
- package/dist/chunks/{site-builder-BtGOvjBC.js → site-builder-CH6OcFSE.js} +64 -61
- package/dist/cli/commands/mcp-check.d.ts +3 -1
- package/dist/cli/commands/mcp-check.d.ts.map +1 -1
- package/dist/cli/commands/mcp.d.ts +2 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/index.js +1153 -1126
- package/dist/core/mcp-config.d.ts +12 -6
- package/dist/core/mcp-config.d.ts.map +1 -1
- package/dist/core/operations/list.d.ts.map +1 -1
- package/dist/core/starter.d.ts.map +1 -1
- package/dist/index.js +32 -32
- package/mcp/dist/index.js +22745 -0
- package/package.json +8 -4
- package/template/AGENTS.md +2 -2
- package/template/blazon.json +18 -0
- package/template/docs/01-principles.md +1 -1
- package/template/docs/12-web.md +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Design tokens, guidelines and brand assets in one repo, compiled into CSS, TypeS
|
|
|
10
10
|
|
|
11
11
|
Brand guidelines usually live in a PDF or a slide deck, and the values developers need are copied out of it by hand. Blazon keeps them in the repo as [DTCG](https://www.designtokens.org/TR/2025.10/format/) (Design Tokens Community Group) token files and Markdown. One build writes the CSS variables, a typed TypeScript module and a static brand book, and `blazon check` fails the build when a token breaks the brand's own rules. It reads the same DTCG files as Style Dictionary and Tokens Studio, and adds the rules, the checks and the book.
|
|
12
12
|
|
|
13
|
-
> **Status: pre-release
|
|
13
|
+
> **Status: pre-release, on npm as `@iksnerd/blazon`.** It is 0.x, so a minor version may break ([versioning](#versioning-and-stability)). The npm package named `blazon` is an unrelated project (a type checker): `npx blazon` in a folder where `@iksnerd/blazon` is not installed runs that one, not this tool. Run it with `npx @iksnerd/blazon <command>`, or install it and run `npx blazon` (the installed program wins) or `./node_modules/.bin/blazon`.
|
|
14
14
|
|
|
15
15
|
Jump to: [Quick start](#quick-start), [Set up with your agent](#set-up-with-your-agent), [Use blazon from your agent (MCP)](#use-blazon-from-your-agent-mcp), [When not to use blazon](#when-not-to-use-blazon), [How it works](#how-it-works), [Plugins](#plugins), [Commands](#commands), [Configuration](#configuration), [Versioning and stability](#versioning-and-stability), [Security](#security), [Documentation](#documentation), [Contributing](#contributing).
|
|
16
16
|
|
|
@@ -61,14 +61,15 @@ run the `fix` it names, and register the server with `blazon mcp --print-config
|
|
|
61
61
|
|
|
62
62
|
## Use blazon from your agent (MCP)
|
|
63
63
|
|
|
64
|
-
A coding agent can ask blazon about the brand as tool calls (`check_brand`, `get_token`, `can_use` and
|
|
64
|
+
A coding agent can ask blazon about the brand as tool calls (`check_brand`, `get_token`, `can_use` and four more, all read-only) instead of reading token files. The server ships inside `@iksnerd/blazon`: `npm install @iksnerd/blazon` gives you its program, `blazon-mcp`, and installs no package for it (it is one file with its libraries bundled in). Print the config for your client and check that it works:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
|
|
68
|
-
blazon mcp --
|
|
69
|
-
blazon mcp --check --brand my-brand # built? finds blazon? answers a real handshake? registered?
|
|
67
|
+
npx blazon mcp --print-config --client claude-code --brand my-brand
|
|
68
|
+
npx blazon mcp --check --brand my-brand # finds the server? finds blazon? answers a real handshake? registered?
|
|
70
69
|
```
|
|
71
70
|
|
|
71
|
+
`--print-config` prints the command that registers it: `node`, the installed server file, `--brand` and `BLAZON_BIN`. To run the server by hand without installing, `npx -y -p @iksnerd/blazon blazon-mcp --brand my-brand` does it (`blazon-mcp --version` names the MCP SDK and zod it carries).
|
|
72
|
+
|
|
72
73
|
`blazon mcp --check` writes no file, prints a `fix` command for each check that fails, and exits 1 when the server is not ready. It starts the server on the brand folder, which compiles it with no plugin; what a brand says reaches your agent as tool results, so use a brand you trust. [Blazon for agents](docs/manual/20-blazon-for-agents.md) has the tools and the clients. For an agent that reads skills, [`skills/blazon/SKILL.md`](skills/blazon/SKILL.md) teaches the loop (check, contrast, MCP tools, what never to edit).
|
|
73
74
|
|
|
74
75
|
## A rule that fails the build
|
|
@@ -126,7 +127,7 @@ The same compile feeds the dev server, so a change to a token, a page or the con
|
|
|
126
127
|
- **Exports the whole brand.** `blazon build` also writes `brand.json`: the tokens with their rules, the pages, the assets and the findings, in one versioned file with a JSON Schema, readable from any language. [`brand.json`](docs/manual/11-brand-json.md)
|
|
127
128
|
- **Builds a brand book that wears the brand.** The viewer takes its colors, typefaces and logo from your tokens. Pages place live content from them: swatches, the type scale, the logo on each background with its clear space, icons, patterns and social formats. It has search, a dark mode, and a Review page listing what `blazon check` found. [Pages](docs/manual/05-pages.md), [assets and icons](docs/manual/06-assets-and-icons.md)
|
|
128
129
|
- **Compares them with a live site.** `blazon drift <url-or-css-file>` reports which tokens that name a `source.cssVar` have changed since.
|
|
129
|
-
- **Answers a coding agent.** The read commands (`blazon get`, `blazon rules`, `blazon can` and the rest) print JSON, and a
|
|
130
|
+
- **Answers a coding agent.** The read commands (`blazon get`, `blazon rules`, `blazon can` and the rest) print JSON, and a read-only server, `blazon-mcp`, offers them as tool calls over the Model Context Protocol. It ships inside the blazon package. [Building a website from a brand](docs/manual/19-building-a-website.md), [Blazon for agents](docs/manual/20-blazon-for-agents.md)
|
|
130
131
|
- **Extends with plugins.** See below.
|
|
131
132
|
|
|
132
133
|
## Plugins
|
|
@@ -157,7 +158,7 @@ A plugin whose manifest lists a variable that is set, and that the entry does no
|
|
|
157
158
|
| [`blazon.press-kit`](docs/manual/14-shipped-plugins.md#blazonpress-kit) | A folder and zip for people outside the brand: logos, colors, fonts, a one-page PDF |
|
|
158
159
|
| [`blazon.social-cards`](docs/manual/14-shipped-plugins.md#blazonsocial-cards) | Marketing images from the tokens and logo, checked for contrast |
|
|
159
160
|
|
|
160
|
-
Several need Chrome for their PDF or PNG output; the manual says which. The starter's config
|
|
161
|
+
Several need Chrome for their PDF or PNG output; the manual says which. The starter's config lists `blazon.copy` with blazon's own rules, and `blazon.tailwind` and `blazon.shadcn`, which need only Node and write the Tailwind and shadcn/ui files. It leaves out the other plugins of blazon's own book (the deck, the social cards, the favicons, the logo kit, the press kit and the platform and Office files), because most need Chrome and a new book has no use for the kits yet; add one by name when you want it. To write your own, see [Writing a plugin](docs/manual/13-writing-a-plugin.md). A plugin can be pinned, so one that changed on disk does not run.
|
|
161
162
|
|
|
162
163
|
## Using the tokens
|
|
163
164
|
|
|
@@ -10042,7 +10042,11 @@ function Kh() {
|
|
|
10042
10042
|
r = n;
|
|
10043
10043
|
}
|
|
10044
10044
|
}
|
|
10045
|
-
var qh = [
|
|
10045
|
+
var qh = [
|
|
10046
|
+
"blazon.copy",
|
|
10047
|
+
"blazon.tailwind",
|
|
10048
|
+
"blazon.shadcn"
|
|
10049
|
+
];
|
|
10046
10050
|
function Jh(e) {
|
|
10047
10051
|
let t = JSON.parse(e);
|
|
10048
10052
|
return Array.isArray(t.plugins) && (t.plugins = t.plugins.filter((e) => qh.includes(e.name))), `${JSON.stringify(t, null, 2)}\n`;
|
|
@@ -10318,7 +10322,7 @@ function Sg(e) {
|
|
|
10318
10322
|
} : void 0;
|
|
10319
10323
|
}
|
|
10320
10324
|
function Cg(e = {
|
|
10321
|
-
commit: "
|
|
10325
|
+
commit: "f0ad5f9761a4c19a6117be58e5d35e57ed250543",
|
|
10322
10326
|
dirty: !1
|
|
10323
10327
|
}, t) {
|
|
10324
10328
|
if (e) return {
|
|
@@ -13120,35 +13124,34 @@ var _b = class {
|
|
|
13120
13124
|
for (let e of r.slice(0, mb)) t(gb(e));
|
|
13121
13125
|
r.length > mb && t(`[blazon] and ${r.length - mb} more errors; run blazon check for all of them`), n.length === 0 && this.shown.size > 0 && t("[blazon] the errors are fixed"), this.shown = new Set(n.map(hb));
|
|
13122
13126
|
}
|
|
13123
|
-
}, vb =
|
|
13127
|
+
}, vb = [
|
|
13124
13128
|
"claude-code",
|
|
13125
13129
|
"claude-desktop",
|
|
13126
13130
|
"cursor",
|
|
13127
13131
|
"vscode"
|
|
13128
|
-
];
|
|
13129
|
-
function
|
|
13130
|
-
let i = e.join(n, "mcp/dist/index.js");
|
|
13131
|
-
|
|
13132
|
-
command: "npx",
|
|
13133
|
-
args: ["-y", vb],
|
|
13134
|
-
env: {},
|
|
13135
|
-
built: !1
|
|
13136
|
-
};
|
|
13137
|
-
let a = e.join(n, "bin/blazon.js");
|
|
13138
|
-
return {
|
|
13132
|
+
], yb = (n = k()) => t.existsSync(e.join(n, "mcp/package.json")), bb = "The MCP server file mcp/dist/index.js is missing from this blazon, so the install is incomplete; reinstall it (npm install @iksnerd/blazon) and run blazon mcp --check again.", xb = "npm install @iksnerd/blazon", Sb = "mcp/dist/index.js does not exist, so this command fails until the server is built: from this blazon source checkout, run npm run build -w mcp and print the config again.";
|
|
13133
|
+
function Cb(n = k(), r = process.execPath) {
|
|
13134
|
+
let i = e.join(n, "mcp/dist/index.js"), a = e.join(n, "bin/blazon.js"), o = t.existsSync(a) ? { BLAZON_BIN: a } : {};
|
|
13135
|
+
return t.existsSync(i) ? {
|
|
13139
13136
|
command: r,
|
|
13140
13137
|
args: [i],
|
|
13141
|
-
env:
|
|
13138
|
+
env: o,
|
|
13142
13139
|
built: !0
|
|
13140
|
+
} : {
|
|
13141
|
+
command: r,
|
|
13142
|
+
args: [i],
|
|
13143
|
+
env: o,
|
|
13144
|
+
built: !1,
|
|
13145
|
+
problem: yb(n) ? Sb : bb
|
|
13143
13146
|
};
|
|
13144
13147
|
}
|
|
13145
|
-
var
|
|
13148
|
+
var wb = (e) => /^[A-Za-z0-9_@%+=:,./-]+$/.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`, Tb = {
|
|
13146
13149
|
"claude-code": "Claude Code",
|
|
13147
13150
|
"claude-desktop": "Claude Desktop",
|
|
13148
13151
|
cursor: "Cursor",
|
|
13149
13152
|
vscode: "VS Code"
|
|
13150
13153
|
};
|
|
13151
|
-
function
|
|
13154
|
+
function Eb(e, t, n) {
|
|
13152
13155
|
return {
|
|
13153
13156
|
...n && { type: "stdio" },
|
|
13154
13157
|
command: e.command,
|
|
@@ -13156,11 +13159,11 @@ function wb(e, t, n) {
|
|
|
13156
13159
|
...Object.keys(e.env).length > 0 && { env: e.env }
|
|
13157
13160
|
};
|
|
13158
13161
|
}
|
|
13159
|
-
var
|
|
13160
|
-
function
|
|
13161
|
-
let r = t.built ? void 0 :
|
|
13162
|
+
var Db = (e, t) => JSON.stringify({ [e]: { blazon: t } }, null, 2);
|
|
13163
|
+
function Ob(e, t, n) {
|
|
13164
|
+
let r = t.built ? void 0 : t.problem, i = [...t.args, ...n === void 0 ? [] : ["--brand", n]], a = {
|
|
13162
13165
|
client: e,
|
|
13163
|
-
title:
|
|
13166
|
+
title: Tb[e],
|
|
13164
13167
|
built: t.built,
|
|
13165
13168
|
...r && { note: r }
|
|
13166
13169
|
};
|
|
@@ -13179,7 +13182,7 @@ function Eb(e, t, n) {
|
|
|
13179
13182
|
"--",
|
|
13180
13183
|
t.command,
|
|
13181
13184
|
...i
|
|
13182
|
-
].map(
|
|
13185
|
+
].map(wb).join(" ");
|
|
13183
13186
|
return {
|
|
13184
13187
|
...a,
|
|
13185
13188
|
snippets: [{
|
|
@@ -13189,7 +13192,7 @@ function Eb(e, t, n) {
|
|
|
13189
13192
|
}, {
|
|
13190
13193
|
kind: "json",
|
|
13191
13194
|
label: ".mcp.json",
|
|
13192
|
-
text:
|
|
13195
|
+
text: Db("mcpServers", Eb(t, n, !1))
|
|
13193
13196
|
}]
|
|
13194
13197
|
};
|
|
13195
13198
|
}
|
|
@@ -13198,7 +13201,7 @@ function Eb(e, t, n) {
|
|
|
13198
13201
|
snippets: [{
|
|
13199
13202
|
kind: "json",
|
|
13200
13203
|
label: "claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\\Claude\\, Linux: ~/.config/Claude/)",
|
|
13201
|
-
text:
|
|
13204
|
+
text: Db("mcpServers", Eb(t, n, !1))
|
|
13202
13205
|
}]
|
|
13203
13206
|
};
|
|
13204
13207
|
case "cursor": return {
|
|
@@ -13206,13 +13209,13 @@ function Eb(e, t, n) {
|
|
|
13206
13209
|
snippets: [{
|
|
13207
13210
|
kind: "json",
|
|
13208
13211
|
label: ".cursor/mcp.json (or ~/.cursor/mcp.json for every project)",
|
|
13209
|
-
text:
|
|
13212
|
+
text: Db("mcpServers", Eb(t, n, !0))
|
|
13210
13213
|
}]
|
|
13211
13214
|
};
|
|
13212
13215
|
case "vscode": {
|
|
13213
|
-
let e = `code --add-mcp ${
|
|
13216
|
+
let e = `code --add-mcp ${wb(JSON.stringify({
|
|
13214
13217
|
name: "blazon",
|
|
13215
|
-
...
|
|
13218
|
+
...Eb(t, n, !0)
|
|
13216
13219
|
}))}`;
|
|
13217
13220
|
return {
|
|
13218
13221
|
...a,
|
|
@@ -13223,17 +13226,17 @@ function Eb(e, t, n) {
|
|
|
13223
13226
|
}, {
|
|
13224
13227
|
kind: "json",
|
|
13225
13228
|
label: ".vscode/mcp.json",
|
|
13226
|
-
text:
|
|
13229
|
+
text: Db("servers", Eb(t, n, !0))
|
|
13227
13230
|
}]
|
|
13228
13231
|
};
|
|
13229
13232
|
}
|
|
13230
13233
|
}
|
|
13231
13234
|
}
|
|
13232
|
-
function
|
|
13233
|
-
return
|
|
13235
|
+
function kb(e, t) {
|
|
13236
|
+
return vb.map((n) => Ob(n, e, t));
|
|
13234
13237
|
}
|
|
13235
|
-
var
|
|
13236
|
-
function
|
|
13238
|
+
var Ab = (e) => vb.includes(e);
|
|
13239
|
+
function jb(t, n, r, i = process.platform, a) {
|
|
13237
13240
|
let o = (t, r) => n.map((n) => ({
|
|
13238
13241
|
path: e.join(n, ...t),
|
|
13239
13242
|
serversKey: r,
|
|
@@ -13263,21 +13266,21 @@ function kb(t, n, r, i = process.platform, a) {
|
|
|
13263
13266
|
}];
|
|
13264
13267
|
}
|
|
13265
13268
|
}
|
|
13266
|
-
var
|
|
13267
|
-
function
|
|
13269
|
+
var Mb = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
13270
|
+
function Nb(e, t) {
|
|
13268
13271
|
let n;
|
|
13269
13272
|
try {
|
|
13270
13273
|
n = JSON.parse(e);
|
|
13271
13274
|
} catch {
|
|
13272
13275
|
return;
|
|
13273
13276
|
}
|
|
13274
|
-
if (!
|
|
13275
|
-
let r = (e) =>
|
|
13277
|
+
if (!Mb(n)) return;
|
|
13278
|
+
let r = (e) => Mb(e) && Mb(e[t.serversKey]) ? Object.keys(e[t.serversKey]) : [], i = Mb(n.projects) ? n.projects : {};
|
|
13276
13279
|
return [...r(n), ...(t.projects ?? []).flatMap((e) => r(i[e]))];
|
|
13277
13280
|
}
|
|
13278
13281
|
// src/server/plugin.ts
|
|
13279
|
-
var
|
|
13280
|
-
function
|
|
13282
|
+
var Pb = 75;
|
|
13283
|
+
function Fb(e) {
|
|
13281
13284
|
let t = (t, n) => {
|
|
13282
13285
|
let r = e.filter((e) => e.severity === t).length;
|
|
13283
13286
|
return r === 0 ? [] : [t === "info" ? `${r} info` : `${r} ${n}${r === 1 ? "" : "s"}`];
|
|
@@ -13288,7 +13291,7 @@ function Nb(e) {
|
|
|
13288
13291
|
];
|
|
13289
13292
|
return n.length === 0 ? "no findings" : n.join(", ");
|
|
13290
13293
|
}
|
|
13291
|
-
function
|
|
13294
|
+
function Ib(n, r = process.cwd()) {
|
|
13292
13295
|
let i = null, a = n, o = new lb(r), s = new _b(), c = [], l, u = /* @__PURE__ */ new Set(), d, f = (e) => (d ??= { value: Cg() }, {
|
|
13293
13296
|
...e,
|
|
13294
13297
|
findings: [...e.findings, ...kg(r, d.value)]
|
|
@@ -13308,7 +13311,7 @@ function Pb(n, r = process.cwd()) {
|
|
|
13308
13311
|
let t = await o.check(e, a);
|
|
13309
13312
|
if (t === void 0) return;
|
|
13310
13313
|
c = t;
|
|
13311
|
-
let r =
|
|
13314
|
+
let r = Fb(t);
|
|
13312
13315
|
r !== l && console.log(`[blazon] plugins: ${r}`), l = r;
|
|
13313
13316
|
let i = new Set(t.filter((e) => e.code === "plugin-failed").map((e) => `[blazon] ${e.path}: ${e.message}`));
|
|
13314
13317
|
for (let e of i) u.has(e) || console.error(e);
|
|
@@ -13345,7 +13348,7 @@ function Pb(n, r = process.cwd()) {
|
|
|
13345
13348
|
format: "blazon-mcp-config",
|
|
13346
13349
|
version: 1,
|
|
13347
13350
|
brand: e.resolve(r),
|
|
13348
|
-
clients:
|
|
13351
|
+
clients: kb(Cb(), e.resolve(r))
|
|
13349
13352
|
}));
|
|
13350
13353
|
}), n.middlewares.use(`/${b}/icon-sets`, Cy(() => a.iconSets ?? [], r)), n.middlewares.use(`/${b}`, yy(() => e.resolve(r, a.assetsDir), d));
|
|
13351
13354
|
let w = async (e) => {
|
|
@@ -13371,7 +13374,7 @@ function Pb(n, r = process.cwd()) {
|
|
|
13371
13374
|
}
|
|
13372
13375
|
};
|
|
13373
13376
|
zg(a, r).then((e) => s.report(f(e).findings, (e) => console.error(e)), () => void 0), o.has(a) && zg(a, r).then((e) => v(f(e)), (e) => console.error("[blazon] check plugins:", e));
|
|
13374
|
-
let T = ub(
|
|
13377
|
+
let T = ub(Pb, w, (e) => console.error("[blazon] file change:", e));
|
|
13375
13378
|
n.httpServer?.once("close", () => T.cancel());
|
|
13376
13379
|
let E = (e) => {
|
|
13377
13380
|
(h.includes(e) || e === g || e === _ || y.has(e) || m().some((t) => e.startsWith(t))) && (c = [], o.supersede(), T.add(e));
|
|
@@ -13411,43 +13414,43 @@ function Pb(n, r = process.cwd()) {
|
|
|
13411
13414
|
};
|
|
13412
13415
|
}
|
|
13413
13416
|
// src/server/editor-guard.ts
|
|
13414
|
-
var
|
|
13415
|
-
function
|
|
13417
|
+
var Lb = "/__open-in-editor";
|
|
13418
|
+
function Rb(e, t) {
|
|
13416
13419
|
t.statusCode = 404, t.setHeader("Content-Type", "text/plain"), t.end("Not found");
|
|
13417
13420
|
}
|
|
13418
|
-
var
|
|
13421
|
+
var zb = () => ({
|
|
13419
13422
|
name: "blazon-editor-launcher-guard",
|
|
13420
13423
|
configureServer(e) {
|
|
13421
|
-
e.middlewares.use(
|
|
13424
|
+
e.middlewares.use(Lb, Rb);
|
|
13422
13425
|
},
|
|
13423
13426
|
configurePreviewServer(e) {
|
|
13424
|
-
e.middlewares.use(
|
|
13427
|
+
e.middlewares.use(Lb, Rb);
|
|
13425
13428
|
}
|
|
13426
13429
|
});
|
|
13427
13430
|
// src/server/dev-server.ts
|
|
13428
|
-
function
|
|
13431
|
+
function Bb() {
|
|
13429
13432
|
let n = k(), r = e.join(n, "vite.viewer.config.ts");
|
|
13430
13433
|
return t.existsSync(e.join(n, "src/viewer/index.html")) && t.existsSync(r) ? {
|
|
13431
13434
|
kind: "source",
|
|
13432
13435
|
configFile: r
|
|
13433
13436
|
} : {
|
|
13434
13437
|
kind: "prebuilt",
|
|
13435
|
-
dir:
|
|
13438
|
+
dir: Vb()
|
|
13436
13439
|
};
|
|
13437
13440
|
}
|
|
13438
|
-
function
|
|
13441
|
+
function Vb() {
|
|
13439
13442
|
let n = e.join(k(), "dist/ui");
|
|
13440
13443
|
if (!t.existsSync(e.join(n, "index.html"))) throw Error("[blazon] No prebuilt viewer in dist/ui. Run `npm run build` first.");
|
|
13441
13444
|
return n;
|
|
13442
13445
|
}
|
|
13443
|
-
function
|
|
13446
|
+
function Hb(t) {
|
|
13444
13447
|
return {
|
|
13445
13448
|
strict: !0,
|
|
13446
13449
|
allow: [t.kind === "prebuilt" ? e.resolve(t.dir) : k()]
|
|
13447
13450
|
};
|
|
13448
13451
|
}
|
|
13449
|
-
async function
|
|
13450
|
-
let r =
|
|
13452
|
+
async function Ub(e, t = process.cwd(), n = {}) {
|
|
13453
|
+
let r = Bb(), i = await u({
|
|
13451
13454
|
...r.kind === "source" ? { configFile: r.configFile } : {
|
|
13452
13455
|
configFile: !1,
|
|
13453
13456
|
root: r.dir
|
|
@@ -13457,9 +13460,9 @@ async function Vb(e, t = process.cwd(), n = {}) {
|
|
|
13457
13460
|
strictPort: n.strictPort ?? !1,
|
|
13458
13461
|
host: n.host ?? "localhost",
|
|
13459
13462
|
open: !1,
|
|
13460
|
-
fs:
|
|
13463
|
+
fs: Hb(r)
|
|
13461
13464
|
},
|
|
13462
|
-
plugins: [
|
|
13465
|
+
plugins: [zb(), Ib(e, t)],
|
|
13463
13466
|
optimizeDeps: { include: [] }
|
|
13464
13467
|
});
|
|
13465
13468
|
await i.listen();
|
|
@@ -13469,15 +13472,15 @@ async function Vb(e, t = process.cwd(), n = {}) {
|
|
|
13469
13472
|
return console.log(` ${$.dim("➜")} ${$.bold("Tokens:")} ${$.dim(e.tokensDir)}`), console.log(` ${$.dim("➜")} ${$.bold("Docs:")} ${$.dim(e.docsDir)}`), console.log(` ${$.dim("➜")} ${$.bold("Assets:")} ${$.dim(e.assetsDir)}\n`), i;
|
|
13470
13473
|
}
|
|
13471
13474
|
// src/builder/site-builder.ts
|
|
13472
|
-
async function
|
|
13475
|
+
async function Wb(n, r = process.cwd(), i = {}) {
|
|
13473
13476
|
console.log(d.cyan("\n[blazon] Compiling brand book & design tokens..."));
|
|
13474
13477
|
let a = i.data ?? await zg(n, r), o = e.resolve(r, n.outDir);
|
|
13475
13478
|
Ig(a, n, r, i), t.rmSync(o, {
|
|
13476
13479
|
recursive: !0,
|
|
13477
13480
|
force: !0
|
|
13478
|
-
}), t.cpSync(
|
|
13481
|
+
}), t.cpSync(Vb(), o, { recursive: !0 });
|
|
13479
13482
|
let s = e.join(o, "index.html");
|
|
13480
|
-
t.writeFileSync(s, Ey(t.readFileSync(s, "utf-8"), a)),
|
|
13483
|
+
t.writeFileSync(s, Ey(t.readFileSync(s, "utf-8"), a)), Gb(a, e.resolve(r, n.assetsDir), e.join(o, b), Pd(n.assets, r)), Kb(a, n, r, e.join(o, b, "icon-sets")), t.writeFileSync(e.join(o, "brand.json"), Zg(a, n, r)), t.writeFileSync(e.join(o, Ug), Wg()), console.log(` ${d.green("✔")} Wrote ${d.bold(e.join(o, "brand.json"))}`), console.log(` ${d.green("✔")} Built static brand book site to ${d.bold(o)}`);
|
|
13481
13484
|
let c = await Lg(a, n, r, i);
|
|
13482
13485
|
return console.log(` ${d.green("✔")} Emitted ${d.bold(c.cssPath)}`), console.log(` ${d.green("✔")} Emitted ${d.bold(c.tsPath)}`), console.log(` ${d.green("✔")} Emitted ${d.bold(c.jsonPath)}\n`), {
|
|
13483
13486
|
data: a,
|
|
@@ -13485,13 +13488,13 @@ async function Hb(n, r = process.cwd(), i = {}) {
|
|
|
13485
13488
|
tokensOutDir: e.resolve(r, n.tokensOutDir)
|
|
13486
13489
|
};
|
|
13487
13490
|
}
|
|
13488
|
-
function
|
|
13491
|
+
function Gb(n, r, i, a) {
|
|
13489
13492
|
for (let o of n.assets.all) {
|
|
13490
13493
|
let n = e.join(i, o.filePath);
|
|
13491
13494
|
t.mkdirSync(e.dirname(n), { recursive: !0 }), t.copyFileSync(Fd(o, r, a), n);
|
|
13492
13495
|
}
|
|
13493
13496
|
}
|
|
13494
|
-
function
|
|
13497
|
+
function Kb(n, r, i, a) {
|
|
13495
13498
|
for (let o of n.iconSets) {
|
|
13496
13499
|
let n = r.iconSets?.find((e) => e.name === o.name), s = n && rf(n, i);
|
|
13497
13500
|
if (!s) throw Error(`[blazon] icon set "${o.name}": its package ${n ? `"${n.package}" ` : ""}is no longer where it was read from, so its icons cannot be copied into the site`);
|
|
@@ -13499,4 +13502,4 @@ function Wb(n, r, i, a) {
|
|
|
13499
13502
|
for (let n of o.categories.flatMap((e) => e.icons)) t.copyFileSync(e.join(s, `${n}.svg`), e.join(a, o.name, `${n}.svg`));
|
|
13500
13503
|
}
|
|
13501
13504
|
}
|
|
13502
|
-
export {
|
|
13505
|
+
export { I_ as $, st as $t, my as A, Oh as At, Y_ as B, Fd as Bt, jy as C, y as Cn, Xh as Ct, py as D, m as Dn, Fh as Dt, $ as E, h as En, Ph as Et, Wv as F, fh as Ft, dv as G, Ul as Gt, pv as H, Zu as Ht, Rv as I, ah as It, R_ as J, Kt as Jt, ov as K, Ql as Kt, Vv as L, rh as Lt, Q as M, ih as Mt, cy as N, oh as Nt, fy as O, p as On, Ah as Ot, Qv as P, uh as Pt, L_ as Q, ct as Qt, mv as R, sf as Rt, My as S, v as Sn, hg as St, _y as T, g as Tn, Vh as Tt, $_ as U, tu as Ut, J_ as V, Pd as Vt, X_ as W, eu as Wt, Z as X, It as Xt, z_ as Y, Ut as Yt, F_ as Z, xt as Zt, db as _, w as _n, Cg as _t, zb as a, be as an, i_ as at, cb as b, S as bn, vg as bt, vb as c, pe as cn, Gg as ct, Ab as d, ce as dn, Zg as dt, ft as en, S_ as et, yb as f, k as fn, Hg as ft, pb as g, E as gn, yg as gt, Cb as h, ie as hn, Lg as ht, Ub as i, it as in, o_ as it, oy as j, Ch as jt, gy as k, jh as kt, xb as l, me as ln, Kg as lt, Nb as m, re as mn, zg as mt, Vb as n, we as nn, C_ as nt, Ib as o, xe as on, $g as ot, jb as p, O as pn, Ug as pt, G_ as q, Gt as qt, Bb as r, at as rn, a_ as rt, bb as s, _e as sn, Qg as st, Wb as t, pt as tn, w_ as tt, Ob as u, ye as un, Xg as ut, fb as v, b as vn, kg as vt, vy as w, _ as wn, Kh as wt, Ly as x, x as xn, gg as xt, sb as y, C as yn, Ag as yt, Dv as z, uf as zt };
|
|
@@ -15,7 +15,7 @@ export interface McpCheck {
|
|
|
15
15
|
}
|
|
16
16
|
/** The tool names the server must list: every operation that has a tool. */
|
|
17
17
|
export declare const expectedTools: () => string[];
|
|
18
|
-
/** (a) The server is
|
|
18
|
+
/** (a) The server is there: `mcp/dist/index.js` exists in this blazon's package (an install ships it; a source checkout builds it). */
|
|
19
19
|
export declare function checkBuilt(root: string): McpCheck & {
|
|
20
20
|
entry: string;
|
|
21
21
|
};
|
|
@@ -51,6 +51,8 @@ export interface McpCheckOptions {
|
|
|
51
51
|
env?: NodeJS.ProcessEnv;
|
|
52
52
|
home?: string;
|
|
53
53
|
timeoutMs?: number;
|
|
54
|
+
/** blazon's package root; tests give another. */
|
|
55
|
+
root?: string;
|
|
54
56
|
}
|
|
55
57
|
/** `blazon mcp --check`: runs the four checks, prints the answer, and returns the exit status: 0 when the server is ready, 1 when not. Writes no file. */
|
|
56
58
|
export declare function runMcpCheck(options: McpCheckOptions): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp-check.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"mcp-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp-check.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmF,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAK3I,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,0MAA0M;AAC1M,eAAO,MAAM,YAAY,0PACgO,CAAC;AAE1P,4FAA4F;AAC5F,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAC;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAQD,4EAA4E;AAC5E,eAAO,MAAM,aAAa,QAAO,MAAM,EAAqD,CAAC;AAE7F,uIAAuI;AACvI,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAOrE;AAoBD,iLAAiL;AACjL,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAkBzF;AAED,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAkBD;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuG5E;AA2BD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,SAAe,GAAG,QAAQ,CAiClH;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,0JAA0J;AAC1J,wBAAsB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAgC3E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `blazon mcp --print-config [--client c] [--brand dir]`: prints what registers blazon-mcp (stdio) in a client. Writes no file.
|
|
3
3
|
* `blazon mcp --check [--client c] [--brand dir]`: says whether the server is built, can find blazon, answers a real MCP handshake and is registered.
|
|
4
|
-
* Exits 0, or 2 for an unknown client, both flags or neither. `--check` exits 1 when the server is not ready.
|
|
4
|
+
* Exits 0, or 2 for an unknown client, both flags or neither. `--check` exits 1 when the server is not ready; `--print-config` exits 1 when an install has lost its server file, because there is no command that works.
|
|
5
5
|
*/
|
|
6
6
|
export declare function runMcp(options?: {
|
|
7
7
|
printConfig?: boolean;
|
|
@@ -9,5 +9,6 @@ export declare function runMcp(options?: {
|
|
|
9
9
|
client?: string;
|
|
10
10
|
brand?: string;
|
|
11
11
|
json?: boolean;
|
|
12
|
+
root?: string;
|
|
12
13
|
}): Promise<number>;
|
|
13
14
|
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAkCtK"}
|