@chanaka_nakandala/integration-agent 2.3.2 ā 3.0.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/dist/init-command.d.ts +3 -4
- package/dist/init-command.d.ts.map +1 -1
- package/dist/init-command.js +54 -63
- package/dist/init-command.js.map +1 -1
- package/package.json +1 -1
package/dist/init-command.d.ts
CHANGED
@@ -2,10 +2,9 @@
|
|
2
2
|
* Initializes the Grubtech Integration Agent
|
3
3
|
*
|
4
4
|
* This command sets up everything needed to use the MCP server with Claude Code:
|
5
|
-
* 1.
|
6
|
-
* 2.
|
7
|
-
* 3.
|
8
|
-
* 4. Installs agent persona YAML files from @chanaka_nakandala/agent-personas to ~/.claude/agents/
|
5
|
+
* 1. Creates cache directory for storing scraped documentation
|
6
|
+
* 2. Registers MCP server using 'claude mcp add' command (falls back to manual config if CLI unavailable)
|
7
|
+
* 3. Installs agent persona YAML files to project's .claude/grubtech/agents/ directory as subagents
|
9
8
|
*
|
10
9
|
* Users only need to run this once: npx @chanaka_nakandala/integration-agent init
|
11
10
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../src/init-command.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../src/init-command.ts"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA4DjD"}
|
package/dist/init-command.js
CHANGED
@@ -2,88 +2,88 @@ import { promises as fs } from 'fs';
|
|
2
2
|
import { join, dirname } from 'path';
|
3
3
|
import { homedir } from 'os';
|
4
4
|
import { createRequire } from 'module';
|
5
|
+
import { exec } from 'child_process';
|
6
|
+
import { promisify } from 'util';
|
7
|
+
const execAsync = promisify(exec);
|
5
8
|
/**
|
6
9
|
* Initializes the Grubtech Integration Agent
|
7
10
|
*
|
8
11
|
* This command sets up everything needed to use the MCP server with Claude Code:
|
9
|
-
* 1.
|
10
|
-
* 2.
|
11
|
-
* 3.
|
12
|
-
* 4. Installs agent persona YAML files from @chanaka_nakandala/agent-personas to ~/.claude/agents/
|
12
|
+
* 1. Creates cache directory for storing scraped documentation
|
13
|
+
* 2. Registers MCP server using 'claude mcp add' command (falls back to manual config if CLI unavailable)
|
14
|
+
* 3. Installs agent persona YAML files to project's .claude/grubtech/agents/ directory as subagents
|
13
15
|
*
|
14
16
|
* Users only need to run this once: npx @chanaka_nakandala/integration-agent init
|
15
17
|
*/
|
16
18
|
export async function initCommand() {
|
17
19
|
console.log('š Initializing Grubtech Integration Agent...\n');
|
18
|
-
// Step 1:
|
19
|
-
// We check if the Claude config directory exists to ensure compatibility
|
20
|
-
const claudeConfigPath = getClaudeConfigPath();
|
21
|
-
const mcpConfigFile = join(claudeConfigPath, 'mcp.json');
|
22
|
-
try {
|
23
|
-
await fs.access(claudeConfigPath);
|
24
|
-
console.log('ā Claude Code configuration directory found');
|
25
|
-
}
|
26
|
-
catch {
|
27
|
-
console.warn('ā ļø Claude Code config directory not found. Is Claude Code installed?');
|
28
|
-
console.warn(` Expected at: ${claudeConfigPath}\n`);
|
29
|
-
}
|
30
|
-
// Step 2: Create cache directory for storing scraped Grubtech documentation
|
20
|
+
// Step 1: Create cache directory for storing scraped Grubtech documentation
|
31
21
|
// This avoids repeated downloads and speeds up documentation searches
|
32
22
|
const cacheDir = join(homedir(), '.grubtech', 'cache');
|
33
23
|
await fs.mkdir(join(cacheDir, 'docs'), { recursive: true });
|
34
24
|
console.log('ā Created cache directory at ~/.grubtech/cache/');
|
35
|
-
// Step
|
36
|
-
// This
|
37
|
-
//
|
38
|
-
|
25
|
+
// Step 2: Configure MCP server in Claude Code using the claude CLI
|
26
|
+
// This registers the MCP server with identifier 'grubtech-integration-support'
|
27
|
+
// Uses: claude mcp add grubtech-integration-support npx -y @chanaka_nakandala/integration-mcp-server
|
28
|
+
console.log('\nš” Configuring MCP server...');
|
39
29
|
try {
|
40
|
-
const
|
41
|
-
|
42
|
-
console.log('ā
|
43
|
-
}
|
44
|
-
catch {
|
45
|
-
console.log('ā Creating new MCP configuration');
|
30
|
+
const mcpCommand = 'claude mcp add grubtech-integration-support npx -y @chanaka_nakandala/integration-mcp-server';
|
31
|
+
await execAsync(mcpCommand);
|
32
|
+
console.log('ā MCP server registered with Claude Code');
|
46
33
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
34
|
+
catch (error) {
|
35
|
+
// If claude CLI command fails, fall back to manual configuration
|
36
|
+
console.warn('ā ļø Claude CLI not available, using manual configuration...');
|
37
|
+
const claudeConfigPath = getClaudeConfigPath();
|
38
|
+
const mcpConfigFile = join(claudeConfigPath, 'mcp.json');
|
39
|
+
let mcpConfig = {};
|
40
|
+
try {
|
41
|
+
const existing = await fs.readFile(mcpConfigFile, 'utf-8');
|
42
|
+
mcpConfig = JSON.parse(existing);
|
43
|
+
}
|
44
|
+
catch {
|
45
|
+
// File doesn't exist, start with empty config
|
46
|
+
}
|
47
|
+
if (!mcpConfig.mcpServers) {
|
48
|
+
mcpConfig.mcpServers = {};
|
49
|
+
}
|
50
|
+
mcpConfig.mcpServers['grubtech-integration-support'] = {
|
51
|
+
command: 'npx',
|
52
|
+
args: ['-y', '@chanaka_nakandala/integration-mcp-server'],
|
53
|
+
};
|
54
|
+
await fs.mkdir(claudeConfigPath, { recursive: true });
|
55
|
+
await fs.writeFile(mcpConfigFile, JSON.stringify(mcpConfig, null, 2));
|
56
|
+
console.log('ā MCP server configured manually');
|
51
57
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
};
|
56
|
-
// Write the updated configuration back to disk
|
57
|
-
await fs.mkdir(claudeConfigPath, { recursive: true });
|
58
|
-
await fs.writeFile(mcpConfigFile, JSON.stringify(mcpConfig, null, 2));
|
59
|
-
console.log('ā Configured MCP server (@chanaka_nakandala/integration-mcp-server)');
|
60
|
-
// Step 4: Install agent personas from the separate agent-personas package
|
61
|
-
await installAgentPersonas();
|
62
|
-
// Step 5: Display success message
|
58
|
+
// Step 3: Install agent personas to project .claude/grubtech/agents directory
|
59
|
+
await installAgentPersonas(process.cwd());
|
60
|
+
// Step 4: Display success message
|
63
61
|
console.log('\nā
Setup complete!\n');
|
64
62
|
console.log('Installed components:');
|
65
63
|
console.log(' ā MCP Server: @chanaka_nakandala/integration-mcp-server');
|
66
|
-
console.log(' ā Agent Personas: Developer & BA
|
64
|
+
console.log(' ā Agent Personas: .claude/grubtech/agents/ (Developer & BA)\n');
|
67
65
|
console.log('Next steps:');
|
68
66
|
console.log(' 1. Restart Claude Code');
|
69
|
-
console.log(' 2.
|
67
|
+
console.log(' 2. Access the subagents from your project:');
|
70
68
|
console.log(' - Grubtech Integration Developer (technical, code-first)');
|
71
69
|
console.log(' - Grubtech Integration BA (planning, requirements, documentation)');
|
72
70
|
console.log(' 3. Try asking: "How do I authenticate with Grubtech APIs?"\n');
|
73
71
|
}
|
74
72
|
/**
|
75
|
-
* Installs agent persona YAML files to
|
73
|
+
* Installs agent persona YAML files to project's .claude/grubtech/agents directory
|
76
74
|
*
|
77
75
|
* This function locates the @chanaka_nakandala/integration-personas package
|
78
|
-
* (which is a dependency) and copies the YAML files to
|
76
|
+
* (which is a dependency) and copies the YAML files to .claude/grubtech/agents/
|
77
|
+
* in the current project directory, making them accessible as Claude subagents.
|
79
78
|
*
|
80
79
|
* Agent personas customize Claude's behavior for specific tasks:
|
81
80
|
* - Developer Agent: Technical, code-first responses with production-ready code
|
82
81
|
* - BA Agent: Planning, requirements gathering, documentation generation
|
83
82
|
*/
|
84
|
-
async function installAgentPersonas() {
|
83
|
+
async function installAgentPersonas(projectPath) {
|
85
84
|
console.log('\nš¦ Installing agent personas from @chanaka_nakandala/integration-personas...');
|
86
|
-
|
85
|
+
// Create .claude/grubtech/agents directory in the project
|
86
|
+
const agentsDir = join(projectPath, '.claude', 'grubtech', 'agents');
|
87
87
|
await fs.mkdir(agentsDir, { recursive: true });
|
88
88
|
try {
|
89
89
|
// Use Node's module resolution to find the integration-personas package
|
@@ -96,16 +96,16 @@ async function installAgentPersonas() {
|
|
96
96
|
const agents = [
|
97
97
|
{
|
98
98
|
source: join(agentPersonasSource, 'developer-agent.yaml'),
|
99
|
-
target: join(agentsDir, '
|
99
|
+
target: join(agentsDir, 'developer.yaml'),
|
100
100
|
name: 'Grubtech Integration Developer',
|
101
101
|
},
|
102
102
|
{
|
103
103
|
source: join(agentPersonasSource, 'ba-agent.yaml'),
|
104
|
-
target: join(agentsDir, '
|
104
|
+
target: join(agentsDir, 'ba.yaml'),
|
105
105
|
name: 'Grubtech Integration BA',
|
106
106
|
},
|
107
107
|
];
|
108
|
-
// Copy each agent persona file to
|
108
|
+
// Copy each agent persona file to project's .claude/grubtech/agents directory
|
109
109
|
for (const agent of agents) {
|
110
110
|
try {
|
111
111
|
// Verify source file exists in the package
|
@@ -119,7 +119,7 @@ async function installAgentPersonas() {
|
|
119
119
|
catch {
|
120
120
|
// Target doesn't exist, proceed with copy
|
121
121
|
}
|
122
|
-
// Copy the YAML file to
|
122
|
+
// Copy the YAML file to project's agents directory
|
123
123
|
await fs.copyFile(agent.source, agent.target);
|
124
124
|
console.log(` ā Installed ${agent.name}`);
|
125
125
|
}
|
@@ -127,7 +127,8 @@ async function installAgentPersonas() {
|
|
127
127
|
console.warn(` ā ļø Failed to install ${agent.name}: ${error.message}`);
|
128
128
|
}
|
129
129
|
}
|
130
|
-
console.log(
|
130
|
+
console.log(`\nā Agent personas installed to ${join('.claude', 'grubtech', 'agents')}`);
|
131
|
+
console.log(' Access them as subagents in your project');
|
131
132
|
}
|
132
133
|
catch (error) {
|
133
134
|
console.error('\nā Failed to install agent personas');
|
@@ -153,14 +154,4 @@ function getClaudeConfigPath() {
|
|
153
154
|
return join(home, '.config', 'claude');
|
154
155
|
}
|
155
156
|
}
|
156
|
-
/**
|
157
|
-
* Gets the Claude Code agents directory path
|
158
|
-
*
|
159
|
-
* Agent personas are stored in ~/.claude/agents/ on all platforms
|
160
|
-
* This is where Claude Code looks for custom agent configurations
|
161
|
-
*/
|
162
|
-
function getClaudeAgentsPath() {
|
163
|
-
const home = homedir();
|
164
|
-
return join(home, '.claude', 'agents');
|
165
|
-
}
|
166
157
|
//# sourceMappingURL=init-command.js.map
|
package/dist/init-command.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-command.js","sourceRoot":"","sources":["../src/init-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"init-command.js","sourceRoot":"","sources":["../src/init-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;IAE/D,4EAA4E;IAC5E,sEAAsE;IACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAA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CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxF,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,aAAa,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mBAAmB;IAC1B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9D,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1E;YACE,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@chanaka_nakandala/integration-agent",
|
3
|
-
"version": "
|
3
|
+
"version": "3.0.0",
|
4
4
|
"description": "One-command installer that sets up the complete Grubtech Integration Agent (MCP server + AI agent personas) for Claude Code to help developers build restaurant and POS integrations.",
|
5
5
|
"type": "module",
|
6
6
|
"main": "./dist/index.js",
|