agcel 1.0.1 → 1.0.3

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.
Files changed (40) hide show
  1. package/.agent/workflows/api-gen.md +4 -0
  2. package/.agent/workflows/brainstorm.md +4 -0
  3. package/.agent/workflows/changelog.md +4 -0
  4. package/.agent/workflows/checkpoint.md +4 -0
  5. package/.agent/workflows/commit.md +4 -0
  6. package/.agent/workflows/debug.md +4 -0
  7. package/.agent/workflows/deploy.md +4 -0
  8. package/.agent/workflows/doc.md +4 -0
  9. package/.agent/workflows/execute-plan.md +4 -0
  10. package/.agent/workflows/feature.md +4 -0
  11. package/.agent/workflows/fix.md +4 -0
  12. package/.agent/workflows/help.md +4 -0
  13. package/.agent/workflows/index.md +4 -0
  14. package/.agent/workflows/load.md +4 -0
  15. package/.agent/workflows/mode.md +4 -0
  16. package/.agent/workflows/optimize.md +4 -0
  17. package/.agent/workflows/plan.md +4 -0
  18. package/.agent/workflows/pr.md +4 -0
  19. package/.agent/workflows/refactor.md +4 -0
  20. package/.agent/workflows/research.md +4 -0
  21. package/.agent/workflows/review.md +4 -0
  22. package/.agent/workflows/security-scan.md +4 -0
  23. package/.agent/workflows/ship.md +4 -0
  24. package/.agent/workflows/spawn.md +4 -0
  25. package/.agent/workflows/status.md +4 -0
  26. package/.agent/workflows/tdd.md +4 -0
  27. package/.agent/workflows/test.md +4 -0
  28. package/README.md +14 -9
  29. package/dist/commands/init.js +8 -3
  30. package/dist/commands/list.js +9 -15
  31. package/dist/commands/uninstall.js +19 -27
  32. package/dist/index.js +11 -30
  33. package/dist/server/index.js +2 -1
  34. package/dist/utils/index.js +1 -36
  35. package/package.json +2 -2
  36. package/dist/commands/install.js +0 -98
  37. package/dist/commands/restart.js +0 -17
  38. package/dist/commands/start.js +0 -41
  39. package/dist/commands/status.js +0 -24
  40. package/dist/commands/stop.js +0 -29
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: API Generation
3
+ ---
4
+
1
5
  # /api-gen - API Generation Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Interactive Brainstorming Session
3
+ ---
4
+
1
5
  # /brainstorm - Interactive Design Session
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Changelog Generation
3
+ ---
4
+
1
5
  # /changelog - Changelog Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Create a Checkpoint
3
+ ---
4
+
1
5
  # /checkpoint
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Smart Commit with Auto-generated Message
3
+ ---
4
+
1
5
  # /commit - Smart Commit Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Debug and Fix Errors
3
+ ---
4
+
1
5
  # /debug - Debug Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Deployment
3
+ ---
4
+
1
5
  # /deploy - Deployment Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Documentation Generation
3
+ ---
4
+
1
5
  # /doc - Documentation Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Subagent-Driven Plan Execution
3
+ ---
4
+
1
5
  # /execute-plan - Subagent-Driven Plan Execution
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Feature Development
3
+ ---
4
+
1
5
  # /feature - Feature Development Workflow
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Bug Fix Workflow
3
+ ---
4
+
1
5
  # /fix - Bug Fix Workflow
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Help and Command Reference
3
+ ---
4
+
1
5
  # /help - Help Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Workflow Index
3
+ ---
4
+
1
5
  # /index
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Load Context
3
+ ---
4
+
1
5
  # /load
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Switch Mode
3
+ ---
4
+
1
5
  # /mode
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Performance Optimization
3
+ ---
4
+
1
5
  # /optimize - Performance Optimization Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Task Planning
3
+ ---
4
+
1
5
  # /plan - Task Planning Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Create Pull Request
3
+ ---
4
+
1
5
  # /pr - Create Pull Request
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Code Refactoring
3
+ ---
4
+
1
5
  # /refactor - Refactoring Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Research and Analysis
3
+ ---
4
+
1
5
  # /research - Research Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Code Review
3
+ ---
4
+
1
5
  # /review - Code Review Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Security Scanning
3
+ ---
4
+
1
5
  # /security-scan - Security Scanning Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Ship Code
3
+ ---
4
+
1
5
  # /ship - Ship Code Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Spawn Subagent
