@chanaka_nakandala/integration-agent 1.0.2 ā 1.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.
@@ -1,2 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Initializes the Grubtech Integration Agent
|
3
|
+
*
|
4
|
+
* This command sets up everything needed to use the MCP server with Claude Code:
|
5
|
+
* 1. Verifies Claude Code installation
|
6
|
+
* 2. Creates cache directory for storing scraped documentation
|
7
|
+
* 3. Configures MCP server in Claude Code's config
|
8
|
+
* 4. Installs agent persona YAML files to ~/.claude/agents/
|
9
|
+
*
|
10
|
+
* Users only need to run this once: npx @chanaka_nakandala/integration-agent init
|
11
|
+
*/
|
1
12
|
export declare function initCommand(): Promise<void>;
|
2
13
|
//# sourceMappingURL=init-command.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../src/cli/init-command.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,
|
1
|
+
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../src/cli/init-command.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA4DjD"}
|
package/dist/cli/init-command.js
CHANGED
@@ -2,9 +2,21 @@ import { promises as fs } from 'fs';
|
|
2
2
|
import { join, dirname } from 'path';
|
3
3
|
import { homedir } from 'os';
|
4
4
|
import { fileURLToPath } from 'url';
|
5
|
+
/**
|
6
|
+
* Initializes the Grubtech Integration Agent
|
7
|
+
*
|
8
|
+
* This command sets up everything needed to use the MCP server with Claude Code:
|
9
|
+
* 1. Verifies Claude Code installation
|
10
|
+
* 2. Creates cache directory for storing scraped documentation
|
11
|
+
* 3. Configures MCP server in Claude Code's config
|
12
|
+
* 4. Installs agent persona YAML files to ~/.claude/agents/
|
13
|
+
*
|
14
|
+
* Users only need to run this once: npx @chanaka_nakandala/integration-agent init
|
15
|
+
*/
|
5
16
|
export async function initCommand() {
|
6
17
|
console.log('š Initializing Grubtech Integration Agent...\n');
|
7
|
-
// 1
|
18
|
+
// Step 1: Verify Claude Code is installed
|
19
|
+
// We check if the Claude config directory exists to ensure compatibility
|
8
20
|
const claudeConfigPath = getClaudeConfigPath();
|
9
21
|
const mcpConfigFile = join(claudeConfigPath, 'mcp.json');
|
10
22
|
try {
|
@@ -15,11 +27,13 @@ export async function initCommand() {
|
|
15
27
|
console.warn('ā ļø Claude Code config directory not found. Is Claude Code installed?');
|
16
28
|
console.warn(` Expected at: ${claudeConfigPath}\n`);
|
17
29
|
}
|
18
|
-
// 2
|
30
|
+
// Step 2: Create cache directory for storing scraped Grubtech documentation
|
31
|
+
// This avoids repeated downloads and speeds up documentation searches
|
19
32
|
const cacheDir = join(homedir(), '.grubtech', 'cache');
|
20
33
|
await fs.mkdir(join(cacheDir, 'docs'), { recursive: true });
|
21
34
|
console.log('ā Created cache directory at ~/.grubtech/cache/');
|
22
|
-
// 3
|
35
|
+
// Step 3: Configure MCP server in Claude Code
|
36
|
+
// This tells Claude Code how to start our MCP server when needed
|
23
37
|
let mcpConfig = {};
|
24
38
|
try {
|
25
39
|
const existing = await fs.readFile(mcpConfigFile, 'utf-8');
|
@@ -29,15 +43,16 @@ export async function initCommand() {
|
|
29
43
|
catch {
|
30
44
|
console.log('ā Creating new MCP configuration');
|
31
45
|
}
|
32
|
-
// Add
|
46
|
+
// Add or update our MCP server configuration
|
47
|
+
// This registers the server with identifier 'grubtech-integration-support'
|
33
48
|
if (!mcpConfig.mcpServers) {
|
34
49
|
mcpConfig.mcpServers = {};
|
35
50
|
}
|
36
51
|
mcpConfig.mcpServers['grubtech-integration-support'] = {
|
37
|
-
command: 'npx',
|
38
|
-
args: ['@chanaka_nakandala/integration-agent', 'mcp-server'],
|
52
|
+
command: 'npx', // Use npx to run the package directly
|
53
|
+
args: ['@chanaka_nakandala/integration-agent', 'mcp-server'], // Start MCP server mode
|
39
54
|
};
|
40
|
-
// Write
|
55
|
+
// Write the updated configuration back to disk
|
41
56
|
await fs.mkdir(claudeConfigPath, { recursive: true });
|
42
57
|
await fs.writeFile(mcpConfigFile, JSON.stringify(mcpConfig, null, 2));
|
43
58
|
console.log('ā Updated MCP configuration');
|
@@ -52,13 +67,24 @@ export async function initCommand() {
|
|
52
67
|
console.log(' - Grubtech Integration BA (planning, requirements, documentation)');
|
53
68
|
console.log(' 3. Try asking: "How do I authenticate with Grubtech APIs?"\n');
|
54
69
|
}
|
70
|
+
/**
|
71
|
+
* Installs agent persona YAML files to Claude's agents directory
|
72
|
+
*
|
73
|
+
* Agent personas customize Claude's behavior for specific tasks:
|
74
|
+
* - Developer Agent: Technical, code-first responses with production-ready code
|
75
|
+
* - BA Agent: Planning, requirements gathering, documentation generation
|
76
|
+
*
|
77
|
+
* These files are copied to ~/.claude/agents/ where Claude Code can load them
|
78
|
+
*/
|
55
79
|
async function installAgentPersonas() {
|
56
80
|
console.log('\nš¦ Installing agent personas...');
|
57
81
|
const agentsDir = getClaudeAgentsPath();
|
58
82
|
await fs.mkdir(agentsDir, { recursive: true });
|
59
|
-
//
|
83
|
+
// Find the agent-personas directory within this package
|
84
|
+
// When run via npx, __dirname points to the installed package in npm cache
|
60
85
|
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
61
86
|
const agentPersonasSource = join(packageRoot, 'agent-personas');
|
87
|
+
// Define both agent personas to install
|
62
88
|
const agents = [
|
63
89
|
{
|
64
90
|
source: join(agentPersonasSource, 'developer-agent.yaml'),
|
@@ -71,11 +97,12 @@ async function installAgentPersonas() {
|
|
71
97
|
name: 'Grubtech Integration BA',
|
72
98
|
},
|
73
99
|
];
|
100
|
+
// Copy each agent persona file to Claude's agents directory
|
74
101
|
for (const agent of agents) {
|
75
102
|
try {
|
76
|
-
//
|
103
|
+
// Verify source file exists in the package
|
77
104
|
await fs.access(agent.source);
|
78
|
-
// Check if
|
105
|
+
// Check if agent is already installed (from previous init)
|
79
106
|
let shouldCopy = true;
|
80
107
|
try {
|
81
108
|
await fs.access(agent.target);
|
@@ -85,6 +112,7 @@ async function installAgentPersonas() {
|
|
85
112
|
catch {
|
86
113
|
// Target doesn't exist, proceed with copy
|
87
114
|
}
|
115
|
+
// Copy the YAML file to Claude's agents directory
|
88
116
|
if (shouldCopy) {
|
89
117
|
await fs.copyFile(agent.source, agent.target);
|
90
118
|
console.log(` ā Installed ${agent.name}`);
|
@@ -96,6 +124,14 @@ async function installAgentPersonas() {
|
|
96
124
|
}
|
97
125
|
console.log('\nā Agent personas installed to ~/.claude/agents/');
|
98
126
|
}
|
127
|
+
/**
|
128
|
+
* Gets the Claude Code configuration directory path
|
129
|
+
*
|
130
|
+
* Different operating systems store Claude config in different locations:
|
131
|
+
* - Windows: %APPDATA%\Claude\config
|
132
|
+
* - macOS: ~/Library/Application Support/Claude/config
|
133
|
+
* - Linux: ~/.config/claude
|
134
|
+
*/
|
99
135
|
function getClaudeConfigPath() {
|
100
136
|
const home = homedir();
|
101
137
|
switch (process.platform) {
|
@@ -107,9 +143,14 @@ function getClaudeConfigPath() {
|
|
107
143
|
return join(home, '.config', 'claude');
|
108
144
|
}
|
109
145
|
}
|
146
|
+
/**
|
147
|
+
* Gets the Claude Code agents directory path
|
148
|
+
*
|
149
|
+
* Agent personas are stored in ~/.claude/agents/ on all platforms
|
150
|
+
* This is where Claude Code looks for custom agent configurations
|
151
|
+
*/
|
110
152
|
function getClaudeAgentsPath() {
|
111
153
|
const home = homedir();
|
112
|
-
// Claude Code agents directory is always at ~/.claude/agents/ on all platforms
|
113
154
|
return join(home, '.claude', 'agents');
|
114
155
|
}
|
115
156
|
//# sourceMappingURL=init-command.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-command.js","sourceRoot":"","sources":["../../src/cli/init-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IA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,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,mBAAmB;IAC1B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@chanaka_nakandala/integration-agent",
|
3
|
-
"version": "1.0
|
4
|
-
"description": "
|
3
|
+
"version": "1.1.0",
|
4
|
+
"description": "Complete Grubtech API integration toolkit: MCP server for Claude Code with intelligent documentation search, production-ready code generation in 4 languages (TypeScript/Python/Java/cURL), and 2 specialized AI agent personas (Developer & Business Analyst). Install everything with ONE command: npx @chanaka_nakandala/integration-agent init",
|
5
5
|
"type": "module",
|
6
6
|
"main": "./dist/index.js",
|
7
7
|
"types": "./dist/index.d.ts",
|
@@ -26,15 +26,6 @@
|
|
26
26
|
"access": "public",
|
27
27
|
"registry": "https://registry.npmjs.org/"
|
28
28
|
},
|
29
|
-
"repository": {
|
30
|
-
"type": "git",
|
31
|
-
"url": "https://github.com/chanaka-nakandala/grubtech-integration-agent.git",
|
32
|
-
"directory": "packages/mcp-server"
|
33
|
-
},
|
34
|
-
"homepage": "https://github.com/chanaka-nakandala/grubtech-integration-agent#readme",
|
35
|
-
"bugs": {
|
36
|
-
"url": "https://github.com/chanaka-nakandala/grubtech-integration-agent/issues"
|
37
|
-
},
|
38
29
|
"scripts": {
|
39
30
|
"build": "node ../../node_modules/typescript/lib/tsc.js",
|
40
31
|
"dev": "node ../../node_modules/typescript/lib/tsc.js --watch",
|
@@ -43,11 +34,30 @@
|
|
43
34
|
},
|
44
35
|
"keywords": [
|
45
36
|
"grubtech",
|
37
|
+
"grubtech-api",
|
38
|
+
"grubtech-integration",
|
46
39
|
"mcp",
|
47
|
-
"
|
48
|
-
"
|
40
|
+
"mcp-server",
|
41
|
+
"model-context-protocol",
|
42
|
+
"claude",
|
43
|
+
"claude-code",
|
44
|
+
"claude-desktop",
|
45
|
+
"api-integration",
|
46
|
+
"code-generation",
|
47
|
+
"documentation-search",
|
48
|
+
"agent-personas",
|
49
|
+
"typescript",
|
50
|
+
"python",
|
51
|
+
"java",
|
52
|
+
"curl",
|
53
|
+
"webhook",
|
54
|
+
"restaurant-tech",
|
55
|
+
"pos-integration",
|
56
|
+
"food-delivery",
|
57
|
+
"menu-sync",
|
58
|
+
"order-management"
|
49
59
|
],
|
50
|
-
"author": "Grubtech",
|
60
|
+
"author": "Grubtech <support@grubtech.io>",
|
51
61
|
"license": "MIT",
|
52
62
|
"dependencies": {
|
53
63
|
"@modelcontextprotocol/sdk": "^0.5.0",
|
@@ -59,6 +69,7 @@
|
|
59
69
|
"typescript": "^5.9.3"
|
60
70
|
},
|
61
71
|
"engines": {
|
62
|
-
"node": ">=18.0.0"
|
72
|
+
"node": ">=18.0.0",
|
73
|
+
"npm": ">=10.0.0"
|
63
74
|
}
|
64
75
|
}
|