lace-mcp 0.0.2-alpha.2 → 0.0.2-alpha.4

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.
Files changed (2) hide show
  1. package/dist/cli.js +25 -20
  2. package/package.json +7 -6
package/dist/cli.js CHANGED
@@ -249,13 +249,13 @@ var init_codexConfig = __esm({
249
249
  // src/install.ts
250
250
  var install_exports = {};
251
251
  __export(install_exports, {
252
- buildCodexTomlBlock: () => buildCodexTomlBlock
252
+ buildCodexTomlBlock: () => buildCodexTomlBlock,
253
+ main: () => main
253
254
  });
254
255
  import { execSync as execSync2 } from "node:child_process";
255
256
  import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
256
257
  import { homedir as homedir2 } from "node:os";
257
258
  import { join as join3, resolve } from "node:path";
258
- import { pathToFileURL } from "node:url";
259
259
  function parseFlags(args) {
260
260
  const flags = {};
261
261
  for (let i = 0; i < args.length; i++) {
@@ -280,12 +280,19 @@ function credentialsToEnv(creds) {
280
280
  };
281
281
  }
282
282
  function extractSkillVersion(content) {
283
- const match = content.match(/<!-- lace-mcp-skill-version: (\d+) -->/);
283
+ const match = content.match(/lace-mcp-skill-version: (\d+)/);
284
284
  return match ? parseInt(match[1], 10) : 0;
285
285
  }
286
- function prependVersion(content) {
287
- return `<!-- lace-mcp-skill-version: ${SKILL_VERSION} -->
288
- ${content}`;
286
+ function injectVersion(content) {
287
+ if (content.startsWith("---\n")) {
288
+ return content.replace(/^---\n/, `---
289
+ lace-mcp-skill-version: ${SKILL_VERSION}
290
+ `);
291
+ }
292
+ return `${content.trimEnd()}
293
+
294
+ <!-- lace-mcp-skill-version: ${SKILL_VERSION} -->
295
+ `;
289
296
  }
290
297
  function loadSkillContent() {
291
298
  const skillPath = join3(resolve(import.meta.dirname, ".."), "SKILL.md");
@@ -344,7 +351,7 @@ function installClaudeSkill() {
344
351
  }
345
352
  }
346
353
  mkdirSync2(skillDir, { recursive: true });
347
- writeFileSync2(skillPath, prependVersion(content.trimStart()));
354
+ writeFileSync2(skillPath, injectVersion(content.trimStart()));
348
355
  console.log(` \u2713 /lace skill written to ${skillPath}`);
349
356
  }
350
357
  function installCursorRule() {
@@ -360,7 +367,7 @@ function installCursorRule() {
360
367
  }
361
368
  }
362
369
  mkdirSync2(rulesDir, { recursive: true });
363
- writeFileSync2(rulePath, prependVersion(buildCursorRule(extractSkillBody(content))));
370
+ writeFileSync2(rulePath, injectVersion(buildCursorRule(extractSkillBody(content))));
364
371
  console.log(` \u2713 Cursor rule written to ${rulePath}`);
365
372
  }
366
373
  function installCodexSkill() {
@@ -376,7 +383,7 @@ function installCodexSkill() {
376
383
  }
377
384
  }
378
385
  mkdirSync2(skillDir, { recursive: true });
379
- writeFileSync2(skillPath, prependVersion(extractSkillBody(content)));
386
+ writeFileSync2(skillPath, injectVersion(extractSkillBody(content)));
380
387
  console.log(` \u2713 Codex skill written to ${skillPath}`);
381
388
  }
382
389
  function mcpArgs(editor) {
@@ -384,7 +391,7 @@ function mcpArgs(editor) {
384
391
  }
385
392
  function installClaude(env) {
386
393
  try {
387
- const envFlags = Object.entries(env).map(([key, value]) => `--env ${key}=${value}`).join(" ");
394
+ const envFlags = Object.entries(env).map(([key, value]) => `-e ${key}=${value}`).join(" ");
388
395
  execSync2(`claude mcp add --transport stdio --scope user ${envFlags} lace -- npx ${mcpArgs("claude").join(" ")}`, {
389
396
  stdio: "inherit"
390
397
  });
@@ -441,12 +448,9 @@ Installing Lace MCP for ${target}...`);
441
448
  else installCodex(env);
442
449
  console.log('\nDone. Start a new session and say "implement the Lace decision" or type /lace.\n');
443
450
  }
444
- function isCliEntrypoint() {
445
- return process.argv[1] ? import.meta.url === pathToFileURL(process.argv[1]).href : false;
446
- }
447
451
  var TARGETS, PACKAGE_NAME, SKILL_VERSION;
448
452
  var init_install = __esm({
449
- async "src/install.ts"() {
453
+ "src/install.ts"() {
450
454
  "use strict";
451
455
  init_auth();
452
456
  init_codexConfig();
@@ -454,14 +458,14 @@ var init_install = __esm({
454
458
  TARGETS = ["claude", "claude-desktop", "cursor", "codex"];
455
459
  PACKAGE_NAME = "lace-mcp";
456
460
  SKILL_VERSION = 1;
457
- if (isCliEntrypoint()) {
458
- await main();
459
- }
460
461
  }
461
462
  });
462
463
 
463
464
  // src/uninstall.ts
464
465
  var uninstall_exports = {};
466
+ __export(uninstall_exports, {
467
+ main: () => main2
468
+ });
465
469
  import { execSync as execSync3 } from "node:child_process";
466
470
  import { existsSync as existsSync3, readFileSync as readFileSync3, rmSync, writeFileSync as writeFileSync3 } from "node:fs";
467
471
  import { homedir as homedir3 } from "node:os";
@@ -546,7 +550,6 @@ var init_uninstall = __esm({
546
550
  init_paths();
547
551
  TARGETS2 = ["claude", "claude-desktop", "cursor", "codex", "all"];
548
552
  PACKAGE_NAME2 = "lace-mcp";
549
- main2();
550
553
  }
551
554
  });
552
555
 
@@ -22648,9 +22651,11 @@ var init_index = __esm({
22648
22651
  // src/cli.ts
22649
22652
  var command = process.argv[2];
22650
22653
  if (command === "install") {
22651
- await init_install().then(() => install_exports);
22654
+ const { main: main3 } = await Promise.resolve().then(() => (init_install(), install_exports));
22655
+ await main3();
22652
22656
  } else if (command === "uninstall") {
22653
- await Promise.resolve().then(() => (init_uninstall(), uninstall_exports));
22657
+ const { main: main3 } = await Promise.resolve().then(() => (init_uninstall(), uninstall_exports));
22658
+ main3();
22654
22659
  } else if (command === "login") {
22655
22660
  const { browserLogin: browserLogin2 } = await Promise.resolve().then(() => (init_auth(), auth_exports));
22656
22661
  await browserLogin2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lace-mcp",
3
- "version": "0.0.2-alpha.2",
3
+ "version": "0.0.2-alpha.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/cli.js",
@@ -23,10 +23,11 @@
23
23
  },
24
24
  "scripts": {
25
25
  "start": "tsx src/index.ts",
26
- "install-claude": "tsx src/install.ts claude",
27
- "install-claude-desktop": "tsx src/install.ts claude-desktop",
28
- "install-cursor": "tsx src/install.ts cursor",
29
- "install-codex": "tsx src/install.ts codex",
30
- "build": "rm -rf dist && esbuild src/cli.ts --bundle --platform=node --format=esm --outfile=dist/cli.js"
26
+ "install-claude": "tsx src/cli.ts install claude",
27
+ "install-claude-desktop": "tsx src/cli.ts install claude-desktop",
28
+ "install-cursor": "tsx src/cli.ts install cursor",
29
+ "install-codex": "tsx src/cli.ts install codex",
30
+ "build": "rm -rf dist && esbuild src/cli.ts --bundle --platform=node --format=esm --outfile=dist/cli.js",
31
+ "build:mcpb": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=mcpb/server/index.js && npx @anthropic-ai/mcpb pack mcpb dist/lace.mcpb"
31
32
  }
32
33
  }