3
+ ---
4
+
1
5
  # /spawn
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Project Status
3
+ ---
4
+
1
5
  # /status - Project Status Command
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Test-Driven Development
3
+ ---
4
+
1
5
  # /tdd - Test-Driven Development Workflow
2
6
 
3
7
  ## Purpose
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Test Generation
3
+ ---
4
+
1
5
  # /test - Test Generation Command
2
6
 
3
7
  ## Purpose
package/README.md CHANGED
@@ -8,27 +8,32 @@ The project consists of two main components:
8
8
  1. **AgCel CLI**: A command-line interface to manage and interact with the MCP server.
9
9
  2. **AgCel MCP Skills Server**: A local server that hosts skills and capabilities, enabling AI agents to perform complex tasks.
10
10
 
11
- ## Installation
11
+ To install the AgCel CLI globally:
12
12
 
13
- To install the AgCel CLI globally and set up the local MCP server:
13
+ ```bash
14
+ npm install -g agcel
15
+ ```
16
+
17
+ This will make the `agc` command available globally. If you are developing locally, you can run `npm install -g .` from the project root.
18
+
19
+ To remove AgCel, simply uninstall the npm package:
14
20
 
15
21
  ```bash
16
- npx agcel install
22
+ npm uninstall -g agcel
17
23
  ```
18
24
 
25
+ You may also want to manually remove the global data directory (`~/.agcel`) and the server registration in your MCP config if you previously ran the legacy `install` command.
26
+
19
27
  ## CLI Usage
20
28
 
21
29
  The `agc` command-line tool is your primary interface. Application data is stored in the `.agc` directory in your project root, and `~/.agcel` for global configuration.
22
30
 
23
31
  | Command | Description |
24
32
  | :--- | :--- |
25
- | `agc start` | Start the MCP server locally. |
26
- | `agc stop` | Stop the running MCP server. |
27
- | `agc restart` | Restart the MCP server. |
28
- | `agc status` | Check the status of the local MCP server. |
29
33
  | `agc init` | Initialize AgCel in the current project (copies workflows to `.agent/workflows`). |
30
- | `agc skills list` | List all available skills. |
31
- | `agc workflows list` | List all available workflows. |
34
+ | `agc skills list` | List all available skills (local or global). |
35
+ | `agc workflows list` | List all available workflows (local or global). |
36
+ | `agc uninstall` | Clean up global data and remove the npm package. |
32
37
  | `agc --help` | Show the help menu. |
33
38
  | `agc --version` | Show the CLI version. |
34
39
 
@@ -16,12 +16,12 @@ async function initCommand() {
16
16
  // 1. Check if global install exists
17
17
  if (!fs_1.default.existsSync(globalDir)) {
18
18
  console.error(chalk_1.default.red('Error: AgCel is not installed globally.'));
19
- console.error(chalk_1.default.yellow('Please run "npx agcel install" first to set up the global environment.'));
19
+ console.error(chalk_1.default.yellow('Please run "npm install -g agcel" first.'));
20
20
  return;
21
21
  }
22
22
  if (!fs_1.default.existsSync(globalWorkflowsDir)) {
23
23
  console.error(chalk_1.default.red(`Error: Workflows directory not found in global install at ${globalWorkflowsDir}`));
24
- console.error(chalk_1.default.yellow('Please try running "npx agcel install" again to fix the installation.'));
24
+ console.error(chalk_1.default.yellow('Please try reinstalling: npm install -g agcel'));
25
25
  return;
26
26
  }
27
27
  // 2. Setup local .agc and .agent directories
@@ -42,7 +42,12 @@ async function initCommand() {
42
42
  fs_1.default.mkdirSync(projectSkillsDir, { recursive: true });
43
43
  }
44
44
  console.log(chalk_1.default.blue('Copying skills...'));
45
- fs_1.default.cpSync(globalSkillsDir, projectSkillsDir, { recursive: true });
45
+ try {
46
+ fs_1.default.cpSync(globalSkillsDir, projectSkillsDir, { recursive: true });
47
+ }
48
+ catch (e) {
49
+ console.error(chalk_1.default.red('Failed to copy skills.'), e);
50
+ }
46
51
  }
