@graph-tl/graph 0.1.0
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/LICENSE +21 -0
- package/README.md +216 -0
- package/dist/activate-DSDTR2EJ.js +45 -0
- package/dist/activate-DSDTR2EJ.js.map +1 -0
- package/dist/chunk-RVM33A4A.js +497 -0
- package/dist/chunk-RVM33A4A.js.map +1 -0
- package/dist/chunk-WKOEKYTF.js +71 -0
- package/dist/chunk-WKOEKYTF.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/init-JYP72OZQ.js +39 -0
- package/dist/init-JYP72OZQ.js.map +1 -0
- package/dist/nodes-75II37NJ.js +24 -0
- package/dist/nodes-75II37NJ.js.map +1 -0
- package/dist/server-7IB2VIMK.js +1476 -0
- package/dist/server-7IB2VIMK.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/init.ts
|
|
4
|
+
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
var MCP_CONFIG = {
|
|
7
|
+
command: "npx",
|
|
8
|
+
args: ["-y", "@graph-tl/graph"],
|
|
9
|
+
env: {
|
|
10
|
+
GRAPH_AGENT: "claude-code"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function init() {
|
|
14
|
+
const configPath = join(process.cwd(), ".mcp.json");
|
|
15
|
+
let config = {};
|
|
16
|
+
if (existsSync(configPath)) {
|
|
17
|
+
try {
|
|
18
|
+
config = JSON.parse(readFileSync(configPath, "utf8"));
|
|
19
|
+
} catch {
|
|
20
|
+
console.error(`Error: ${configPath} exists but is not valid JSON.`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
if (config.mcpServers?.graph) {
|
|
24
|
+
console.log("Graph is already configured in .mcp.json");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!config.mcpServers) {
|
|
29
|
+
config.mcpServers = {};
|
|
30
|
+
}
|
|
31
|
+
config.mcpServers.graph = MCP_CONFIG;
|
|
32
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
|
|
33
|
+
console.log(`Added graph to ${configPath}`);
|
|
34
|
+
console.log("\nRestart Claude Code to load the new MCP server.");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
init
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=init-JYP72OZQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/init.ts"],"sourcesContent":["import { readFileSync, writeFileSync, existsSync } from \"fs\";\nimport { join } from \"path\";\n\n// [sl:MIVSXp2PYOhrcE28xIFni] npx graph init — auto-write .mcp.json entry\n\nconst MCP_CONFIG = {\n command: \"npx\",\n args: [\"-y\", \"@graph-tl/graph\"],\n env: {\n GRAPH_AGENT: \"claude-code\",\n },\n};\n\nexport function init(): void {\n const configPath = join(process.cwd(), \".mcp.json\");\n\n let config: Record<string, any> = {};\n\n if (existsSync(configPath)) {\n try {\n config = JSON.parse(readFileSync(configPath, \"utf8\"));\n } catch {\n console.error(`Error: ${configPath} exists but is not valid JSON.`);\n process.exit(1);\n }\n\n if (config.mcpServers?.graph) {\n console.log(\"Graph is already configured in .mcp.json\");\n return;\n }\n }\n\n if (!config.mcpServers) {\n config.mcpServers = {};\n }\n\n config.mcpServers.graph = MCP_CONFIG;\n\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\", \"utf8\");\n console.log(`Added graph to ${configPath}`);\n console.log(\"\\nRestart Claude Code to load the new MCP server.\");\n}\n"],"mappings":";;;AAAA,SAAS,cAAc,eAAe,kBAAkB;AACxD,SAAS,YAAY;AAIrB,IAAM,aAAa;AAAA,EACjB,SAAS;AAAA,EACT,MAAM,CAAC,MAAM,iBAAiB;AAAA,EAC9B,KAAK;AAAA,IACH,aAAa;AAAA,EACf;AACF;AAEO,SAAS,OAAa;AAC3B,QAAM,aAAa,KAAK,QAAQ,IAAI,GAAG,WAAW;AAElD,MAAI,SAA8B,CAAC;AAEnC,MAAI,WAAW,UAAU,GAAG;AAC1B,QAAI;AACF,eAAS,KAAK,MAAM,aAAa,YAAY,MAAM,CAAC;AAAA,IACtD,QAAQ;AACN,cAAQ,MAAM,UAAU,UAAU,gCAAgC;AAClE,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI,OAAO,YAAY,OAAO;AAC5B,cAAQ,IAAI,0CAA0C;AACtD;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,OAAO,YAAY;AACtB,WAAO,aAAa,CAAC;AAAA,EACvB;AAEA,SAAO,WAAW,QAAQ;AAE1B,gBAAc,YAAY,KAAK,UAAU,QAAQ,MAAM,CAAC,IAAI,MAAM,MAAM;AACxE,UAAQ,IAAI,kBAAkB,UAAU,EAAE;AAC1C,UAAQ,IAAI,mDAAmD;AACjE;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
createNode,
|
|
4
|
+
getAncestors,
|
|
5
|
+
getChildren,
|
|
6
|
+
getNode,
|
|
7
|
+
getNodeOrThrow,
|
|
8
|
+
getProjectRoot,
|
|
9
|
+
getProjectSummary,
|
|
10
|
+
listProjects,
|
|
11
|
+
updateNode
|
|
12
|
+
} from "./chunk-RVM33A4A.js";
|
|
13
|
+
export {
|
|
14
|
+
createNode,
|
|
15
|
+
getAncestors,
|
|
16
|
+
getChildren,
|
|
17
|
+
getNode,
|
|
18
|
+
getNodeOrThrow,
|
|
19
|
+
getProjectRoot,
|
|
20
|
+
getProjectSummary,
|
|
21
|
+
listProjects,
|
|
22
|
+
updateNode
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=nodes-75II37NJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|