@magic-ingredients/tiny-brain-local 0.5.1 → 0.6.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/README.md +202 -23
- package/dist/cli/cli-factory.d.ts +3 -0
- package/dist/cli/cli-factory.d.ts.map +1 -0
- package/dist/cli/cli-factory.js +113 -0
- package/dist/cli/cli-factory.js.map +1 -0
- package/dist/cli/commands/install.command.d.ts +23 -0
- package/dist/cli/commands/install.command.d.ts.map +1 -0
- package/dist/cli/commands/install.command.js +189 -0
- package/dist/cli/commands/install.command.js.map +1 -0
- package/dist/cli/commands/list.command.d.ts +15 -0
- package/dist/cli/commands/list.command.d.ts.map +1 -0
- package/dist/cli/commands/list.command.js +90 -0
- package/dist/cli/commands/list.command.js.map +1 -0
- package/dist/cli/commands/status.command.d.ts +19 -0
- package/dist/cli/commands/status.command.d.ts.map +1 -0
- package/dist/cli/commands/status.command.js +104 -0
- package/dist/cli/commands/status.command.js.map +1 -0
- package/dist/cli/commands/uninstall.command.d.ts +23 -0
- package/dist/cli/commands/uninstall.command.d.ts.map +1 -0
- package/dist/cli/commands/uninstall.command.js +176 -0
- package/dist/cli/commands/uninstall.command.js.map +1 -0
- package/dist/cli/installers/base-installer.d.ts +20 -0
- package/dist/cli/installers/base-installer.d.ts.map +1 -0
- package/dist/cli/installers/base-installer.js +3 -0
- package/dist/cli/installers/base-installer.js.map +1 -0
- package/dist/cli/installers/chatgpt-installer.d.ts +18 -0
- package/dist/cli/installers/chatgpt-installer.d.ts.map +1 -0
- package/dist/cli/installers/chatgpt-installer.js +45 -0
- package/dist/cli/installers/chatgpt-installer.js.map +1 -0
- package/dist/cli/installers/claude-code-installer.d.ts +23 -0
- package/dist/cli/installers/claude-code-installer.d.ts.map +1 -0
- package/dist/cli/installers/claude-code-installer.js +106 -0
- package/dist/cli/installers/claude-code-installer.js.map +1 -0
- package/dist/cli/installers/claude-desktop-installer.d.ts +18 -0
- package/dist/cli/installers/claude-desktop-installer.d.ts.map +1 -0
- package/dist/cli/installers/claude-desktop-installer.js +48 -0
- package/dist/cli/installers/claude-desktop-installer.js.map +1 -0
- package/dist/cli/installers/cursor-installer.d.ts +18 -0
- package/dist/cli/installers/cursor-installer.d.ts.map +1 -0
- package/dist/cli/installers/cursor-installer.js +45 -0
- package/dist/cli/installers/cursor-installer.js.map +1 -0
- package/dist/cli/installers/installer-factory.d.ts +30 -0
- package/dist/cli/installers/installer-factory.d.ts.map +1 -0
- package/dist/cli/installers/installer-factory.js +89 -0
- package/dist/cli/installers/installer-factory.js.map +1 -0
- package/dist/cli/utils/node-resolver.d.ts +53 -0
- package/dist/cli/utils/node-resolver.d.ts.map +1 -0
- package/dist/cli/utils/node-resolver.js +200 -0
- package/dist/cli/utils/node-resolver.js.map +1 -0
- package/dist/cli/utils/package-locator.d.ts +9 -0
- package/dist/cli/utils/package-locator.d.ts.map +1 -0
- package/dist/cli/utils/package-locator.js +81 -0
- package/dist/cli/utils/package-locator.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -0
- package/dist/prompts/prompt-registry.js +6 -6
- package/dist/prompts/prompt-registry.js.map +1 -1
- package/dist/prompts/rules/rules.prompt.d.ts +32 -0
- package/dist/prompts/rules/rules.prompt.d.ts.map +1 -0
- package/dist/prompts/{memory/memory.prompt.js → rules/rules.prompt.js} +64 -58
- package/dist/prompts/rules/rules.prompt.js.map +1 -0
- package/dist/storage/platform-config-adapter.d.ts +42 -0
- package/dist/storage/platform-config-adapter.d.ts.map +1 -0
- package/dist/storage/platform-config-adapter.js +128 -0
- package/dist/storage/platform-config-adapter.js.map +1 -0
- package/dist/storage/platform-path-builder.d.ts +32 -0
- package/dist/storage/platform-path-builder.d.ts.map +1 -0
- package/dist/storage/platform-path-builder.js +93 -0
- package/dist/storage/platform-path-builder.js.map +1 -0
- package/dist/tools/persona/as.tool.d.ts +4 -4
- package/dist/tools/persona/as.tool.d.ts.map +1 -1
- package/dist/tools/persona/as.tool.js +150 -117
- package/dist/tools/persona/as.tool.js.map +1 -1
- package/dist/tools/{memory/memory.tool.d.ts → rules/rules.tool.d.ts} +5 -5
- package/dist/tools/rules/rules.tool.d.ts.map +1 -0
- package/dist/tools/rules/rules.tool.js +133 -0
- package/dist/tools/rules/rules.tool.js.map +1 -0
- package/dist/tools/tool-registry.js +4 -4
- package/dist/tools/tool-registry.js.map +1 -1
- package/package.json +12 -2
- package/dist/prompts/memory/memory.prompt.d.ts +0 -32
- package/dist/prompts/memory/memory.prompt.d.ts.map +0 -1
- package/dist/prompts/memory/memory.prompt.js.map +0 -1
- package/dist/tools/memory/memory.tool.d.ts.map +0 -1
- package/dist/tools/memory/memory.tool.js +0 -110
- package/dist/tools/memory/memory.tool.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,22 +1,155 @@
|
|
|
1
1
|
# @magic-ingredients/tiny-brain-local
|
|
2
2
|
|
|
3
|
-
Local MCP server implementation for Tiny Brain AI assistant.
|
|
3
|
+
Local MCP server implementation for Tiny Brain AI assistant with CLI installation tool.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
This package
|
|
7
|
+
This package serves dual purposes:
|
|
8
|
+
1. **MCP Server**: A local MCP (Model Context Protocol) server that runs on your machine using stdio transport
|
|
9
|
+
2. **CLI Tool**: A command-line tool to install the MCP server across different AI platforms
|
|
8
10
|
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
13
|
+
### Option 1: NPM Global Installation (Recommended)
|
|
14
|
+
|
|
11
15
|
```bash
|
|
12
16
|
npm install -g @magic-ingredients/tiny-brain-local
|
|
13
17
|
```
|
|
14
18
|
|
|
19
|
+
### Option 2: DXT Package Installation
|
|
20
|
+
|
|
21
|
+
For Claude Desktop users who prefer DXT packages:
|
|
22
|
+
|
|
23
|
+
1. Download the latest `.dxt` package from [tiny-brain.com](https://tiny-brain.com)
|
|
24
|
+
2. Install using the DXT tool in Claude Desktop
|
|
25
|
+
|
|
15
26
|
## Usage
|
|
16
27
|
|
|
17
|
-
###
|
|
28
|
+
### As MCP Server
|
|
29
|
+
|
|
30
|
+
When run without arguments, tiny-brain operates as an MCP server:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
tiny-brain
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### As CLI Installation Tool
|
|
37
|
+
|
|
38
|
+
The CLI provides commands to install, uninstall, and manage the MCP server across different AI platforms.
|
|
39
|
+
|
|
40
|
+
#### Install Command
|
|
41
|
+
|
|
42
|
+
Install tiny-brain on specific platforms or interactively:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Interactive installation (recommended)
|
|
46
|
+
tiny-brain install
|
|
47
|
+
|
|
48
|
+
# Install on specific platform
|
|
49
|
+
tiny-brain install claude-code
|
|
50
|
+
tiny-brain install claude-desktop
|
|
51
|
+
tiny-brain install cursor
|
|
52
|
+
tiny-brain install chatgpt
|
|
53
|
+
|
|
54
|
+
# Install on all supported platforms
|
|
55
|
+
tiny-brain install --all
|
|
56
|
+
|
|
57
|
+
# Install with validation
|
|
58
|
+
tiny-brain install --validate
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Uninstall Command
|
|
62
|
+
|
|
63
|
+
Remove tiny-brain from platforms:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Interactive uninstallation
|
|
67
|
+
tiny-brain uninstall
|
|
68
|
+
|
|
69
|
+
# Uninstall from specific platform
|
|
70
|
+
tiny-brain uninstall claude-code
|
|
71
|
+
|
|
72
|
+
# Uninstall from all platforms
|
|
73
|
+
tiny-brain uninstall --all
|
|
74
|
+
|
|
75
|
+
# Skip confirmation prompt
|
|
76
|
+
tiny-brain uninstall --force
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Status Command
|
|
80
|
+
|
|
81
|
+
Check installation status across platforms:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Check all platforms
|
|
85
|
+
tiny-brain status
|
|
86
|
+
|
|
87
|
+
# Check specific platform
|
|
88
|
+
tiny-brain status --platform claude-code
|
|
89
|
+
|
|
90
|
+
# Show detailed information
|
|
91
|
+
tiny-brain status --verbose
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### List Command
|
|
95
|
+
|
|
96
|
+
List all supported platforms:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# List supported platforms
|
|
100
|
+
tiny-brain list
|
|
101
|
+
|
|
102
|
+
# Show which platforms are detected on system
|
|
103
|
+
tiny-brain list --detected
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Supported Platforms
|
|
107
|
+
|
|
108
|
+
| Platform | Description | Config Location |
|
|
109
|
+
|----------|-------------|-----------------|
|
|
110
|
+
| **Claude Code** | Anthropic's AI coding assistant CLI tool | `~/.claude/code/config.json` |
|
|
111
|
+
| **Claude Desktop** | Desktop chat application for Claude AI | Platform-specific (see below) |
|
|
112
|
+
| **Cursor IDE** | AI-powered code editor built on VSCode | `~/.cursor/config.json` |
|
|
113
|
+
| **ChatGPT Desktop** | OpenAI's desktop chat application | Platform-specific |
|
|
114
|
+
|
|
115
|
+
### Platform-Specific Config Locations
|
|
116
|
+
|
|
117
|
+
**Claude Desktop:**
|
|
118
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
119
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
120
|
+
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
18
121
|
|
|
19
|
-
|
|
122
|
+
## Features
|
|
123
|
+
|
|
124
|
+
### MCP Server Features
|
|
125
|
+
|
|
126
|
+
- **Personas**: Context-aware AI personalities with memory
|
|
127
|
+
- **Rules System**: Universal directives that apply across all personas
|
|
128
|
+
- **Planning**: Collaborative task management and tracking
|
|
129
|
+
- **Thinking**: Structured reasoning chains with consistency checking
|
|
130
|
+
- **Strategies**: Content generation strategies for different scenarios
|
|
131
|
+
- **Updates**: Automatic version checking and update notifications
|
|
132
|
+
|
|
133
|
+
### CLI Features
|
|
134
|
+
|
|
135
|
+
- **Interactive Mode**: User-friendly prompts for platform selection
|
|
136
|
+
- **Multi-Platform Support**: Install on multiple platforms simultaneously
|
|
137
|
+
- **Validation**: Test server startup during installation
|
|
138
|
+
- **Bundled Runtime Detection**: Automatically uses bundled Node.js from AI platforms
|
|
139
|
+
- **Progress Indicators**: Visual feedback with emojis during operations
|
|
140
|
+
- **Backup & Restore**: Automatic config backup before modifications
|
|
141
|
+
|
|
142
|
+
## Storage
|
|
143
|
+
|
|
144
|
+
All Tiny Brain data is stored locally. See [Storage Paths Documentation](../../docs/storage-paths.md) for detailed information about data storage locations and configuration.
|
|
145
|
+
|
|
146
|
+
## Manual Configuration
|
|
147
|
+
|
|
148
|
+
If you prefer to configure manually or the CLI doesn't work for your setup:
|
|
149
|
+
|
|
150
|
+
### Claude Desktop
|
|
151
|
+
|
|
152
|
+
Add to your Claude Desktop config file:
|
|
20
153
|
|
|
21
154
|
```json
|
|
22
155
|
{
|
|
@@ -29,30 +162,56 @@ Add to your Claude Desktop config:
|
|
|
29
162
|
}
|
|
30
163
|
```
|
|
31
164
|
|
|
32
|
-
###
|
|
165
|
+
### Claude Code
|
|
33
166
|
|
|
34
|
-
|
|
35
|
-
|
|
167
|
+
Add to `~/.claude/code/config.json`:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"servers": {
|
|
172
|
+
"tiny-brain": {
|
|
173
|
+
"command": "npx",
|
|
174
|
+
"args": ["@magic-ingredients/tiny-brain-local"]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
36
178
|
```
|
|
37
179
|
|
|
38
|
-
##
|
|
180
|
+
## Troubleshooting
|
|
39
181
|
|
|
40
|
-
|
|
41
|
-
- **Memory**: Persistent knowledge storage
|
|
42
|
-
- **Planning**: Task management and tracking
|
|
43
|
-
- **Thinking**: Structured reasoning chains
|
|
44
|
-
- **Strategies**: Content generation strategies
|
|
45
|
-
- **Updates**: Auto-update checking
|
|
182
|
+
### Common Issues
|
|
46
183
|
|
|
47
|
-
|
|
184
|
+
**Installation fails with "command not found"**
|
|
185
|
+
- Ensure Node.js 18+ is installed: `node --version`
|
|
186
|
+
- If using NPM, ensure global packages are in PATH
|
|
187
|
+
- Try using `npx` directly: `npx @magic-ingredients/tiny-brain-local install`
|
|
48
188
|
|
|
49
|
-
|
|
189
|
+
**"Platform not detected" error**
|
|
190
|
+
- The CLI couldn't find the AI application
|
|
191
|
+
- Check if the application is installed in the standard location
|
|
192
|
+
- Use manual configuration as a fallback
|
|
50
193
|
|
|
51
|
-
|
|
194
|
+
**Permission denied errors**
|
|
195
|
+
- On macOS/Linux, you may need to use `sudo` for global installation
|
|
196
|
+
- Alternatively, use npx to run without installing: `npx @magic-ingredients/tiny-brain-local`
|
|
52
197
|
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
198
|
+
**Server validation fails**
|
|
199
|
+
- Ensure no other process is using the required ports
|
|
200
|
+
- Check firewall settings aren't blocking the application
|
|
201
|
+
- Try installing without validation: remove `--validate` flag
|
|
202
|
+
|
|
203
|
+
**Config file not found**
|
|
204
|
+
- Some platforms may not create config files until first launch
|
|
205
|
+
- Launch the AI application once before running the installer
|
|
206
|
+
- Create the config directory manually if needed
|
|
207
|
+
|
|
208
|
+
### Debug Mode
|
|
209
|
+
|
|
210
|
+
For troubleshooting, you can run with debug output:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
DEBUG=tiny-brain* tiny-brain install
|
|
214
|
+
```
|
|
56
215
|
|
|
57
216
|
## Development
|
|
58
217
|
|
|
@@ -60,16 +219,28 @@ All data is stored locally in `~/.claude/tiny-brain/` directory.
|
|
|
60
219
|
# Install dependencies
|
|
61
220
|
npm install
|
|
62
221
|
|
|
63
|
-
# Build
|
|
222
|
+
# Build both server and CLI
|
|
64
223
|
npm run build
|
|
65
224
|
|
|
66
225
|
# Run tests
|
|
67
226
|
npm test
|
|
68
227
|
|
|
69
|
-
# Development mode
|
|
228
|
+
# Development mode (watches for changes)
|
|
70
229
|
npm run dev
|
|
230
|
+
|
|
231
|
+
# Test CLI locally
|
|
232
|
+
npm run build && node dist/cli.js install
|
|
71
233
|
```
|
|
72
234
|
|
|
235
|
+
## Dependencies
|
|
236
|
+
|
|
237
|
+
- `@magic-ingredients/tiny-brain-core`: Core business logic
|
|
238
|
+
- `@modelcontextprotocol/sdk`: MCP protocol implementation
|
|
239
|
+
- `commander`: CLI framework
|
|
240
|
+
- `inquirer`: Interactive command line prompts
|
|
241
|
+
- `chalk`: Terminal string styling
|
|
242
|
+
- `zod`: Schema validation
|
|
243
|
+
|
|
73
244
|
## License
|
|
74
245
|
|
|
75
246
|
MIT
|
|
@@ -78,4 +249,12 @@ MIT
|
|
|
78
249
|
|
|
79
250
|
- [GitHub Repository](https://github.com/magic-ingredients/tiny-brain)
|
|
80
251
|
- [Core Package](https://www.npmjs.com/package/@magic-ingredients/tiny-brain-core)
|
|
81
|
-
- [
|
|
252
|
+
- [NPM Package](https://www.npmjs.com/package/@magic-ingredients/tiny-brain-local)
|
|
253
|
+
- [DXT Registry](https://dxt.modelcontextprotocol.io/server/tiny-brain)
|
|
254
|
+
- [Documentation](https://github.com/magic-ingredients/tiny-brain#readme)
|
|
255
|
+
|
|
256
|
+
## Support
|
|
257
|
+
|
|
258
|
+
For issues, questions, or contributions:
|
|
259
|
+
- [GitHub Issues](https://github.com/magic-ingredients/tiny-brain/issues)
|
|
260
|
+
- [Discussions](https://github.com/magic-ingredients/tiny-brain/discussions)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-factory.d.ts","sourceRoot":"","sources":["../../src/cli/cli-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,SAAS,IAAI,OAAO,CAyGnC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { InstallCommand } from './commands/install.command.js';
|
|
3
|
+
import { UninstallCommand } from './commands/uninstall.command.js';
|
|
4
|
+
import { StatusCommand } from './commands/status.command.js';
|
|
5
|
+
import { ListCommand } from './commands/list.command.js';
|
|
6
|
+
import { InstallerFactory } from './installers/installer-factory.js';
|
|
7
|
+
import { PlatformConfigAdapter } from '../storage/platform-config-adapter.js';
|
|
8
|
+
import { NodeResolver } from './utils/node-resolver.js';
|
|
9
|
+
import * as os from 'os';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
export function createCLI() {
|
|
12
|
+
const program = new Command();
|
|
13
|
+
// Initialize dependencies
|
|
14
|
+
const baseDir = path.join(os.homedir(), '.tiny-brain');
|
|
15
|
+
const configAdapter = new PlatformConfigAdapter({ baseDir, autoCreate: true });
|
|
16
|
+
const nodeResolver = new NodeResolver();
|
|
17
|
+
const installerFactory = new InstallerFactory(configAdapter, nodeResolver);
|
|
18
|
+
// Initialize commands
|
|
19
|
+
const installCommand = new InstallCommand(installerFactory);
|
|
20
|
+
const uninstallCommand = new UninstallCommand(installerFactory);
|
|
21
|
+
const statusCommand = new StatusCommand(installerFactory);
|
|
22
|
+
const listCommand = new ListCommand(installerFactory);
|
|
23
|
+
program
|
|
24
|
+
.name('tiny-brain')
|
|
25
|
+
.description('🧠 Tiny Brain MCP Server - Installation and Management CLI');
|
|
26
|
+
// Install command
|
|
27
|
+
program
|
|
28
|
+
.command('install [platform]')
|
|
29
|
+
.description('Install tiny-brain MCP server for an AI platform')
|
|
30
|
+
.option('--all', 'Install for all supported platforms')
|
|
31
|
+
.option('-s, --scope <scope>', 'Configuration scope (local/user/project)', 'local')
|
|
32
|
+
.option('-n, --name <name>', 'Server name', 'tiny-brain')
|
|
33
|
+
.option('--validate', 'Validate server startup during installation')
|
|
34
|
+
.action(async (platform, options) => {
|
|
35
|
+
try {
|
|
36
|
+
await installCommand.execute({
|
|
37
|
+
platform,
|
|
38
|
+
all: options.all,
|
|
39
|
+
scope: options.scope,
|
|
40
|
+
name: options.name,
|
|
41
|
+
validate: options.validate
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error('Installation failed:', error);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
// Uninstall command
|
|
50
|
+
program
|
|
51
|
+
.command('uninstall [platform]')
|
|
52
|
+
.description('Uninstall tiny-brain MCP server from an AI platform')
|
|
53
|
+
.option('--all', 'Uninstall from all installed platforms')
|
|
54
|
+
.option('-s, --scope <scope>', 'Configuration scope (local/user/project)', 'local')
|
|
55
|
+
.option('-n, --name <name>', 'Server name', 'tiny-brain')
|
|
56
|
+
.option('-f, --force', 'Skip confirmation prompt')
|
|
57
|
+
.action(async (platform, options) => {
|
|
58
|
+
try {
|
|
59
|
+
await uninstallCommand.execute({
|
|
60
|
+
platform,
|
|
61
|
+
all: options.all,
|
|
62
|
+
scope: options.scope,
|
|
63
|
+
name: options.name,
|
|
64
|
+
force: options.force
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('Uninstallation failed:', error);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
// Status command
|
|
73
|
+
program
|
|
74
|
+
.command('status')
|
|
75
|
+
.description('Check installation status for all platforms')
|
|
76
|
+
.option('-n, --name <name>', 'Server name', 'tiny-brain')
|
|
77
|
+
.option('-s, --scope <scope>', 'Configuration scope (local/user/project)', 'local')
|
|
78
|
+
.option('-p, --platform <platform>', 'Check specific platform')
|
|
79
|
+
.option('-v, --verbose', 'Show detailed information')
|
|
80
|
+
.action(async (options) => {
|
|
81
|
+
try {
|
|
82
|
+
await statusCommand.execute({
|
|
83
|
+
name: options.name,
|
|
84
|
+
scope: options.scope,
|
|
85
|
+
platform: options.platform,
|
|
86
|
+
verbose: options.verbose
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error('Status check failed:', error);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
// List command
|
|
95
|
+
program
|
|
96
|
+
.command('list')
|
|
97
|
+
.alias('ls')
|
|
98
|
+
.description('List all supported platforms')
|
|
99
|
+
.option('-d, --detected', 'Show which platforms are detected on the system')
|
|
100
|
+
.action(async (options) => {
|
|
101
|
+
try {
|
|
102
|
+
await listCommand.execute({
|
|
103
|
+
showDetected: options.detected
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.error('List command failed:', error);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return program;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=cli-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-factory.js","sourceRoot":"","sources":["../../src/cli/cli-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,UAAU,SAAS;IACvB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,0BAA0B;IAC1B,MAAM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B,EAAE,yBAAyB,CAAC;SAC9D,MAAM,CAAC,eAAe,EAAE,2BAA2B,CAAC;SACpD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,aAAa,CAAC,OAAO,CAAC;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,eAAe;IACf,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,KAAK,CAAC,IAAI,CAAC;SACX,WAAW,CAAC,8BAA8B,CAAC;SAC3C,MAAM,CAAC,gBAAgB,EAAE,iDAAiD,CAAC;SAC3E,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,OAAO,CAAC;gBACxB,YAAY,EAAE,OAAO,CAAC,QAAQ;aAC/B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InstallerFactory } from '../installers/installer-factory.js';
|
|
2
|
+
import { ConfigScope } from '../../storage/platform-path-builder.js';
|
|
3
|
+
interface InstallOptions {
|
|
4
|
+
platform?: string;
|
|
5
|
+
all?: boolean;
|
|
6
|
+
scope?: ConfigScope;
|
|
7
|
+
name?: string;
|
|
8
|
+
validate?: boolean;
|
|
9
|
+
env?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export declare class InstallCommand {
|
|
12
|
+
private factory;
|
|
13
|
+
constructor(factory: InstallerFactory);
|
|
14
|
+
execute(options?: InstallOptions): Promise<void>;
|
|
15
|
+
private findServerPath;
|
|
16
|
+
private determinePlatforms;
|
|
17
|
+
private promptForPlatforms;
|
|
18
|
+
private getPlatformDisplayName;
|
|
19
|
+
private installPlatforms;
|
|
20
|
+
private showSummary;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=install.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAQD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAmB;gBAEtB,OAAO,EAAE,gBAAgB;IAI/B,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;YA4B5C,cAAc;YAQd,kBAAkB;YAelB,kBAAkB;IAuChC,OAAO,CAAC,sBAAsB;YAWhB,gBAAgB;IAgF9B,OAAO,CAAC,WAAW;CA6BpB"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import { PackageLocator } from '../utils/package-locator.js';
|
|
4
|
+
export class InstallCommand {
|
|
5
|
+
factory;
|
|
6
|
+
constructor(factory) {
|
|
7
|
+
this.factory = factory;
|
|
8
|
+
}
|
|
9
|
+
async execute(options = {}) {
|
|
10
|
+
console.log(chalk.cyan.bold('\n🚀 tiny-brain MCP Server Installer\n'));
|
|
11
|
+
// Find the package installation path
|
|
12
|
+
const serverPath = await this.findServerPath();
|
|
13
|
+
if (!serverPath) {
|
|
14
|
+
console.error(chalk.red('❌ Could not find tiny-brain installation'));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
console.log(chalk.gray(`📦 Found tiny-brain at: ${serverPath}`));
|
|
18
|
+
// Determine which platforms to install
|
|
19
|
+
const platforms = await this.determinePlatforms(options);
|
|
20
|
+
if (platforms.length === 0) {
|
|
21
|
+
console.log(chalk.yellow('⚠️ No platforms selected for installation'));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// Install for each selected platform
|
|
25
|
+
console.log(chalk.cyan(`\n✨ Installing for ${platforms.length} platform(s)...\n`));
|
|
26
|
+
const results = await this.installPlatforms(platforms, serverPath, options);
|
|
27
|
+
// Show summary
|
|
28
|
+
this.showSummary(results);
|
|
29
|
+
}
|
|
30
|
+
async findServerPath() {
|
|
31
|
+
try {
|
|
32
|
+
return await PackageLocator.findPackage();
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async determinePlatforms(options) {
|
|
39
|
+
// If specific platform provided
|
|
40
|
+
if (options.platform) {
|
|
41
|
+
return [options.platform];
|
|
42
|
+
}
|
|
43
|
+
// If --all flag is set
|
|
44
|
+
if (options.all) {
|
|
45
|
+
return this.factory.getSupportedPlatforms();
|
|
46
|
+
}
|
|
47
|
+
// Interactive mode
|
|
48
|
+
return await this.promptForPlatforms();
|
|
49
|
+
}
|
|
50
|
+
async promptForPlatforms() {
|
|
51
|
+
const supportedPlatforms = this.factory.getSupportedPlatforms();
|
|
52
|
+
const choices = [
|
|
53
|
+
{
|
|
54
|
+
name: chalk.bold('📦 Install All'),
|
|
55
|
+
value: 'all',
|
|
56
|
+
checked: false
|
|
57
|
+
},
|
|
58
|
+
...supportedPlatforms.map(platform => ({
|
|
59
|
+
name: this.getPlatformDisplayName(platform),
|
|
60
|
+
value: platform,
|
|
61
|
+
checked: false
|
|
62
|
+
}))
|
|
63
|
+
];
|
|
64
|
+
const { platforms } = await inquirer.prompt([
|
|
65
|
+
{
|
|
66
|
+
type: 'checkbox',
|
|
67
|
+
name: 'platforms',
|
|
68
|
+
message: '🎯 Select platforms to install tiny-brain on:',
|
|
69
|
+
choices,
|
|
70
|
+
validate: (answer) => {
|
|
71
|
+
if (answer.length === 0) {
|
|
72
|
+
return 'You must select at least one platform';
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]);
|
|
78
|
+
// Handle "Install All" selection
|
|
79
|
+
if (platforms.includes('all')) {
|
|
80
|
+
return supportedPlatforms;
|
|
81
|
+
}
|
|
82
|
+
return platforms;
|
|
83
|
+
}
|
|
84
|
+
getPlatformDisplayName(platform) {
|
|
85
|
+
const displayNames = {
|
|
86
|
+
'claude-code': '🤖 Claude Code',
|
|
87
|
+
'claude-desktop': '💻 Claude Desktop',
|
|
88
|
+
'cursor': '⚡ Cursor IDE',
|
|
89
|
+
'chatgpt': '🧠 ChatGPT Desktop'
|
|
90
|
+
};
|
|
91
|
+
return displayNames[platform] || platform;
|
|
92
|
+
}
|
|
93
|
+
async installPlatforms(platforms, serverPath, options) {
|
|
94
|
+
const results = new Map();
|
|
95
|
+
for (const platform of platforms) {
|
|
96
|
+
console.log(chalk.cyan.bold(`\n🚀 Installing Tiny Brain for ${platform}...`));
|
|
97
|
+
try {
|
|
98
|
+
const installer = this.factory.getInstaller(platform);
|
|
99
|
+
// Detect and display runtime information
|
|
100
|
+
console.log(chalk.gray(`🔍 Detecting runtime environment...`));
|
|
101
|
+
// Access the node resolver through the installer
|
|
102
|
+
const nodeResolver = installer.nodeResolver;
|
|
103
|
+
if (nodeResolver) {
|
|
104
|
+
try {
|
|
105
|
+
const nodeRuntime = await nodeResolver.findNodeRuntime(platform);
|
|
106
|
+
if (nodeRuntime) {
|
|
107
|
+
const runtimeType = nodeRuntime.bundled
|
|
108
|
+
? `${platform} bundled runtime`
|
|
109
|
+
: 'system Node.js';
|
|
110
|
+
console.log(chalk.cyan(` 📦 Detected runtime: ${runtimeType}`));
|
|
111
|
+
console.log(chalk.cyan(` 📦 Node version: ${nodeRuntime.version}`));
|
|
112
|
+
console.log(chalk.gray(` 📍 Path: ${nodeRuntime.command}`));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
console.log(chalk.yellow(` ⚠️ No Node.js runtime detected, using system default`));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
console.log(chalk.yellow(` ⚠️ Could not detect Node.js runtime, using system default`));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
console.log(chalk.gray(`📝 Configuring ${this.getPlatformDisplayName(platform)}...`));
|
|
123
|
+
await installer.install(serverPath, {
|
|
124
|
+
scope: options.scope || 'local',
|
|
125
|
+
name: options.name || 'tiny-brain',
|
|
126
|
+
validateServer: options.validate,
|
|
127
|
+
env: options.env
|
|
128
|
+
});
|
|
129
|
+
// Verify installation
|
|
130
|
+
console.log(chalk.gray(`🔍 Verifying installation...`));
|
|
131
|
+
const verified = await installer.verify(options.name || 'tiny-brain', { scope: options.scope || 'local' });
|
|
132
|
+
if (verified) {
|
|
133
|
+
console.log(chalk.green.bold(`✅ Successfully installed tiny-brain for ${this.getPlatformDisplayName(platform)}`));
|
|
134
|
+
if (platform === 'claude-code') {
|
|
135
|
+
console.log(chalk.gray(` 💡 Use "claude mcp refresh" to reload or restart Claude Code`));
|
|
136
|
+
}
|
|
137
|
+
else if (platform === 'claude-desktop') {
|
|
138
|
+
console.log(chalk.gray(` 💡 Restart Claude Desktop for changes to take effect`));
|
|
139
|
+
}
|
|
140
|
+
else if (platform === 'cursor') {
|
|
141
|
+
console.log(chalk.gray(` 💡 Restart Cursor IDE for changes to take effect`));
|
|
142
|
+
}
|
|
143
|
+
results.set(platform, { success: true });
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
console.log(chalk.yellow(`⚠️ Installed but verification failed for ${this.getPlatformDisplayName(platform)}`));
|
|
147
|
+
console.log(chalk.gray(` 💡 Try restarting the application and check the configuration`));
|
|
148
|
+
results.set(platform, { success: false, error: 'Verification failed' });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
153
|
+
console.error(chalk.red(`❌ Installation failed for ${this.getPlatformDisplayName(platform)}: ${errorMessage}`));
|
|
154
|
+
results.set(platform, { success: false, error: errorMessage });
|
|
155
|
+
}
|
|
156
|
+
console.log(); // Empty line between platforms
|
|
157
|
+
}
|
|
158
|
+
return results;
|
|
159
|
+
}
|
|
160
|
+
showSummary(results) {
|
|
161
|
+
console.log(chalk.cyan.bold('📊 Installation Summary:\n'));
|
|
162
|
+
let successCount = 0;
|
|
163
|
+
let failureCount = 0;
|
|
164
|
+
for (const [platform, result] of results) {
|
|
165
|
+
if (result.success) {
|
|
166
|
+
console.log(chalk.green(` ✅ ${this.getPlatformDisplayName(platform)}`));
|
|
167
|
+
successCount++;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
console.log(chalk.red(` ❌ ${this.getPlatformDisplayName(platform)} - ${result.error}`));
|
|
171
|
+
failureCount++;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
console.log();
|
|
175
|
+
if (failureCount === 0) {
|
|
176
|
+
console.log(chalk.green.bold(`🎉 All installations completed successfully!`));
|
|
177
|
+
console.log(chalk.gray(`\n💡 Restart your AI platforms for changes to take effect.`));
|
|
178
|
+
}
|
|
179
|
+
else if (successCount > 0) {
|
|
180
|
+
console.log(chalk.yellow(`⚠️ ${successCount} succeeded, ${failureCount} failed`));
|
|
181
|
+
console.log(chalk.gray(`\n💡 Check the errors above and try again for failed platforms.`));
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
console.log(chalk.red(`❌ All installations failed`));
|
|
185
|
+
console.log(chalk.gray(`\n💡 Please check the errors above and ensure Node.js is installed.`));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=install.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.command.js","sourceRoot":"","sources":["../../../src/cli/commands/install.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAkB7D,MAAM,OAAO,cAAc;IACjB,OAAO,CAAmB;IAElC,YAAY,OAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,UAA0B,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC,CAAC;QAEvE,qCAAqC;QACrC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC/C,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC,CAAC;YACrE,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,2BAA2B,UAAU,EAAE,CAAC,CAAC,CAAC;QAEjE,uCAAuC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CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC1E,YAAY,EAAE,CAAC;YACjB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAC1F,YAAY,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC,CAAC;YAC9E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC,CAAC;QACxF,CAAC;aAAM,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,YAAY,eAAe,YAAY,SAAS,CAAC,CAAC,CAAC;YACnF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC,CAAC;QAC7F,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InstallerFactory } from '../installers/installer-factory.js';
|
|
2
|
+
interface ListOptions {
|
|
3
|
+
showDetected?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare class ListCommand {
|
|
6
|
+
private factory;
|
|
7
|
+
constructor(factory: InstallerFactory);
|
|
8
|
+
execute(options?: ListOptions): Promise<void>;
|
|
9
|
+
private getPlatformInfo;
|
|
10
|
+
private getDetectedPlatforms;
|
|
11
|
+
private getPlatformDetails;
|
|
12
|
+
private displayPlatforms;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=list.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAmB;gBAEtB,OAAO,EAAE,gBAAgB;IAI/B,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YAgBzC,eAAe;YAef,oBAAoB;IASlC,OAAO,CAAC,kBAAkB;IAoC1B,OAAO,CAAC,gBAAgB;CAkBzB"}
|