47
52
  else {
48
53
  console.warn(chalk_1.default.yellow(`Warning: Global skills not found at ${globalSkillsDir}`));
@@ -9,29 +9,23 @@ const path_1 = __importDefault(require("path"));
9
9
  const chalk_1 = __importDefault(require("chalk"));
10
10
  const index_js_1 = require("../utils/index.js");
11
11
  function listCommand(type) {
12
- if (!(0, index_js_1.isInitialized)()) {
13
- console.error(chalk_1.default.red('AgCel is not initialized. Run "agc init" first.'));
14
- return;
15
- }
16
12
  const agCelDir = (0, index_js_1.getAgCelDir)();
17
- // Check both source and local directories
18
- // For now, let's assume we list what's in .agc
19
- // Ideally, we should also check the global or project skills if integrated.
20
- // NOTE: In a real implementation, we might want to list from the temp_skills directory too if configured?
21
- // But per requirements, `agc init` creates .agc.
22
- // Let's list from .AgCel/<type>
13
+ const globalDir = (0, index_js_1.getGlobalAgCelDir)();
23
14
  let targetDir = path_1.default.join(agCelDir, type);
24
- // FIX: Workflows are stored in .agent/workflows, not .agc/workflows
25
15
  if (type === 'workflows') {
26
16
  targetDir = path_1.default.join(process.cwd(), '.agent', 'workflows');
27
17
  }
28
- if (!fs_1.default.existsSync(targetDir)) {
29
- console.log(chalk_1.default.yellow(`No ${type} directory found in .agc.`));
30
- return;
18
+ if (!(0, index_js_1.isInitialized)() || !fs_1.default.existsSync(targetDir)) {
19
+ console.log(chalk_1.default.yellow(`Project not initialized or ${type} not found locally. Listing global ${type}...`));
20
+ targetDir = path_1.default.join(globalDir, type === 'workflows' ? 'workflows' : 'skills');
31
21
  }
32
22
  try {
33
23
  const items = fs_1.default.readdirSync(targetDir).filter(item => {
34
- return fs_1.default.statSync(path_1.default.join(targetDir, item)).isDirectory();
24
+ if (type === 'skills') {
25
+ return fs_1.default.statSync(path_1.default.join(targetDir, item)).isDirectory();
26
+ }
27
+ // Workflows are .md files
28
+ return item.endsWith('.md') && fs_1.default.statSync(path_1.default.join(targetDir, item)).isFile();
35
29
  });
36
30
  if (items.length === 0) {
37
31
  console.log(chalk_1.default.yellow(`No ${type} found.`));
@@ -14,8 +14,7 @@ const index_js_1 = require("../utils/index.js");
14
14
  async function uninstallCommand() {
15
15
  const globalDir = (0, index_js_1.getGlobalAgCelDir)();
16
16
  const mcpConfigPath = path_1.default.join(os_1.default.homedir(), '.gemini', 'antigravity', 'mcp_config.json');
17
- console.log(chalk_1.default.blue('Uninstalling AgCel...'));
18
- let requiresSudo = false;
17
+ console.log(chalk_1.default.blue('Cleaning up AgCel configuration and data...'));
19
18
  // 1. Remove from MCP Config
20
19
  if (fs_1.default.existsSync(mcpConfigPath)) {
21
20
  try {
@@ -26,53 +25,46 @@ async function uninstallCommand() {
26
25
  fs_1.default.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
27
26
  console.log(chalk_1.default.green(`Removed AgCel from ${mcpConfigPath}`));
28
27
  }
29
- else {
30
- console.log(chalk_1.default.yellow('AgCel not found in MCP config.'));
31
- }
32
28
  }
33
29
  catch (error) {
34
30
  console.error(chalk_1.default.red('Failed to update MCP config:'), error);
35
31
  }
36
32
  }
37
- else {
38
- console.log(chalk_1.default.yellow('MCP config not found.'));
39
- }
40
- // 2. Remove Global Directory
33
+ // 2. Remove Global Data Directory (~/.agcel)
41
34
  if (fs_1.default.existsSync(globalDir)) {
42
- try {
43
- fs_1.default.rmSync(globalDir, { recursive: true, force: true });
44
- console.log(chalk_1.default.green(`Removed global directory at ${globalDir}`));
45
- }
46
- catch (error) {
47
- if (error.code === 'EACCES') {
48
- console.error(chalk_1.default.red(`Permission denied removing ${globalDir}. You might need sudo.`));
49
- requiresSudo = true;
35
+ const answer = await inquirer_1.default.prompt([{
36
+ type: 'confirm',
37
+ name: 'removeData',
38
+ message: `Do you want to remove the global data directory at ${globalDir}? (this deletes global logs and skills)`,
39
+ default: true
40
+ }]);
41
+ if (answer.removeData) {
42
+ try {
43
+ fs_1.default.rmSync(globalDir, { recursive: true, force: true });
44
+ console.log(chalk_1.default.green(`Removed global directory at ${globalDir}`));
50
45
  }
51
- else {
52
- console.error(chalk_1.default.red(`Failed to remove global directory:`), error);
46
+ catch (error) {
47
+ console.error(chalk_1.default.red(`Failed to remove global directory. You may need to delete it manually: sudo rm -rf ${globalDir}`));
53
48
  }
54
49
  }
55
50
  }
56
- else {
57
- console.log(chalk_1.default.yellow('Global directory not found.'));
58
- }
59
51
  // 3. Prompt for npm uninstall
60
- const answer = await inquirer_1.default.prompt([{
52
+ const npmAnswer = await inquirer_1.default.prompt([{
61
53
  type: 'confirm',
62
54
  name: 'npmUninstall',
63
55
  message: 'Do you want to run "npm uninstall -g agcel" now?',
64
56
  default: true
65
57
  }]);
66
- if (answer.npmUninstall) {
58
+ if (npmAnswer.npmUninstall) {
67
59
  try {
68
60
  console.log(chalk_1.default.blue('Running "npm uninstall -g agcel"...'));
69
61
  (0, child_process_1.execSync)('npm uninstall -g agcel', { stdio: 'inherit' });
70
62
  console.log(chalk_1.default.green('AgCel package uninstalled successfully.'));
71
63
  }
72
64
  catch (error) {
73
- console.error(chalk_1.default.red('Failed to uninstall npm package.'));
74
- console.error(chalk_1.default.yellow('You might need to run: sudo npm uninstall -g agcel'));
65
+ console.error(chalk_1.default.red('Failed to uninstall npm package via CLI.'));
66
+ console.error(chalk_1.default.yellow('Please run manually: npm uninstall -g agcel'));
75
67
  }
76
68
  }
77
- console.log(chalk_1.default.green('AgCel uninstallation complete.'));
69
+ console.log(chalk_1.default.green('\nAgCel cleanup complete.'));
78
70
  }
package/dist/index.js CHANGED
@@ -1,50 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
7
  const commander_1 = require("commander");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
5
10
  const init_js_1 = require("./commands/init.js");
6
- const install_js_1 = require("./commands/install.js");
7
11
  const uninstall_js_1 = require("./commands/uninstall.js");
8
- const start_js_1 = require("./commands/start.js");
9
- const stop_js_1 = require("./commands/stop.js");
10
- const restart_js_1 = require("./commands/restart.js");
11
- const status_js_1 = require("./commands/status.js");
12
12
  const list_js_1 = require("./commands/list.js");
13
+ const pkg = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(__dirname, '..', 'package.json'), 'utf-8'));
13
14
  const program = new commander_1.Command();
14
15
  program
15
16
  .name('agc')
16
17
  .description('AgCel MCP Skills Server CLI')
17
- .version('1.0.0');
18
+ .version(pkg.version);
18
19
  program
19
20
  .command('init')
20
21
  .description('Initialize AgCel in the current directory')
21
22
  .action(init_js_1.initCommand);
22
- program
23
- .command('install')
24
- .description('Install AgCel globally')
25
- .action(install_js_1.installCommand);
26
23
  program
27
24
  .command('uninstall')
28
- .description('Uninstall AgCel globally')
25
+ .description('Clean up AgCel configuration and data')
29
26
  .action(uninstall_js_1.uninstallCommand);
30
- program
31
- .command('start')
32
- .description('Start the MCP server locally')
33
- .action(start_js_1.startCommand);
34
- program
35
- .command('stop')
36
- .description('Stop the MCP server locally')
37
- .action(stop_js_1.stopCommand);
38
- program
39
- .command('restart')
40
- .description('Restart the MCP server locally')
41
- .action(restart_js_1.restartCommand);
42
- program
43
- .command('status')
44
- .description('Check the status of the MCP server')
45
- .action(status_js_1.statusCommand);
46
- const skillskCommand = new commander_1.Command('skills');
47
- skillskCommand
27
+ const skillsCommand = new commander_1.Command('skills');
28
+ skillsCommand
48
29
  .command('list')
49
30
  .description('List available skills')
50
31
  .action(() => (0, list_js_1.listCommand)('skills'));
@@ -53,6 +34,6 @@ workflowsCommand
53
34
  .command('list')
54
35
  .description('List available workflows')
55
36
  .action(() => (0, list_js_1.listCommand)('workflows'));
56
- program.addCommand(skillskCommand);
37
+ program.addCommand(skillsCommand);
57
38
  program.addCommand(workflowsCommand);
58
39
  program.parse(process.argv);
@@ -12,13 +12,14 @@ const path_1 = __importDefault(require("path"));
12
12
  const express_1 = __importDefault(require("express"));
13
13
  const cors_1 = __importDefault(require("cors"));
14
14
  const index_js_2 = require("../utils/index.js");
15
+ const pkg = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(__dirname, '..', '..', 'package.json'), 'utf-8'));
15
16
  // Argument parsing for transport mode
16
17
  const args = process.argv.slice(2);
17
18
  const modeIndex = args.indexOf('--mode');
18
19
  const mode = modeIndex !== -1 ? args[modeIndex + 1] : 'stdio'; // Default to stdio if not specified
19
20
  const server = new index_js_1.Server({
20
21
  name: "AgCel",
21
- version: "1.0.0",
22
+ version: pkg.version,
22
23
  }, {
23
24
  capabilities: {
24
25
  tools: {},
@@ -3,16 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AG_CEL_PID_FILE = exports.AG_CEL_CONFIG_FILE = exports.AG_CEL_DIR = void 0;
6
+ exports.AG_CEL_CONFIG_FILE = exports.AG_CEL_DIR = void 0;
7
7
  exports.getPackageRoot = getPackageRoot;
8
8
  exports.getAgCelDir = getAgCelDir;
9
9
  exports.getGlobalAgCelDir = getGlobalAgCelDir;
10
10
  exports.isInitialized = isInitialized;
11
- exports.getPidFile = getPidFile;
12
- exports.savePid = savePid;
13
- exports.getPid = getPid;
14
- exports.removePid = removePid;
15
- exports.isRunning = isRunning;
16
11
  const fs_1 = __importDefault(require("fs"));
17
12
  const path_1 = __importDefault(require("path"));
18
13
  const os_1 = __importDefault(require("os"));
@@ -22,7 +17,6 @@ function getPackageRoot() {
22
17
  }
23
18
  exports.AG_CEL_DIR = '.agc';
24
19
  exports.AG_CEL_CONFIG_FILE = 'config.json';
25
- exports.AG_CEL_PID_FILE = 'mcp-server.pid';
26
20
  function getAgCelDir() {
27
21
  return path_1.default.join(process.cwd(), exports.AG_CEL_DIR);
28
22
  }
@@ -32,32 +26,3 @@ function getGlobalAgCelDir() {
32
26
  function isInitialized() {
33
27
  return fs_1.default.existsSync(getAgCelDir());
34
28
  }
35
- function getPidFile() {
36
- return path_1.default.join(getAgCelDir(), exports.AG_CEL_PID_FILE);
37
- }
38
- function savePid(pid) {
39
- fs_1.default.writeFileSync(getPidFile(), pid.toString());
40
- }
41
- function getPid() {
42
- const pidFile = getPidFile();
43
- if (fs_1.default.existsSync(pidFile)) {
44
- const pid = parseInt(fs_1.default.readFileSync(pidFile, 'utf-8'), 10);
45
- return pid;
46
- }
47
- return null;
48
- }
49
- function removePid() {
50
- const pidFile = getPidFile();
51
- if (fs_1.default.existsSync(pidFile)) {
52
- fs_1.default.unlinkSync(pidFile);
53
- }
54
- }
55
- function isRunning(pid) {
56
- try {
57
- process.kill(pid, 0);
58
- return true;
59
- }
60
- catch (e) {
61
- return false;
62
- }
63
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agcel",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Antigravity Context Engineering Library is a local MCP (Model Context Protocol) Server containing multiple skills, rules and workflows for end to end software development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -51,4 +51,4 @@
51
51
  "@types/node": "^20.11.19",
52
52
  "typescript": "^5.3.3"
53
53
  }
54
- }
54
+ }
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.installCommand = installCommand;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const os_1 = __importDefault(require("os"));
10
- const chalk_1 = __importDefault(require("chalk"));
11
- const child_process_1 = require("child_process");
12
- const index_js_1 = require("../utils/index.js");
13
- async function installCommand() {
14
- const globalDir = (0, index_js_1.getGlobalAgCelDir)();
15
- const packageRoot = (0, index_js_1.getPackageRoot)();
16
- console.log(chalk_1.default.blue('Installing AgCel globally...'));
17
- try {
18
- // 1. Create global directory
19
- if (!fs_1.default.existsSync(globalDir)) {
20
- console.log(chalk_1.default.blue(`Creating global directory at ${globalDir}...`));
21
- fs_1.default.mkdirSync(globalDir, { recursive: true });
22
- }
23
- else {
24
- console.log(chalk_1.default.yellow(`Global directory already exists at ${globalDir}. Updating...`));
25
- }
26
- // 2. Copy necessary files (dist, skills, workflows, package.json)
27
- const dirsToCopy = [
28
- { src: 'dist', dest: 'dist' },
29
- { src: 'skills', dest: 'skills' },
30
- { src: '.agent/workflows', dest: 'workflows' } // Normalize workflows path
31
- ];
32
- for (const dir of dirsToCopy) {
33
- const srcPath = path_1.default.join(packageRoot, dir.src);
34
- const destPath = path_1.default.join(globalDir, dir.dest);
35
- if (fs_1.default.existsSync(srcPath)) {
36
- console.log(chalk_1.default.blue(`Copying ${dir.src} to ${destPath}...`));
37
- // Remove destination if it exists to ensure clean copy
38
- if (fs_1.default.existsSync(destPath)) {
39
- fs_1.default.rmSync(destPath, { recursive: true, force: true });
40
- }
41
- fs_1.default.cpSync(srcPath, destPath, { recursive: true });
42
- }
43
- else {
44
- console.warn(chalk_1.default.yellow(`Warning: Source directory ${srcPath} not found.`));
45
- }
46
- }
47
- // Copy package.json for dependencies
48
- const packageJsonSrc = path_1.default.join(packageRoot, 'package.json');
49
- const packageJsonDest = path_1.default.join(globalDir, 'package.json');
50
- if (fs_1.default.existsSync(packageJsonSrc)) {
51
- fs_1.default.copyFileSync(packageJsonSrc, packageJsonDest);
52
- }
53
- // 3. Install dependencies in global dir
54
- console.log(chalk_1.default.blue('Installing dependencies in global directory...'));
55
- try {
56
- (0, child_process_1.execSync)('npm install --production', { cwd: globalDir, stdio: 'inherit' });
57
- }
58
- catch (e) {
59
- console.error(chalk_1.default.red('Failed to install dependencies.'), e);
60
- }
61
- // 4. Register with Antigravity
62
- const mcpConfigPath = path_1.default.join(os_1.default.homedir(), '.gemini/antigravity/mcp_config.json');
63
- let mcpConfig = { mcpServers: {} };
64
- if (fs_1.default.existsSync(mcpConfigPath)) {
65
- try {
66
- const content = fs_1.default.readFileSync(mcpConfigPath, 'utf-8');
67
- if (content.trim()) {
68
- mcpConfig = JSON.parse(content);
69
- }
70
- }
71
- catch (e) {
72
- console.warn(chalk_1.default.yellow('Existing MCP config invalid. Creating new.'));
73
- }
74
- }
75
- else {
76
- fs_1.default.mkdirSync(path_1.default.dirname(mcpConfigPath), { recursive: true });
77
- }
78
- if (!mcpConfig.mcpServers)
79
- mcpConfig.mcpServers = {};
80
- const serverPath = path_1.default.join(globalDir, 'dist/server/index.js');
81
- mcpConfig.mcpServers['agcel'] = {
82
- command: 'node',
83
- args: [serverPath],
84
- env: {
85
- // Ensure the server knows where to find everything
86
- NODE_ENV: 'production'
87
- }
88
- };
89
- fs_1.default.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
90
- console.log(chalk_1.default.green(`Successfully registered AgCel in ${mcpConfigPath}`));
91
- console.log(chalk_1.default.green('AgCel installed successfully!'));
92
- console.log(chalk_1.default.cyan('You can now run "agc init" in your projects to set them up.'));
93
- }
94
- catch (error) {
95
- console.error(chalk_1.default.red('Failed to install AgCel:'), error);
96
- process.exit(1);
97
- }
98
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.restartCommand = restartCommand;
7
- const stop_js_1 = require("./stop.js");
8
- const start_js_1 = require("./start.js");
9
- const chalk_1 = __importDefault(require("chalk"));
10
- function restartCommand() {
11
- console.log(chalk_1.default.blue('Restarting AgCel MCP server...'));
12
- (0, stop_js_1.stopCommand)();
13
- // Add a small delay to ensure the port is released
14
- setTimeout(() => {
15
- (0, start_js_1.startCommand)();
16
- }, 1000);
17
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startCommand = startCommand;
7
- const child_process_1 = require("child_process");
8
- const path_1 = __importDefault(require("path"));
9
- const fs_1 = __importDefault(require("fs"));
10
- const chalk_1 = __importDefault(require("chalk"));
11
- const index_js_1 = require("../utils/index.js");
12
- function startCommand() {
13
- if (!(0, index_js_1.isInitialized)()) {
14
- console.error(chalk_1.default.red('AgCel is not initialized. Run "agc init" first.'));
15
- return;
16
- }
17
- const existingPid = (0, index_js_1.getPid)();
18
- if (existingPid && (0, index_js_1.isRunning)(existingPid)) {
19
- console.log(chalk_1.default.yellow(`AgCel MCP server is already running (PID: ${existingPid})`));
20
- return;
21
- }
22
- console.log(chalk_1.default.blue('Starting AgCel MCP server...'));
23
- const serverScript = path_1.default.resolve(__dirname, '../../dist/server/index.js');
24
- const logFile = path_1.default.join((0, index_js_1.getAgCelDir)(), 'server.log');
25
- const out = fs_1.default.openSync(logFile, 'a');
26
- const err = fs_1.default.openSync(logFile, 'a');
27
- const child = (0, child_process_1.spawn)('node', [serverScript, '--mode', 'sse'], {
28
- detached: true,
29
- stdio: ['ignore', out, err],
30
- cwd: process.cwd()
31
- });
32
- if (child.pid) {
33
- (0, index_js_1.savePid)(child.pid);
34
- child.unref();
35
- console.log(chalk_1.default.green(`AgCel MCP server started successfully (PID: ${child.pid})`));
36
- console.log(chalk_1.default.cyan(`Logs are being written to ${logFile}`));
37
- }
38
- else {
39
- console.error(chalk_1.default.red('Failed to start AgCel MCP server.'));
40
- }
41
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.statusCommand = statusCommand;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const index_js_1 = require("../utils/index.js");
9
- function statusCommand() {
10
- if (!(0, index_js_1.isInitialized)()) {
11
- console.log(chalk_1.default.red('AgCel is not initialized. Run "agc init" first.'));
12
- return;
13
- }
14
- const pid = (0, index_js_1.getPid)();
15
- if (pid && (0, index_js_1.isRunning)(pid)) {
16
- console.log(chalk_1.default.green(`AgCel MCP server is running (PID: ${pid})`));
17
- }
18
- else {
19
- console.log(chalk_1.default.yellow('AgCel MCP server is stopped'));
20
- if (pid) {
21
- console.log(chalk_1.default.yellow('(PID file exists but process is not running)'));
22
- }
23
- }
24
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.stopCommand = stopCommand;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const index_js_1 = require("../utils/index.js");
9
- function stopCommand() {
10
- const pid = (0, index_js_1.getPid)();
11
- if (!pid) {
12
- console.log(chalk_1.default.yellow('AgCel MCP server is not running (no PID file found).'));
13
- return;
14
- }
15
- if (!(0, index_js_1.isRunning)(pid)) {
16
- console.log(chalk_1.default.yellow(`AgCel MCP server is not running (PID ${pid} not found). Cleaning up PID file.`));
17
- (0, index_js_1.removePid)();
18
- return;
19
- }
20
- console.log(chalk_1.default.blue(`Stopping AgCel MCP server (PID: ${pid})...`));
21
- try {
22
- process.kill(pid);
23
- (0, index_js_1.removePid)();
24
- console.log(chalk_1.default.green('AgCel MCP server stopped successfully.'));
25
- }
26
- catch (error) {
27
- console.error(chalk_1.default.red('Failed to stop AgCel MCP server:'), error);
28
- }
29
- }