@ls.graphics/connect 0.1.0 → 0.1.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 +5 -2
- package/dist/ls-graphics-connect.mjs +237 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -84,8 +84,11 @@ pnpm --filter @ls.graphics/connect test
|
|
|
84
84
|
pnpm --filter @ls.graphics/connect build # dist/ls-graphics-connect.mjs, one file, no runtime dependencies
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
The build fails if the bundle contains `AIza` (a Google/Firebase API key). The
|
|
88
|
-
`src/banner.ts`; the wizard makes no network call for it.
|
|
87
|
+
The build fails if the bundle contains `AIza` (a Google/Firebase API key). The banner (a card with the square-pixel
|
|
88
|
+
wordmark and the Pro line) is plain text in `src/banner.ts`; the wizard makes no network call for it. It sweeps in for ~1.3 s only on
|
|
89
|
+
a colour terminal that is wide enough (75+ columns), outside CI, with NO_COLOR unset; `--no-animation` or `LSG_NO_ANIMATION=1` prints it
|
|
90
|
+
settled. With NO_COLOR it is drawn in inverse video (no colour) and not animated; narrower than the card it is a one-line mark. The
|
|
91
|
+
cursor is hidden only during the sweep and restored on every exit path (end, error, Ctrl+C, SIGTERM).
|
|
89
92
|
|
|
90
93
|
## Publishing (the owner)
|
|
91
94
|
|
|
@@ -165,7 +165,7 @@ var ALIASES = {
|
|
|
165
165
|
};
|
|
166
166
|
var CLIENT_IDS = CLIENTS.map((c3) => c3.id);
|
|
167
167
|
function parseArgs(argv) {
|
|
168
|
-
const args2 = { yes: false, clients: null, skill: null, noSkill: false, helper: false, dryRun: false, help: false, version: false, errors: [] };
|
|
168
|
+
const args2 = { yes: false, clients: null, skill: null, noSkill: false, helper: false, dryRun: false, noAnimation: false, help: false, version: false, errors: [] };
|
|
169
169
|
const takeValue = (i2, flag, inline) => {
|
|
170
170
|
if (inline !== void 0) return [inline, i2];
|
|
171
171
|
const next = argv[i2 + 1];
|
|
@@ -222,6 +222,9 @@ function parseArgs(argv) {
|
|
|
222
222
|
case "--dry-run":
|
|
223
223
|
args2.dryRun = true;
|
|
224
224
|
break;
|
|
225
|
+
case "--no-animation":
|
|
226
|
+
args2.noAnimation = true;
|
|
227
|
+
break;
|
|
225
228
|
case "--help":
|
|
226
229
|
case "-h":
|
|
227
230
|
args2.help = true;
|
|
@@ -246,6 +249,7 @@ Usage: npx -y @ls.graphics/connect@latest [options]
|
|
|
246
249
|
--no-skill do not install the skill
|
|
247
250
|
--helper also offer to render on this computer (not public yet)
|
|
248
251
|
--dry-run show what would change, write nothing
|
|
252
|
+
--no-animation print the banner at once (also LSG_NO_ANIMATION=1; it never animates in CI or with NO_COLOR)
|
|
249
253
|
-h, --help this text
|
|
250
254
|
-v, --version the version
|
|
251
255
|
|
|
@@ -253,6 +257,217 @@ Claude Desktop is set up in the app (Settings \u2192 Connectors); claude-desktop
|
|
|
253
257
|
The server is https://mcp.ls.graphics/mcp. You sign in inside each tool on the first render; this wizard asks for no key.
|
|
254
258
|
`;
|
|
255
259
|
|
|
260
|
+
// src/banner.ts
|
|
261
|
+
var TAG = "Mockups for your AI assistant";
|
|
262
|
+
var PRO_URL = "ls.graphics/unlimited-access";
|
|
263
|
+
var PRO_TEXT = "Subscribe to Pro";
|
|
264
|
+
function colorLevel(env, tty) {
|
|
265
|
+
if (!tty || env.TERM === "dumb") return "plain";
|
|
266
|
+
if (env.NO_COLOR) return "mono";
|
|
267
|
+
const force = env.FORCE_COLOR;
|
|
268
|
+
if (force === "0" || force === "false") return "mono";
|
|
269
|
+
if (force === "3" || env.COLORTERM === "truecolor" || env.COLORTERM === "24bit") return "truecolor";
|
|
270
|
+
return "256";
|
|
271
|
+
}
|
|
272
|
+
function shouldAnimate(options) {
|
|
273
|
+
const { env, level, columns, rows, noAnimation } = options;
|
|
274
|
+
if (level !== "truecolor" && level !== "256") return false;
|
|
275
|
+
if (noAnimation || env.CI || env.LSG_NO_ANIMATION && env.LSG_NO_ANIMATION !== "0") return false;
|
|
276
|
+
return fitsCard(columns) && rows >= CARD_HEIGHT + 2;
|
|
277
|
+
}
|
|
278
|
+
var AMBER = [245, 197, 66];
|
|
279
|
+
var ORANGE = [240, 138, 36];
|
|
280
|
+
var RED = [226, 50, 31];
|
|
281
|
+
var COBALT = [44, 75, 216];
|
|
282
|
+
var DUST = [120, 120, 120];
|
|
283
|
+
var FONT = {
|
|
284
|
+
l: ["#.", "#.", "#.", "#.", "#.", "#.", "##", ".."],
|
|
285
|
+
s: ["...", "...", "###", "#..", "###", "..#", "###", "..."],
|
|
286
|
+
".": [".", ".", ".", ".", ".", ".", "#", "."],
|
|
287
|
+
g: ["...", "...", "###", "#.#", "#.#", "###", "..#", "##."],
|
|
288
|
+
r: ["...", "...", "##.", "#.#", "#..", "#..", "#..", "..."],
|
|
289
|
+
a: ["...", "...", "###", "..#", "###", "#.#", "###", "..."],
|
|
290
|
+
p: ["...", "...", "###", "#.#", "#.#", "###", "#..", "#.."],
|
|
291
|
+
h: ["#..", "#..", "##.", "#.#", "#.#", "#.#", "#.#", "..."],
|
|
292
|
+
i: ["#", ".", "#", "#", "#", "#", "#", "."],
|
|
293
|
+
c: ["...", "...", ".##", "#..", "#..", "#..", ".##", "..."]
|
|
294
|
+
};
|
|
295
|
+
var WORD = "ls.graphics";
|
|
296
|
+
function buildCells() {
|
|
297
|
+
const letters = [...WORD];
|
|
298
|
+
const cols = [];
|
|
299
|
+
letters.forEach((ch, k) => {
|
|
300
|
+
const g = FONT[ch];
|
|
301
|
+
const H = g.length;
|
|
302
|
+
const W2 = g[0].length;
|
|
303
|
+
const on = (x, y) => x >= 0 && y >= 0 && x < W2 && y < H && g[y][x] === "#";
|
|
304
|
+
const run = (x, y, dx, dy) => {
|
|
305
|
+
let c3 = 0;
|
|
306
|
+
while (on(x + dx * c3, y + dy * c3)) c3++;
|
|
307
|
+
return c3;
|
|
308
|
+
};
|
|
309
|
+
const sub = Array.from({ length: H * 2 }, () => Array(W2 * 2).fill(false));
|
|
310
|
+
for (let y = 0; y < H; y++)
|
|
311
|
+
for (let x = 0; x < W2; x++) {
|
|
312
|
+
if (!on(x, y)) continue;
|
|
313
|
+
for (let a2 = 0; a2 < 2; a2++) for (let b = 0; b < 2; b++) sub[2 * y + b][2 * x + a2] = true;
|
|
314
|
+
const hr = run(x, y, -1, 0) + run(x, y, 1, 0) - 1;
|
|
315
|
+
const vr = run(x, y, 0, -1) + run(x, y, 0, 1) - 1;
|
|
316
|
+
if (hr < 2 || vr < 2) continue;
|
|
317
|
+
for (const dx of [-1, 1]) for (const dy of [-1, 1]) if (!on(x + dx, y) && !on(x, y + dy)) sub[2 * y + (dy < 0 ? 0 : 1)][2 * x + (dx < 0 ? 0 : 1)] = false;
|
|
318
|
+
}
|
|
319
|
+
for (let x = 0; x < W2 * 2; x++) cols.push({ dot: ch === ".", c: sub.map((r2) => r2[x]) });
|
|
320
|
+
if (k < letters.length - 1) cols.push({ dot: false, c: Array(H * 2).fill(false) });
|
|
321
|
+
});
|
|
322
|
+
const rows = Array.from({ length: FONT.l.length }, () => []);
|
|
323
|
+
cols.forEach((col, i2) => {
|
|
324
|
+
for (let r2 = 0; r2 < rows.length; r2++) {
|
|
325
|
+
const h2 = (col.c[2 * r2] ? 1 : 0) | (col.c[2 * r2 + 1] ? 2 : 0);
|
|
326
|
+
rows[r2].push({ i: i2, on: h2 > 0, dot: col.dot, h: h2 });
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
return rows;
|
|
330
|
+
}
|
|
331
|
+
var CELLS = buildCells();
|
|
332
|
+
var WORD_COLUMNS = CELLS[0].length;
|
|
333
|
+
var ESC = "\x1B[";
|
|
334
|
+
var RESET = `${ESC}0m`;
|
|
335
|
+
var BOLD = `${ESC}1m`;
|
|
336
|
+
var GREY = `${ESC}38;5;245m`;
|
|
337
|
+
var INV = `${ESC}7m`;
|
|
338
|
+
var INV_OFF = `${ESC}27m`;
|
|
339
|
+
var SHOW_CURSOR = `${ESC}?25h`;
|
|
340
|
+
var HIDE_CURSOR = `${ESC}?25l`;
|
|
341
|
+
var mix = (a2, b, t2) => [0, 1, 2].map((n3) => Math.round(a2[n3] + (b[n3] - a2[n3]) * t2));
|
|
342
|
+
var to256 = ([r2, g, b]) => {
|
|
343
|
+
const c3 = (v) => v < 48 ? 0 : v < 115 ? 1 : Math.floor((v - 35) / 40);
|
|
344
|
+
return 16 + 36 * c3(r2) + 6 * c3(g) + c3(b);
|
|
345
|
+
};
|
|
346
|
+
var strip = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
|
|
347
|
+
function hash(a2, b) {
|
|
348
|
+
let h2 = a2 * 374761393 + b * 668265263 >>> 0;
|
|
349
|
+
h2 = Math.imul(h2 ^ h2 >>> 13, 1274126177) >>> 0;
|
|
350
|
+
return ((h2 ^ h2 >>> 16) >>> 0) / 4294967296;
|
|
351
|
+
}
|
|
352
|
+
function painter(level) {
|
|
353
|
+
const fg = (rgb) => level === "truecolor" ? `${ESC}38;2;${rgb.join(";")}m` : level === "256" ? `${ESC}38;5;${to256(rgb)}m` : "";
|
|
354
|
+
const bg = (rgb) => level === "truecolor" ? `${ESC}48;2;${rgb.join(";")}m` : `${ESC}48;5;${to256(rgb)}m`;
|
|
355
|
+
const colour = level === "truecolor" || level === "256";
|
|
356
|
+
return {
|
|
357
|
+
fg,
|
|
358
|
+
colour,
|
|
359
|
+
solid: (rgb) => rgb && colour ? `${bg(rgb)} ${ESC}49m` : `${INV} ${INV_OFF}`,
|
|
360
|
+
// Inverse video swaps the glyph and the cell: the cell background is the ink and the half glyph is the paper, so the whole cell
|
|
361
|
+
// (including the line spacing) is painted. In truecolor/256 the ink is the foreground colour that the inverse turns into a background.
|
|
362
|
+
half: (h2, rgb) => h2 === 3 ? rgb && colour ? `${bg(rgb)} ${ESC}49m` : `${INV} ${INV_OFF}` : `${INV}${rgb && colour ? fg(rgb) : ""}${h2 === 1 ? "\u2584" : "\u2580"}${RESET}`
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
var CARD_WIDTH = 72;
|
|
366
|
+
var CARD_HEIGHT = 20;
|
|
367
|
+
var BANNER_WIDTH = CARD_WIDTH + 2;
|
|
368
|
+
var fitsCard = (columns) => columns > BANNER_WIDTH;
|
|
369
|
+
var BAND = 6;
|
|
370
|
+
var SWEEP_FROM = -6;
|
|
371
|
+
var SWEEP_TO = WORD_COLUMNS + 12;
|
|
372
|
+
var SWEEP_MS = 1300;
|
|
373
|
+
function cardLines(version, level, k = null) {
|
|
374
|
+
const p = painter(level);
|
|
375
|
+
const styled = p.colour;
|
|
376
|
+
const wordRows = CELLS.map(
|
|
377
|
+
(row, r2) => row.map((t2) => {
|
|
378
|
+
const paint = (rgb) => t2.h && t2.h !== 3 ? p.half(t2.h, rgb) : p.solid(rgb);
|
|
379
|
+
const final = !t2.on ? " " : t2.dot && styled ? paint(RED) : paint(null);
|
|
380
|
+
if (k === null) return final;
|
|
381
|
+
const e = t2.i + Math.round((hash(r2, t2.i) - 0.5) * 6);
|
|
382
|
+
if (e < k - BAND) return final;
|
|
383
|
+
if (e <= k) {
|
|
384
|
+
if (!t2.on) return " ";
|
|
385
|
+
const f = (k - e) / BAND;
|
|
386
|
+
if (hash(t2.i + 91, r2 + 7) < 0.08) return paint(COBALT);
|
|
387
|
+
return paint(f < 0.5 ? mix(AMBER, ORANGE, f * 2) : mix(ORANGE, RED, (f - 0.5) * 2));
|
|
388
|
+
}
|
|
389
|
+
if (e < k + 9 && hash(r2 + 31, t2.i + 3) < 0.09) return `${p.fg(DUST)}\xB7${RESET}`;
|
|
390
|
+
return " ";
|
|
391
|
+
}).join("")
|
|
392
|
+
);
|
|
393
|
+
const bold = (s) => styled ? `${BOLD}${s}${RESET}` : s;
|
|
394
|
+
const grey = (s) => styled ? `${GREY}${s}${RESET}` : s;
|
|
395
|
+
const diamond = styled ? `${p.fg(ORANGE)}\u25C7${RESET}` : "\u25C7";
|
|
396
|
+
const arrow = styled ? `${p.fg(RED)}\u2192${RESET}` : "\u2192";
|
|
397
|
+
const inner = [
|
|
398
|
+
"",
|
|
399
|
+
...wordRows.map((r2) => ` ${r2}`),
|
|
400
|
+
"",
|
|
401
|
+
` ${bold("connect")} ${grey(`v${version} \xB7 ${TAG}`)}`,
|
|
402
|
+
"",
|
|
403
|
+
` ${diamond} Find your AI apps (Claude, Cursor, Codex, ChatGPT \u2026)`,
|
|
404
|
+
` ${diamond} Add the ls.graphics MCP server to the ones you pick`,
|
|
405
|
+
` ${diamond} Install the mockup skill, then sign in`,
|
|
406
|
+
"",
|
|
407
|
+
` ${arrow} ${bold(PRO_TEXT)} ${grey(PRO_URL)}`,
|
|
408
|
+
""
|
|
409
|
+
];
|
|
410
|
+
const pad = (s) => s + " ".repeat(Math.max(0, CARD_WIDTH - 2 - strip(s).length));
|
|
411
|
+
return [` \u256D${"\u2500".repeat(CARD_WIDTH - 2)}\u256E`, ...inner.map((l) => ` \u2502${pad(l)}\u2502`), ` \u2570${"\u2500".repeat(CARD_WIDTH - 2)}\u256F`];
|
|
412
|
+
}
|
|
413
|
+
function compactLines(version, level) {
|
|
414
|
+
if (level === "plain" || level === "mono") return [`ls.graphics connect v${version} \xB7 ${TAG}`, `\u2192 ${PRO_TEXT} ${PRO_URL}`];
|
|
415
|
+
return [`${INV} ls ${INV_OFF} ${BOLD}ls.graphics${RESET} ${GREY}connect v${version} \xB7 ${TAG}${RESET}`, `${painter(level).fg(RED)}\u2192${RESET} ${BOLD}${PRO_TEXT}${RESET} ${GREY}${PRO_URL}${RESET}`];
|
|
416
|
+
}
|
|
417
|
+
function staticBanner({ version, columns, level }) {
|
|
418
|
+
const lines = level === "plain" || !fitsCard(columns) ? compactLines(version, level) : cardLines(version, level);
|
|
419
|
+
return lines.join("\n");
|
|
420
|
+
}
|
|
421
|
+
async function playBanner(plan, options) {
|
|
422
|
+
const { write } = options;
|
|
423
|
+
if (!plan.animate || plan.level === "plain" || plan.level === "mono" || !fitsCard(plan.columns)) {
|
|
424
|
+
write(`${staticBanner(plan)}
|
|
425
|
+
|
|
426
|
+
`);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
const proc = options.proc ?? process;
|
|
430
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
431
|
+
const now = options.now ?? Date.now;
|
|
432
|
+
const height = cardLines(plan.version, plan.level, null).length;
|
|
433
|
+
const restore = () => write(SHOW_CURSOR);
|
|
434
|
+
const onInt = () => {
|
|
435
|
+
restore();
|
|
436
|
+
proc.exit(130);
|
|
437
|
+
};
|
|
438
|
+
const onTerm = () => {
|
|
439
|
+
restore();
|
|
440
|
+
proc.exit(143);
|
|
441
|
+
};
|
|
442
|
+
proc.on("SIGINT", onInt);
|
|
443
|
+
proc.on("SIGTERM", onTerm);
|
|
444
|
+
proc.on("exit", restore);
|
|
445
|
+
try {
|
|
446
|
+
write(HIDE_CURSOR + cardLines(plan.version, plan.level, SWEEP_FROM - 6).join("\n") + "\n");
|
|
447
|
+
const start = now();
|
|
448
|
+
let last = SWEEP_FROM - 6;
|
|
449
|
+
for (; ; ) {
|
|
450
|
+
const progress = Math.min(1, (now() - start) / SWEEP_MS);
|
|
451
|
+
const k = Math.round(SWEEP_FROM + (SWEEP_TO - SWEEP_FROM) * progress);
|
|
452
|
+
if (k !== last) {
|
|
453
|
+
last = k;
|
|
454
|
+
write(`${ESC}${height}A${cardLines(plan.version, plan.level, k).join("\n")}
|
|
455
|
+
`);
|
|
456
|
+
}
|
|
457
|
+
if (progress >= 1) break;
|
|
458
|
+
await sleep(16);
|
|
459
|
+
}
|
|
460
|
+
write(`${ESC}${height}A${cardLines(plan.version, plan.level, null).join("\n")}
|
|
461
|
+
|
|
462
|
+
`);
|
|
463
|
+
} finally {
|
|
464
|
+
restore();
|
|
465
|
+
proc.off("SIGINT", onInt);
|
|
466
|
+
proc.off("SIGTERM", onTerm);
|
|
467
|
+
proc.off("exit", restore);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
256
471
|
// src/spawn.ts
|
|
257
472
|
import { execFile, spawn } from "node:child_process";
|
|
258
473
|
var SAFE_ARG = /^[A-Za-z0-9_.:/@=+,-]+$/;
|
|
@@ -431,7 +646,7 @@ var fastStringWidth = (input, options = {}) => {
|
|
|
431
646
|
var dist_default2 = fastStringWidth;
|
|
432
647
|
|
|
433
648
|
// ../../node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
434
|
-
var
|
|
649
|
+
var ESC2 = "\x1B";
|
|
435
650
|
var CSI = "\x9B";
|
|
436
651
|
var END_CODE = 39;
|
|
437
652
|
var ANSI_ESCAPE_BELL = "\x07";
|
|
@@ -465,8 +680,8 @@ var getClosingCode = (openingCode) => {
|
|
|
465
680
|
return 0;
|
|
466
681
|
return void 0;
|
|
467
682
|
};
|
|
468
|
-
var wrapAnsiCode = (code) => `${
|
|
469
|
-
var wrapAnsiHyperlink = (url) => `${
|
|
683
|
+
var wrapAnsiCode = (code) => `${ESC2}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
684
|
+
var wrapAnsiHyperlink = (url) => `${ESC2}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
470
685
|
var wrapWord = (rows, word, columns) => {
|
|
471
686
|
const characters = word[Symbol.iterator]();
|
|
472
687
|
let isInsideEscape = false;
|
|
@@ -485,7 +700,7 @@ var wrapWord = (rows, word, columns) => {
|
|
|
485
700
|
rows.push(character);
|
|
486
701
|
visible = 0;
|
|
487
702
|
}
|
|
488
|
-
if (character ===
|
|
703
|
+
if (character === ESC2 || character === CSI) {
|
|
489
704
|
isInsideEscape = true;
|
|
490
705
|
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
491
706
|
}
|
|
@@ -603,7 +818,7 @@ var exec = (string, columns, options = {}) => {
|
|
|
603
818
|
} else {
|
|
604
819
|
inSurrogate = false;
|
|
605
820
|
}
|
|
606
|
-
if (character ===
|
|
821
|
+
if (character === ESC2 || character === CSI) {
|
|
607
822
|
GROUP_REGEX.lastIndex = i2 + 1;
|
|
608
823
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
609
824
|
const groups = groupsResult?.groups;
|
|
@@ -639,8 +854,8 @@ function wrapAnsi(string, columns, options) {
|
|
|
639
854
|
}
|
|
640
855
|
|
|
641
856
|
// ../../node_modules/.pnpm/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
|
|
642
|
-
var
|
|
643
|
-
var CSI2 = `${
|
|
857
|
+
var ESC3 = "\x1B";
|
|
858
|
+
var CSI2 = `${ESC3}[`;
|
|
644
859
|
var cursor = {
|
|
645
860
|
to(x, y) {
|
|
646
861
|
if (!y)
|
|
@@ -668,8 +883,8 @@ var cursor = {
|
|
|
668
883
|
left: `${CSI2}G`,
|
|
669
884
|
hide: `${CSI2}?25l`,
|
|
670
885
|
show: `${CSI2}?25h`,
|
|
671
|
-
save: `${
|
|
672
|
-
restore: `${
|
|
886
|
+
save: `${ESC3}7`,
|
|
887
|
+
restore: `${ESC3}8`
|
|
673
888
|
};
|
|
674
889
|
var erase = {
|
|
675
890
|
screen: `${CSI2}2J`,
|
|
@@ -688,7 +903,7 @@ var erase = {
|
|
|
688
903
|
}
|
|
689
904
|
};
|
|
690
905
|
var clear = {
|
|
691
|
-
screen: `${
|
|
906
|
+
screen: `${ESC3}c`
|
|
692
907
|
};
|
|
693
908
|
|
|
694
909
|
// ../../node_modules/.pnpm/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
|
|
@@ -1670,8 +1885,7 @@ var CANCELLED = Symbol("cancelled");
|
|
|
1670
1885
|
function clackUi(write = (text) => void process.stdout.write(text)) {
|
|
1671
1886
|
return {
|
|
1672
1887
|
interactive: true,
|
|
1673
|
-
|
|
1674
|
-
`),
|
|
1888
|
+
banner: (plan) => playBanner(plan, { write: (text) => write(text) }),
|
|
1675
1889
|
intro: (title) => intro(title),
|
|
1676
1890
|
outro: (message) => outro(message),
|
|
1677
1891
|
step: (message) => log.step(message),
|
|
@@ -1702,7 +1916,7 @@ function plainUi(write = (line) => void process.stdout.write(`${line}
|
|
|
1702
1916
|
`)) {
|
|
1703
1917
|
return {
|
|
1704
1918
|
interactive: false,
|
|
1705
|
-
|
|
1919
|
+
banner: async () => write("ls.graphics connect"),
|
|
1706
1920
|
intro: (title) => write(title),
|
|
1707
1921
|
outro: (message) => write(message),
|
|
1708
1922
|
step: (message) => write(message),
|
|
@@ -4326,41 +4540,6 @@ async function setupClient(def, env, options) {
|
|
|
4326
4540
|
}
|
|
4327
4541
|
}
|
|
4328
4542
|
|
|
4329
|
-
// src/banner.ts
|
|
4330
|
-
var GLYPHS = {
|
|
4331
|
-
l: ["\u2588\u2588 ", "\u2588\u2588 ", "\u2588\u2588 ", "\u2588\u2588 ", "\u2588\u2588\u2588"],
|
|
4332
|
-
s: ["\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 ", "\u2588\u2588\u2588\u2588\u2588", " \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588"],
|
|
4333
|
-
".": [" ", " ", " ", "\u2588\u2588", "\u2588\u2588"],
|
|
4334
|
-
g: ["\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 ", "\u2588\u2588 \u2588\u2588", "\u2588\u2588 \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588"],
|
|
4335
|
-
r: ["\u2588\u2588\u2588\u2588 ", "\u2588\u2588 \u2588\u2588", "\u2588\u2588\u2588\u2588 ", "\u2588\u2588 \u2588\u2588", "\u2588\u2588 \u2588\u2588"],
|
|
4336
|
-
a: ["\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 \u2588\u2588", "\u2588\u2588 \u2588\u2588"],
|
|
4337
|
-
p: ["\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 ", "\u2588\u2588 "],
|
|
4338
|
-
h: ["\u2588\u2588 \u2588\u2588", "\u2588\u2588 \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 \u2588\u2588", "\u2588\u2588 \u2588\u2588"],
|
|
4339
|
-
i: ["\u2588\u2588\u2588\u2588", " \u2588\u2588 ", " \u2588\u2588 ", " \u2588\u2588 ", "\u2588\u2588\u2588\u2588"],
|
|
4340
|
-
c: ["\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 ", "\u2588\u2588 ", "\u2588\u2588 ", "\u2588\u2588\u2588\u2588\u2588"]
|
|
4341
|
-
};
|
|
4342
|
-
var WORD = "ls.graphics";
|
|
4343
|
-
var GREYS = [251, 248, 245, 242, 239];
|
|
4344
|
-
function wordmarkRows() {
|
|
4345
|
-
return Array.from({ length: 5 }, (_, row) => [...WORD].map((ch) => GLYPHS[ch][row]).join(" "));
|
|
4346
|
-
}
|
|
4347
|
-
var WORDMARK_WIDTH = wordmarkRows()[0].length;
|
|
4348
|
-
function banner({ columns, tty, color }) {
|
|
4349
|
-
if (!tty || columns < WORDMARK_WIDTH + 4) return WORD;
|
|
4350
|
-
const rows = wordmarkRows().map((row) => ` ${row.trimEnd()}`);
|
|
4351
|
-
if (!color) return rows.join("\n");
|
|
4352
|
-
return rows.map((row, i2) => `\x1B[38;5;${GREYS[i2]}m${row}\x1B[39m`).join("\n");
|
|
4353
|
-
}
|
|
4354
|
-
var PRO_LINE = "ls.graphics Pro \u2014 full size without the watermark, video and 3d Studio";
|
|
4355
|
-
var PRO_URL = "ls.graphics/unlimited-access";
|
|
4356
|
-
function proNotice(color) {
|
|
4357
|
-
if (!color) return `| \u25C6 ${PRO_LINE}
|
|
4358
|
-
| \u2192 ${PRO_URL}`;
|
|
4359
|
-
const bar = "\x1B[38;5;33m\u2502\x1B[39m";
|
|
4360
|
-
return `${bar} \x1B[38;5;154m\u25C6\x1B[39m ${PRO_LINE}
|
|
4361
|
-
${bar} \x1B[38;5;245m\u2192 ${PRO_URL}\x1B[39m`;
|
|
4362
|
-
}
|
|
4363
|
-
|
|
4364
4543
|
// src/helper.ts
|
|
4365
4544
|
var HELPER_VERSION = "0.2.1";
|
|
4366
4545
|
var HELPER_PACKAGE = `@ls.graphics/mcp-local@${HELPER_VERSION}`;
|
|
@@ -4611,10 +4790,7 @@ async function runWizard(args2, deps) {
|
|
|
4611
4790
|
ui.outro("Cancelled. Nothing more was changed.");
|
|
4612
4791
|
return 1;
|
|
4613
4792
|
};
|
|
4614
|
-
ui.
|
|
4615
|
-
|
|
4616
|
-
${proNotice(deps.color)}
|
|
4617
|
-
` : "ls.graphics connect");
|
|
4793
|
+
await ui.banner(deps.banner);
|
|
4618
4794
|
ui.intro("ls.graphics connect: set up the MCP server and skill");
|
|
4619
4795
|
const detected = await detect(env);
|
|
4620
4796
|
let chosen;
|
|
@@ -4711,7 +4887,7 @@ No key is needed: each tool opens ls.graphics sign-in on the first render.`, "Si
|
|
|
4711
4887
|
}
|
|
4712
4888
|
|
|
4713
4889
|
// src/cli.ts
|
|
4714
|
-
var VERSION = true ? "0.1.
|
|
4890
|
+
var VERSION = true ? "0.1.1" : JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
4715
4891
|
function openUrl(url) {
|
|
4716
4892
|
const [command, args2] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["explorer.exe", [url]] : ["xdg-open", [url]];
|
|
4717
4893
|
return new Promise((resolve) => execFile2(command, args2, { windowsHide: true }, () => resolve()));
|
|
@@ -4728,18 +4904,22 @@ if (args.version) {
|
|
|
4728
4904
|
${HELP}`);
|
|
4729
4905
|
process.exitCode = 2;
|
|
4730
4906
|
} else {
|
|
4907
|
+
process.stdout.on("error", (e) => {
|
|
4908
|
+
if (e.code === "EPIPE") process.exit(0);
|
|
4909
|
+
throw e;
|
|
4910
|
+
});
|
|
4731
4911
|
const tty = Boolean(process.stdout.isTTY && process.stdin.isTTY);
|
|
4732
4912
|
const interactive = tty && !args.yes;
|
|
4733
4913
|
const env = envFromProcess();
|
|
4914
|
+
const columns = process.stdout.columns ?? 80;
|
|
4915
|
+
const level = colorLevel(process.env, tty);
|
|
4734
4916
|
const code = await runWizard(args, {
|
|
4735
4917
|
env,
|
|
4736
4918
|
ui: interactive ? clackUi() : plainUi(),
|
|
4737
4919
|
runner: makeRunner(env),
|
|
4738
4920
|
runInherit: makeInheritRunner(env),
|
|
4739
4921
|
openUrl,
|
|
4740
|
-
columns: process.stdout.
|
|
4741
|
-
tty,
|
|
4742
|
-
color: tty && !process.env.NO_COLOR && process.env.TERM !== "dumb"
|
|
4922
|
+
banner: { version: VERSION, columns, level, animate: interactive && shouldAnimate({ env: process.env, level, columns, rows: process.stdout.rows ?? 24, noAnimation: args.noAnimation }) }
|
|
4743
4923
|
});
|
|
4744
4924
|
process.exitCode = code;
|
|
4745
4925
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ls.graphics/connect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "One-command setup for the ls.graphics MCP: adds https://mcp.ls.graphics/mcp to Claude Code, Cursor, VS Code, Codex, Windsurf, Zed and Claude Desktop, and installs the ls.graphics skill.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|