@locusai/cli 0.1.5 → 0.1.7
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/bin/locus.js +18 -11
- package/bin/mcp.js +24 -78
- package/bin/server.js +44 -74
- package/package.json +1 -1
- package/public/dashboard/404.html +1 -1
- package/public/dashboard/_next/static/chunks/{webpack-ab85b3045756e687.js → webpack-99a10a055b5bb9c4.js} +1 -1
- package/public/dashboard/backlog.html +1 -1
- package/public/dashboard/backlog.txt +1 -1
- package/public/dashboard/docs.html +1 -1
- package/public/dashboard/docs.txt +1 -1
- package/public/dashboard/index.html +1 -1
- package/public/dashboard/index.txt +1 -1
- package/public/dashboard/settings.html +1 -1
- package/public/dashboard/settings.txt +1 -1
- package/src/generators/locus.ts +25 -5
- /package/public/dashboard/_next/static/{1BInkZcWpYFq8PBSpvumK → D0NXe04ZCLNDckV_quc8g}/_buildManifest.js +0 -0
- /package/public/dashboard/_next/static/{1BInkZcWpYFq8PBSpvumK → D0NXe04ZCLNDckV_quc8g}/_ssgManifest.js +0 -0
package/src/generators/locus.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Database } from "bun:sqlite";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { writeFile } from "node:fs/promises";
|
|
4
|
-
import { join } from "node:path";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
5
|
import type { ProjectConfig } from "../types.js";
|
|
6
6
|
import { ensureDir, writeJson } from "../utils.js";
|
|
7
7
|
|
|
@@ -92,11 +92,31 @@ export async function initializeLocus(config: ProjectConfig) {
|
|
|
92
92
|
export async function logMcpConfig(config: ProjectConfig) {
|
|
93
93
|
const { projectPath, projectName } = config;
|
|
94
94
|
|
|
95
|
+
// Detect for bundled vs source mode
|
|
96
|
+
const scriptDir = import.meta.dir;
|
|
97
|
+
const isBundled = scriptDir.endsWith("/bin") || scriptDir.endsWith("\\bin");
|
|
98
|
+
|
|
99
|
+
// In source mode, scriptDir is packages/cli/src/generators
|
|
100
|
+
// In bundled mode, scriptDir is packages/cli/bin
|
|
101
|
+
const locusRoot = isBundled
|
|
102
|
+
? resolve(scriptDir, "../")
|
|
103
|
+
: resolve(scriptDir, "../../../../");
|
|
104
|
+
|
|
105
|
+
const mcpSourcePath = join(locusRoot, "apps/mcp/src/index.ts");
|
|
106
|
+
const mcpBundledPath = isBundled
|
|
107
|
+
? join(scriptDir, "mcp.js")
|
|
108
|
+
: join(locusRoot, "packages/cli/bin/mcp.js");
|
|
109
|
+
|
|
110
|
+
const mcpExecPath = existsSync(mcpSourcePath)
|
|
111
|
+
? mcpSourcePath
|
|
112
|
+
: mcpBundledPath;
|
|
113
|
+
|
|
95
114
|
const mcpConfig = {
|
|
96
115
|
mcpServers: {
|
|
97
|
-
|
|
98
|
-
command: "
|
|
99
|
-
args: ["
|
|
116
|
+
[projectName]: {
|
|
117
|
+
command: "bun",
|
|
118
|
+
args: ["run", mcpExecPath, "--project", join(projectPath, ".locus")],
|
|
119
|
+
env: {},
|
|
100
120
|
},
|
|
101
121
|
},
|
|
102
122
|
};
|
|
@@ -105,7 +125,7 @@ export async function logMcpConfig(config: ProjectConfig) {
|
|
|
105
125
|
console.log("\nNext steps:");
|
|
106
126
|
console.log(` cd ${projectName}`);
|
|
107
127
|
console.log(" bun install");
|
|
108
|
-
console.log("
|
|
128
|
+
console.log(" bun run dev");
|
|
109
129
|
console.log(
|
|
110
130
|
"\nMCP Configuration (add to your IDE or Claude Desktop config):"
|
|
111
131
|
);
|
|
File without changes
|
|
File without changes
|