localant 1.0.1 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "localant",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "description": "LocalAnt — Use ChatGPT as the brain and your local computer as the hands. A safe, permissioned local MCP Gateway for ChatGPT.",
6
6
  "license": "MIT",
@@ -13,6 +13,7 @@
13
13
  "packages/*/package.json",
14
14
  "examples/skills/**",
15
15
  "assets/**",
16
+ "scripts/postinstall.mjs",
16
17
  "README.md",
17
18
  "SECURITY.md",
18
19
  "LICENSE"
@@ -20,6 +21,14 @@
20
21
  "engines": {
21
22
  "node": ">=22"
22
23
  },
24
+ "dependencies": {
25
+ "@modelcontextprotocol/sdk": "^1.12.0",
26
+ "commander": "^12.1.0",
27
+ "express": "^5.0.1",
28
+ "nanoid": "^5.0.9",
29
+ "tsx": "^4.19.2",
30
+ "zod": "^3.24.1"
31
+ },
23
32
  "keywords": [
24
33
  "chatgpt",
25
34
  "mcp",
@@ -44,9 +53,9 @@
44
53
  "typescript": "^5.7.2",
45
54
  "vitest": "^2.1.8",
46
55
  "@localant/gateway": "1.0.0",
47
- "@localant/skill-sdk": "1.0.0",
56
+ "@localant/mcp": "1.0.0",
48
57
  "@localant/shared": "1.0.0",
49
- "@localant/mcp": "1.0.0"
58
+ "@localant/skill-sdk": "1.0.0"
50
59
  },
51
60
  "scripts": {
52
61
  "build": "tsc -b",
@@ -58,6 +67,7 @@
58
67
  "test:watch": "vitest",
59
68
  "validate": "pnpm build && pnpm test",
60
69
  "start": "node packages/cli/dist/bin.js start",
61
- "setup": "node packages/cli/dist/bin.js setup"
70
+ "setup": "node packages/cli/dist/bin.js setup",
71
+ "postinstall": "node scripts/postinstall.mjs"
62
72
  }
63
73
  }
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+ // postinstall — makes @localant/* internal packages resolvable at runtime.
3
+ //
4
+ // The published npm tarball flattens the monorepo: each package's dist dir and
5
+ // package.json ship at their original `packages/<pkg>/` path, but there is no
6
+ // `node_modules/@localant/` entry, so Node can't resolve `@localant/shared`
7
+ // (and friends) when the CLI bundle imports them.
8
+ //
9
+ // This script links `node_modules/@localant/<pkg>` to the real `packages/<pkg>`
10
+ // directory, reusing each package's own package.json (whose `main`/`types`
11
+ // already point at `dist/`). It is a no-op in the dev workspace, where pnpm has
12
+ // already created those links — writing through them would corrupt the real
13
+ // source package.json files.
14
+ import fs from "node:fs";
15
+ import path from "node:path";
16
+ import { fileURLToPath } from "node:url";
17
+
18
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
+ const root = path.resolve(__dirname, "..");
20
+
21
+ const LOCALANT_PACKAGES = ["shared", "skill-sdk", "gateway", "mcp", "dashboard", "cli"];
22
+
23
+ for (const pkg of LOCALANT_PACKAGES) {
24
+ const linkPath = path.join(root, "node_modules", "@localant", pkg);
25
+ const target = path.join(root, "packages", pkg);
26
+
27
+ // Already linked (pnpm/npm workspace) — never write through it.
28
+ if (fs.existsSync(linkPath)) continue;
29
+ // Source package not present (unexpected layout) — skip rather than guess.
30
+ if (!fs.existsSync(target)) continue;
31
+
32
+ fs.mkdirSync(path.dirname(linkPath), { recursive: true });
33
+ const relTarget = path.relative(path.dirname(linkPath), target);
34
+ try {
35
+ fs.symlinkSync(relTarget, linkPath, "junction");
36
+ } catch {
37
+ // Symlinks unavailable (e.g. restricted Windows): fall back to a shim
38
+ // package.json that re-points main/types at the real dist via absolute path.
39
+ const real = JSON.parse(fs.readFileSync(path.join(target, "package.json"), "utf8"));
40
+ fs.mkdirSync(linkPath, { recursive: true });
41
+ fs.writeFileSync(
42
+ path.join(linkPath, "package.json"),
43
+ JSON.stringify(
44
+ {
45
+ name: `@localant/${pkg}`,
46
+ version: real.version ?? "1.0.0",
47
+ type: "module",
48
+ main: path.join(target, "dist/index.js"),
49
+ types: path.join(target, "dist/index.d.ts"),
50
+ },
51
+ null,
52
+ 2,
53
+ ),
54
+ );
55
+ }
56
+ }