snaphost 1.3.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 +34 -0
- package/dist/action.js +13 -0
- package/dist/argument.js +51 -0
- package/dist/bin.js +34 -0
- package/dist/client.js +99 -0
- package/dist/connect.js +88 -0
- package/dist/environment.js +1 -0
- package/dist/execute.js +53 -0
- package/dist/node-environment.js +29 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SnapHost
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# snaphost
|
|
2
|
+
|
|
3
|
+
Connect your AI agent to [SnapHost](https://snaphost.ai) in one command.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx snaphost connect
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
It finds the agent clients installed on your machine and configures each one for the hosted
|
|
10
|
+
SnapHost MCP server (`https://app.snaphost.ai/api/mcp`). No token or password is involved: the
|
|
11
|
+
first time a client uses SnapHost, your browser opens so you can click **Authorize**.
|
|
12
|
+
|
|
13
|
+
Supported clients: Claude Code, Cursor, VS Code, Windsurf, Codex CLI, Gemini CLI. For Claude on
|
|
14
|
+
the web or the desktop app, it prints the two clicks you need instead.
|
|
15
|
+
|
|
16
|
+
## Options
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
npx snaphost connect [--client <name>]... [--all] [--dry-run] [--endpoint <url>] [--json]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- `--client <name>`: configure only these clients (`claude-code`, `cursor`, `vscode`, `windsurf`,
|
|
23
|
+
`codex`, `gemini`). Repeatable.
|
|
24
|
+
- `--all`: configure every supported client whether or not it is detected.
|
|
25
|
+
- `--dry-run`: print what would change without writing or running anything.
|
|
26
|
+
- `--endpoint <url>`: point at another SnapHost deployment.
|
|
27
|
+
- `--json`: print the plan as JSON.
|
|
28
|
+
|
|
29
|
+
Config files it edits (`~/.cursor/mcp.json`, `~/.codeium/windsurf/mcp_config.json`) keep every
|
|
30
|
+
other entry; an existing `snaphost` entry is replaced and a `.bak` copy of the previous file is
|
|
31
|
+
written first. Clients with their own CLI (Claude Code, VS Code, Codex, Gemini) are configured
|
|
32
|
+
through that CLI.
|
|
33
|
+
|
|
34
|
+
Docs: https://snaphost.ai/docs/mcp-server
|
package/dist/action.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function describeAction(action) {
|
|
2
|
+
switch (action.kind) {
|
|
3
|
+
case 'exec':
|
|
4
|
+
return `run: ${action.argv.map(quote).join(' ')}`;
|
|
5
|
+
case 'merge-json':
|
|
6
|
+
return `write: ${action.path} (mcpServers.${action.key})`;
|
|
7
|
+
case 'instruction':
|
|
8
|
+
return action.text;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function quote(argument) {
|
|
12
|
+
return /[\s"']/.test(argument) ? `'${argument.replace(/'/g, "'\\''")}'` : argument;
|
|
13
|
+
}
|
package/dist/argument.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { clientNames } from './client.js';
|
|
2
|
+
export const DEFAULT_ENDPOINT = 'https://app.snaphost.ai/api/mcp';
|
|
3
|
+
export class UsageError extends Error {
|
|
4
|
+
}
|
|
5
|
+
export function parseConnectArguments(argv) {
|
|
6
|
+
const options = {
|
|
7
|
+
clients: [],
|
|
8
|
+
all: false,
|
|
9
|
+
dryRun: false,
|
|
10
|
+
endpoint: DEFAULT_ENDPOINT,
|
|
11
|
+
json: false,
|
|
12
|
+
};
|
|
13
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
14
|
+
const argument = argv[index];
|
|
15
|
+
switch (argument) {
|
|
16
|
+
case '--client': {
|
|
17
|
+
const name = argv[index + 1];
|
|
18
|
+
if (name === undefined || name.startsWith('--')) {
|
|
19
|
+
throw new UsageError('--client needs a name');
|
|
20
|
+
}
|
|
21
|
+
if (!clientNames().includes(name)) {
|
|
22
|
+
throw new UsageError(`Unknown client "${name}". Supported: ${clientNames().join(', ')}`);
|
|
23
|
+
}
|
|
24
|
+
options.clients.push(name);
|
|
25
|
+
index += 1;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
case '--all':
|
|
29
|
+
options.all = true;
|
|
30
|
+
break;
|
|
31
|
+
case '--dry-run':
|
|
32
|
+
options.dryRun = true;
|
|
33
|
+
break;
|
|
34
|
+
case '--json':
|
|
35
|
+
options.json = true;
|
|
36
|
+
break;
|
|
37
|
+
case '--endpoint': {
|
|
38
|
+
const endpoint = argv[index + 1];
|
|
39
|
+
if (endpoint === undefined || !/^https?:\/\//.test(endpoint)) {
|
|
40
|
+
throw new UsageError('--endpoint needs an http(s) URL');
|
|
41
|
+
}
|
|
42
|
+
options.endpoint = endpoint;
|
|
43
|
+
index += 1;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
default:
|
|
47
|
+
throw new UsageError(`Unknown option "${argument}"`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return options;
|
|
51
|
+
}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { connect, EXIT_USAGE } from './connect.js';
|
|
4
|
+
import { nodeEnvironment } from './node-environment.js';
|
|
5
|
+
const USAGE = `snaphost <command>
|
|
6
|
+
|
|
7
|
+
Commands:
|
|
8
|
+
connect Configure your AI clients for the SnapHost MCP server
|
|
9
|
+
[--client <name>]... [--all] [--dry-run] [--endpoint <url>] [--json]
|
|
10
|
+
|
|
11
|
+
Docs: https://snaphost.ai/docs/mcp-server`;
|
|
12
|
+
function version() {
|
|
13
|
+
const manifest = createRequire(import.meta.url)('../package.json');
|
|
14
|
+
return manifest.version;
|
|
15
|
+
}
|
|
16
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
17
|
+
const environment = nodeEnvironment();
|
|
18
|
+
switch (command) {
|
|
19
|
+
case 'connect':
|
|
20
|
+
process.exitCode = connect(rest, environment);
|
|
21
|
+
break;
|
|
22
|
+
case '--version':
|
|
23
|
+
case '-v':
|
|
24
|
+
environment.print(version());
|
|
25
|
+
break;
|
|
26
|
+
case '--help':
|
|
27
|
+
case '-h':
|
|
28
|
+
case undefined:
|
|
29
|
+
environment.print(USAGE);
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
environment.printError(`Unknown command "${command}"\n\n${USAGE}`);
|
|
33
|
+
process.exitCode = EXIT_USAGE;
|
|
34
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export const SERVER_NAME = 'snaphost';
|
|
2
|
+
function homePath(environment, ...segments) {
|
|
3
|
+
return [environment.homeDirectory, ...segments].join('/');
|
|
4
|
+
}
|
|
5
|
+
// Each client is configured the way its own documentation prescribes: through its CLI where it
|
|
6
|
+
// has one (so its own validation and scoping apply), and by editing its config file where it does
|
|
7
|
+
// not. User scope everywhere, so the connection works in every project.
|
|
8
|
+
export const CLIENTS = [
|
|
9
|
+
{
|
|
10
|
+
name: 'claude-code',
|
|
11
|
+
label: 'Claude Code',
|
|
12
|
+
detect: environment => environment.hasExecutable('claude'),
|
|
13
|
+
plan: endpoint => [
|
|
14
|
+
{
|
|
15
|
+
kind: 'exec',
|
|
16
|
+
argv: [
|
|
17
|
+
'claude',
|
|
18
|
+
'mcp',
|
|
19
|
+
'add',
|
|
20
|
+
'--transport',
|
|
21
|
+
'http',
|
|
22
|
+
'--scope',
|
|
23
|
+
'user',
|
|
24
|
+
SERVER_NAME,
|
|
25
|
+
endpoint,
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'cursor',
|
|
32
|
+
label: 'Cursor',
|
|
33
|
+
detect: environment => environment.directoryExists(homePath(environment, '.cursor')),
|
|
34
|
+
plan: (endpoint, environment) => [
|
|
35
|
+
{
|
|
36
|
+
kind: 'merge-json',
|
|
37
|
+
path: homePath(environment, '.cursor', 'mcp.json'),
|
|
38
|
+
key: SERVER_NAME,
|
|
39
|
+
value: { url: endpoint },
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'vscode',
|
|
45
|
+
label: 'VS Code',
|
|
46
|
+
detect: environment => environment.hasExecutable('code'),
|
|
47
|
+
plan: endpoint => [
|
|
48
|
+
{
|
|
49
|
+
kind: 'exec',
|
|
50
|
+
argv: [
|
|
51
|
+
'code',
|
|
52
|
+
'--add-mcp',
|
|
53
|
+
JSON.stringify({ name: SERVER_NAME, type: 'http', url: endpoint }),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'windsurf',
|
|
60
|
+
label: 'Windsurf',
|
|
61
|
+
detect: environment => environment.directoryExists(homePath(environment, '.codeium', 'windsurf')),
|
|
62
|
+
plan: (endpoint, environment) => [
|
|
63
|
+
{
|
|
64
|
+
kind: 'merge-json',
|
|
65
|
+
path: homePath(environment, '.codeium', 'windsurf', 'mcp_config.json'),
|
|
66
|
+
key: SERVER_NAME,
|
|
67
|
+
value: { serverUrl: endpoint },
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'codex',
|
|
73
|
+
label: 'Codex CLI',
|
|
74
|
+
detect: environment => environment.hasExecutable('codex'),
|
|
75
|
+
plan: endpoint => [
|
|
76
|
+
{ kind: 'exec', argv: ['codex', 'mcp', 'add', SERVER_NAME, '--url', endpoint] },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'gemini',
|
|
81
|
+
label: 'Gemini CLI',
|
|
82
|
+
detect: environment => environment.hasExecutable('gemini'),
|
|
83
|
+
plan: endpoint => [
|
|
84
|
+
{ kind: 'exec', argv: ['gemini', 'mcp', 'add', '--transport', 'http', SERVER_NAME, endpoint] },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
export function clientNames() {
|
|
89
|
+
return CLIENTS.map(client => client.name);
|
|
90
|
+
}
|
|
91
|
+
// Claude on the web and the desktop app take connectors through account settings, which no
|
|
92
|
+
// command can reach, so they get the two clicks in words.
|
|
93
|
+
export function manualConnectorInstruction(endpoint) {
|
|
94
|
+
return {
|
|
95
|
+
kind: 'instruction',
|
|
96
|
+
text: 'Claude on the web or desktop: open Settings, Connectors, Add custom connector, and paste ' +
|
|
97
|
+
`${endpoint} as the URL. Claude detects OAuth; leave the defaults and click Add.`,
|
|
98
|
+
};
|
|
99
|
+
}
|
package/dist/connect.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { describeAction } from './action.js';
|
|
2
|
+
import { parseConnectArguments, UsageError } from './argument.js';
|
|
3
|
+
import { CLIENTS, clientNames, manualConnectorInstruction } from './client.js';
|
|
4
|
+
import { ExecutionError, executeAction } from './execute.js';
|
|
5
|
+
export const EXIT_OK = 0;
|
|
6
|
+
export const EXIT_FAILED = 1;
|
|
7
|
+
export const EXIT_USAGE = 2;
|
|
8
|
+
const AUTHORIZE_LINE = 'Done. The first time each client uses SnapHost, your browser opens: click Authorize and ' +
|
|
9
|
+
'you are connected. No token or password is ever needed.';
|
|
10
|
+
// Detect, plan, then either print or apply: `--dry-run` and `--json` stop after the plan, which
|
|
11
|
+
// is why nothing in the plan can touch the machine.
|
|
12
|
+
export function connect(argv, environment) {
|
|
13
|
+
let options;
|
|
14
|
+
try {
|
|
15
|
+
options = parseConnectArguments(argv);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (error instanceof UsageError) {
|
|
19
|
+
environment.printError(error.message);
|
|
20
|
+
return EXIT_USAGE;
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
const plans = planClients(options, environment);
|
|
25
|
+
if (options.json) {
|
|
26
|
+
environment.print(JSON.stringify(planReport(options.endpoint, plans), null, 2));
|
|
27
|
+
return EXIT_OK;
|
|
28
|
+
}
|
|
29
|
+
if (plans.length === 0) {
|
|
30
|
+
environment.print(`No supported AI client found. Supported: ${clientNames().join(', ')}. ` +
|
|
31
|
+
'Pass --client <name> or --all to configure one anyway.');
|
|
32
|
+
environment.print(describeAction(manualConnectorInstruction(options.endpoint)));
|
|
33
|
+
return EXIT_OK;
|
|
34
|
+
}
|
|
35
|
+
if (options.dryRun) {
|
|
36
|
+
for (const plan of plans) {
|
|
37
|
+
environment.print(`${plan.client.label}:`);
|
|
38
|
+
for (const action of plan.actions) {
|
|
39
|
+
environment.print(` ${describeAction(action)}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
environment.print(describeAction(manualConnectorInstruction(options.endpoint)));
|
|
43
|
+
return EXIT_OK;
|
|
44
|
+
}
|
|
45
|
+
let failed = false;
|
|
46
|
+
for (const plan of plans) {
|
|
47
|
+
try {
|
|
48
|
+
for (const action of plan.actions) {
|
|
49
|
+
executeAction(action, environment);
|
|
50
|
+
}
|
|
51
|
+
environment.print(`Configured ${plan.client.label}.`);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (error instanceof ExecutionError) {
|
|
55
|
+
failed = true;
|
|
56
|
+
environment.printError(`${plan.client.label}: ${error.message}`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
environment.print(describeAction(manualConnectorInstruction(options.endpoint)));
|
|
63
|
+
environment.print(AUTHORIZE_LINE);
|
|
64
|
+
return failed ? EXIT_FAILED : EXIT_OK;
|
|
65
|
+
}
|
|
66
|
+
function planClients(options, environment) {
|
|
67
|
+
return CLIENTS.filter(client => {
|
|
68
|
+
if (options.clients.length > 0) {
|
|
69
|
+
return options.clients.includes(client.name);
|
|
70
|
+
}
|
|
71
|
+
return options.all || client.detect(environment);
|
|
72
|
+
}).map(client => ({
|
|
73
|
+
client,
|
|
74
|
+
detected: client.detect(environment),
|
|
75
|
+
actions: client.plan(options.endpoint, environment),
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
function planReport(endpoint, plans) {
|
|
79
|
+
return {
|
|
80
|
+
endpoint,
|
|
81
|
+
clients: plans.map(plan => ({
|
|
82
|
+
name: plan.client.name,
|
|
83
|
+
label: plan.client.label,
|
|
84
|
+
detected: plan.detected,
|
|
85
|
+
actions: plan.actions,
|
|
86
|
+
})),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/execute.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export class ExecutionError extends Error {
|
|
2
|
+
}
|
|
3
|
+
export function executeAction(action, environment) {
|
|
4
|
+
switch (action.kind) {
|
|
5
|
+
case 'exec': {
|
|
6
|
+
const status = environment.run(action.argv);
|
|
7
|
+
if (status !== 0) {
|
|
8
|
+
throw new ExecutionError(`${action.argv[0]} exited with status ${status}`);
|
|
9
|
+
}
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
case 'merge-json':
|
|
13
|
+
mergeServerEntry(action.path, action.key, action.value, environment);
|
|
14
|
+
return;
|
|
15
|
+
case 'instruction':
|
|
16
|
+
environment.print(action.text);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// The config file belongs to the user and may hold other servers and unrelated settings, so the
|
|
21
|
+
// merge touches only `mcpServers.<key>` and keeps a copy of what was there before.
|
|
22
|
+
function mergeServerEntry(path, key, value, environment) {
|
|
23
|
+
const existing = environment.fileExists(path) ? environment.readFile(path) : undefined;
|
|
24
|
+
const config = parseConfig(existing, path);
|
|
25
|
+
const servers = isRecord(config.mcpServers) ? config.mcpServers : {};
|
|
26
|
+
const next = { ...config, mcpServers: { ...servers, [key]: value } };
|
|
27
|
+
if (existing !== undefined) {
|
|
28
|
+
environment.writeFile(`${path}.bak`, existing);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
environment.makeDirectory(path.slice(0, path.lastIndexOf('/')));
|
|
32
|
+
}
|
|
33
|
+
environment.writeFile(path, `${JSON.stringify(next, null, 2)}\n`);
|
|
34
|
+
}
|
|
35
|
+
function parseConfig(content, path) {
|
|
36
|
+
if (content === undefined || content.trim() === '') {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
let parsed;
|
|
40
|
+
try {
|
|
41
|
+
parsed = JSON.parse(content);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
throw new ExecutionError(`${path} is not valid JSON; fix or remove it and run again`);
|
|
45
|
+
}
|
|
46
|
+
if (!isRecord(parsed)) {
|
|
47
|
+
throw new ExecutionError(`${path} must hold a JSON object; fix or remove it and run again`);
|
|
48
|
+
}
|
|
49
|
+
return parsed;
|
|
50
|
+
}
|
|
51
|
+
function isRecord(value) {
|
|
52
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { delimiter, join } from 'node:path';
|
|
5
|
+
const WINDOWS = process.platform === 'win32';
|
|
6
|
+
// Windows resolves `claude` to `claude.cmd`, which only a shell can start; elsewhere the argv
|
|
7
|
+
// runs as given so no argument is ever re-parsed by a shell.
|
|
8
|
+
export function nodeEnvironment() {
|
|
9
|
+
return {
|
|
10
|
+
homeDirectory: homedir().replace(/\\/g, '/'),
|
|
11
|
+
hasExecutable: name => onPath(name),
|
|
12
|
+
fileExists: path => existsSync(path) && statSync(path).isFile(),
|
|
13
|
+
directoryExists: path => existsSync(path) && statSync(path).isDirectory(),
|
|
14
|
+
readFile: path => readFileSync(path, 'utf8'),
|
|
15
|
+
writeFile: (path, content) => writeFileSync(path, content, 'utf8'),
|
|
16
|
+
makeDirectory: path => mkdirSync(path, { recursive: true }),
|
|
17
|
+
run: argv => {
|
|
18
|
+
const result = spawnSync(argv[0], argv.slice(1), { stdio: 'inherit', shell: WINDOWS });
|
|
19
|
+
return result.status ?? 1;
|
|
20
|
+
},
|
|
21
|
+
print: line => process.stdout.write(`${line}\n`),
|
|
22
|
+
printError: line => process.stderr.write(`${line}\n`),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function onPath(name) {
|
|
26
|
+
const directories = (process.env.PATH ?? '').split(delimiter).filter(Boolean);
|
|
27
|
+
const extensions = WINDOWS ? (process.env.PATHEXT ?? '.EXE;.CMD;.BAT').split(';') : [''];
|
|
28
|
+
return directories.some(directory => extensions.some(extension => existsSync(join(directory, `${name}${extension}`))));
|
|
29
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "snaphost",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Connect your AI agent to SnapHost in one command: configures Claude Code, Cursor, VS Code, Windsurf, Codex CLI, and Gemini CLI for the hosted SnapHost MCP server.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"snaphost",
|
|
7
|
+
"mcp",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"claude-code",
|
|
10
|
+
"cursor",
|
|
11
|
+
"publish",
|
|
12
|
+
"share"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://snaphost.ai/docs/mcp-server",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/snaphost-ai/snaphost"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"bin": "dist/bin.js",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc -p tsconfig.build.json",
|
|
32
|
+
"prepack": "yarn build",
|
|
33
|
+
"test": "vitest run --passWithNoTests",
|
|
34
|
+
"lint": "eslint ."
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^24.12.0",
|
|
38
|
+
"typescript": "~5.9.3",
|
|
39
|
+
"vitest": "^4.1.0"
|
|
40
|
+
}
|
|
41
|
+
}
|