mothx-installer 1.1.57-pre

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 ADDED
@@ -0,0 +1,93 @@
1
+ > **Rename notice:** VibeCoding is now **MothX**. Install name: `mothx-installer` (`npm install -g mothx-installer`).
2
+
3
+ # MothX
4
+
5
+ ๐Ÿš€ ไธ€ไธชไบŒ่ฟ›ๅˆถๆ–‡ไปถๆžๅฎšไธ€ๅˆ‡ โ€” ไฝ ็š„็ปˆ็ซฏ AI ็ผ–็จ‹ๅŠฉๆ‰‹
6
+
7
+ A terminal-based AI coding assistant. One binary, multiple providers, sandbox, sessions, skills, and more.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install -g mothx-installer
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ```bash
18
+ # Set API key
19
+ export DEEPSEEK_API_KEY=sk-...
20
+
21
+ # Start interactive mode
22
+ mothx
23
+
24
+ # Non-interactive (print mode)
25
+ mothx -P "Write a hello world in Go"
26
+
27
+ # Specify provider and model
28
+ mothx --provider deepseek-openai --model deepseek-v4-flash
29
+
30
+ # Change mode
31
+ mothx --mode plan # Read-only planning
32
+ mothx --mode agent # Standard (default)
33
+ mothx --mode yolo # Full access
34
+ ```
35
+
36
+ ## Features
37
+
38
+ - โš™๏ธ **Workflow Mode**: Dynamic Elisp workflows with phases, parallel execution, and multi-worker coordination
39
+ - ๐Ÿค– **Multi-Provider**: DeepSeek, OpenAI, Anthropic, Volcengine/Doubao, 20+ vendor adapters
40
+ - โšก **SSE Streaming**: Real-time token delivery
41
+ - ๐Ÿง  **Think Mode**: Extended reasoning for complex problems
42
+ - ๐Ÿ›ก๏ธ **Sandbox**: bwrap process isolation (Linux)
43
+ - ๐Ÿ“ **Sessions**: Persistent SQLite-backed history with branching
44
+ - ๐Ÿงฉ **Skills**: Reusable prompt snippets
45
+ - ๐Ÿ’ป **IDE Integration**: ACP protocol for VS Code, JetBrains
46
+ - ๐ŸŒ **Gateway**: OpenAI-compatible HTTP API
47
+ - ๐Ÿ“ฑ **Messaging**: WeChat, Feishu, WebSocket chatbot
48
+ - ๐Ÿค **Multi-Agent**: Delegate subtasks, A2A protocol
49
+
50
+ ## Configuration
51
+
52
+ ```bash
53
+ # DeepSeek (default)
54
+ export DEEPSEEK_API_KEY=sk-...
55
+
56
+ # OpenAI
57
+ export OPENAI_API_KEY=sk-...
58
+
59
+ # Anthropic
60
+ export ANTHROPIC_API_KEY=sk-ant-...
61
+ ```
62
+
63
+ Or configure in `~/.vibecoding/settings.json`:
64
+
65
+ ```json
66
+ {
67
+ "defaultProvider": "deepseek-openai",
68
+ "defaultModel": "deepseek-v4-flash"
69
+ }
70
+ ```
71
+
72
+ ## More Information
73
+
74
+ - **GitHub**: [github.com/startvibecoding/mothx](https://github.com/startvibecoding/mothx)
75
+ - **Gitee (ๅ›ฝๅ†…)**: [gitee.com/startvibecoding/mothx](https://gitee.com/startvibecoding/mothx)
76
+ - **Documentation**: [docs](https://github.com/startvibecoding/mothx/tree/main/docs)
77
+
78
+ ## Uninstall
79
+
80
+ ```bash
81
+ # npm
82
+ npm uninstall -g mothx-installer
83
+
84
+ # Linux/macOS (one-line install)
85
+ curl -fsSL https://gitee.com/startvibecoding/mothx/raw/main/install.sh | bash -s -- --uninstall
86
+
87
+ # Windows (one-line install)
88
+ irm https://gitee.com/startvibecoding/mothx/raw/main/install.ps1 | iex; Uninstall-MothX
89
+ ```
90
+
91
+ ## License
92
+
93
+ MIT
package/bin/mothx ADDED
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Wrapper script that resolves and executes the platform-specific binary.
4
+ // When installed via `npm i -g mothx`, this script finds the
5
+ // correct binary from the platform-specific optional dependency package.
6
+
7
+ const { execFileSync } = require('child_process');
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+
11
+ // Map npm os/cpu to package name
12
+ const PLATFORM_MAP = {
13
+ 'linux-x64-glibc': 'mothx-linux-x64',
14
+ 'linux-arm64-glibc': 'mothx-linux-arm64',
15
+ 'linux-loong64-glibc': 'mothx-linux-loong64',
16
+ 'linux-ppc64-glibc': 'mothx-linux-ppc64le',
17
+ 'linux-s390x-glibc': 'mothx-linux-s390x',
18
+ 'linux-riscv64-glibc': 'mothx-linux-riscv64',
19
+ 'linux-x64-musl': 'mothx-linux-musl-x64',
20
+ 'linux-arm64-musl': 'mothx-linux-musl-arm64',
21
+ 'darwin-x64': 'mothx-darwin-x64',
22
+ 'darwin-arm64': 'mothx-darwin-arm64',
23
+ 'win32-x64': 'mothx-win32-x64',
24
+ 'win32-arm64': 'mothx-win32-arm64',
25
+ 'freebsd-x64': 'mothx-freebsd-x64',
26
+ 'freebsd-arm64': 'mothx-freebsd-arm64',
27
+ 'openbsd-x64': 'mothx-openbsd-x64',
28
+ 'openbsd-arm64': 'mothx-openbsd-arm64',
29
+ 'netbsd-x64': 'mothx-netbsd-x64',
30
+ };
31
+
32
+ function mainPackageName() {
33
+ try {
34
+ const pkgPath = path.join(__dirname, '..', 'package.json');
35
+ return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).name || '';
36
+ } catch {
37
+ return '';
38
+ }
39
+ }
40
+
41
+ function maybeWarnLegacyPackage() {
42
+ const packageName = mainPackageName();
43
+ const invoked = path.basename(process.argv[1] || '');
44
+ if (packageName !== 'vibecoding-installer' && invoked !== 'vibecoding') {
45
+ return;
46
+ }
47
+ if (process.env.MOTHX_HIDE_LEGACY_NPM_WARNING || process.env.VIBECODING_HIDE_LEGACY_NPM_WARNING) {
48
+ return;
49
+ }
50
+ console.error('[mothx] vibecoding-installer is a compatibility package for this release.');
51
+ console.error('[mothx] Please update with: npm install -g mothx@latest');
52
+ console.error('');
53
+ }
54
+
55
+ function detectPlatform() {
56
+ const os = process.platform; // 'linux', 'darwin', 'win32'
57
+ const arch = process.arch; // 'x64', 'arm64'
58
+
59
+ if (os === 'linux') {
60
+ // Detect libc: musl or glibc
61
+ const isMusl = (() => {
62
+ try {
63
+ // Check for Alpine's musl
64
+ if (fs.existsSync('/etc/alpine-release')) return true;
65
+ // Check ldd output for musl
66
+ const { execSync } = require('child_process');
67
+ const output = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
68
+ return output.includes('musl');
69
+ } catch {
70
+ return false;
71
+ }
72
+ })();
73
+
74
+ return `${os}-${arch}-${isMusl ? 'musl' : 'glibc'}`;
75
+ }
76
+
77
+ return `${os}-${arch}`;
78
+ }
79
+
80
+ function findBinary() {
81
+ const platform = detectPlatform();
82
+ const packageName = PLATFORM_MAP[platform];
83
+
84
+ if (!packageName) {
85
+ console.error(`Unsupported platform: ${platform}`);
86
+ console.error(`Supported platforms: ${Object.keys(PLATFORM_MAP).join(', ')}`);
87
+ process.exit(1);
88
+ }
89
+
90
+ const searchDirs = [];
91
+ const addSearchDir = (dir) => {
92
+ if (dir && !searchDirs.includes(dir)) {
93
+ searchDirs.push(dir);
94
+ }
95
+ };
96
+
97
+ try {
98
+ addSearchDir(path.dirname(require.resolve(`${packageName}/package.json`)));
99
+ } catch {
100
+ // Keep explicit fallbacks below for unusual npm layouts.
101
+ }
102
+
103
+ // npm usually installs dependencies under this package. Some global installs
104
+ // or package managers may hoist them as siblings, so check both layouts.
105
+ addSearchDir(path.join(__dirname, '..', 'node_modules', packageName));
106
+ addSearchDir(path.join(__dirname, '..', '..', packageName));
107
+
108
+ for (const pkgDir of searchDirs) {
109
+ const binName = process.platform === 'win32' ? 'mothx.exe' : 'mothx';
110
+ const binPath = path.join(pkgDir, 'bin', binName);
111
+
112
+ if (fs.existsSync(binPath)) {
113
+ return binPath;
114
+ }
115
+ }
116
+
117
+ // Fallback: check if there's a binary directly in the main package's bin/
118
+ // (old single-package layout, or development mode)
119
+ const fallbackBinName = (() => {
120
+ const suffix = process.platform === 'win32' ? '.exe' : '';
121
+ const osMap = {
122
+ linux: 'linux',
123
+ darwin: 'darwin',
124
+ win32: 'windows',
125
+ freebsd: 'freebsd',
126
+ openbsd: 'openbsd',
127
+ netbsd: 'netbsd',
128
+ };
129
+ const archMap = {
130
+ x64: 'amd64',
131
+ arm64: 'arm64',
132
+ loong64: 'loong64',
133
+ ppc64: 'ppc64le',
134
+ s390x: 's390x',
135
+ riscv64: 'riscv64',
136
+ };
137
+ if (!osMap[process.platform] || !archMap[process.arch]) {
138
+ return '';
139
+ }
140
+ return `mothx-${osMap[process.platform]}-${archMap[process.arch]}${suffix}`;
141
+ })();
142
+
143
+ const fallbackPath = fallbackBinName ? path.join(__dirname, fallbackBinName) : '';
144
+ if (fallbackPath && fs.existsSync(fallbackPath)) {
145
+ return fallbackPath;
146
+ }
147
+
148
+ console.error(`Could not find mothx binary for platform: ${detectPlatform()}`);
149
+ console.error(`Searched for package: ${packageName}`);
150
+ console.error(`Searched in: ${searchDirs.join(', ')}`);
151
+ console.error('');
152
+ console.error('If you installed globally, try reinstalling:');
153
+ console.error(' npm install -g mothx');
154
+ console.error('');
155
+ console.error('If the problem persists, install via one-line script instead:');
156
+ console.error(' curl -fsSL https://raw.githubusercontent.com/startvibecoding/mothx/main/install.sh | bash');
157
+ process.exit(1);
158
+ }
159
+
160
+ // Main
161
+ maybeWarnLegacyPackage();
162
+ const binaryPath = findBinary();
163
+ const args = process.argv.slice(2);
164
+
165
+ try {
166
+ execFileSync(binaryPath, args, { stdio: 'inherit' });
167
+ } catch (err) {
168
+ // Forward the exit code
169
+ if (err.status !== undefined) {
170
+ process.exit(err.status);
171
+ }
172
+ if (err.code) {
173
+ process.exit(1);
174
+ }
175
+ process.exit(1);
176
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "mothx-installer",
3
+ "version": "1.1.57-pre",
4
+ "description": "AI coding assistant for the terminal",
5
+ "scripts": {
6
+ "postinstall": "node scripts/postinstall.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "scripts/",
11
+ "README.md"
12
+ ],
13
+ "keywords": [
14
+ "ai",
15
+ "coding",
16
+ "assistant",
17
+ "terminal",
18
+ "cli",
19
+ "llm",
20
+ "gpt",
21
+ "claude"
22
+ ],
23
+ "author": "",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/startvibecoding/mothx.git",
28
+ "directory": "npm"
29
+ },
30
+ "engines": {
31
+ "node": ">=14"
32
+ },
33
+ "optionalDependencies": {
34
+ "mothx-darwin-arm64": "1.1.57-pre",
35
+ "mothx-darwin-x64": "1.1.57-pre",
36
+ "mothx-freebsd-arm64": "1.1.57-pre",
37
+ "mothx-freebsd-x64": "1.1.57-pre",
38
+ "mothx-linux-arm64": "1.1.57-pre",
39
+ "mothx-linux-loong64": "1.1.57-pre",
40
+ "mothx-linux-musl-arm64": "1.1.57-pre",
41
+ "mothx-linux-musl-x64": "1.1.57-pre",
42
+ "mothx-linux-ppc64le": "1.1.57-pre",
43
+ "mothx-linux-riscv64": "1.1.57-pre",
44
+ "mothx-linux-s390x": "1.1.57-pre",
45
+ "mothx-linux-x64": "1.1.57-pre",
46
+ "mothx-netbsd-x64": "1.1.57-pre",
47
+ "mothx-openbsd-arm64": "1.1.57-pre",
48
+ "mothx-openbsd-x64": "1.1.57-pre",
49
+ "mothx-win32-arm64": "1.1.57-pre",
50
+ "mothx-win32-x64": "1.1.57-pre"
51
+ },
52
+ "bin": {
53
+ "mothx": "bin/mothx"
54
+ }
55
+ }
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Skip postinstall output in CI or when suppressed
4
+ if (process.env.CI || process.env.npm_config_yes || process.env.VIBECODING_SKIP_POSTINSTALL) {
5
+ process.exit(0);
6
+ }
7
+
8
+ const os = require('os');
9
+ const path = require('path');
10
+
11
+ const RESET = '\x1b[0m';
12
+ const BOLD = '\x1b[1m';
13
+ const DIM = '\x1b[2m';
14
+ const CYAN = '\x1b[36m';
15
+ const BRIGHT_CYAN = '\x1b[96m';
16
+ const WHITE = '\x1b[97m';
17
+ const YELLOW = '\x1b[33m';
18
+
19
+ const logo = [
20
+ ' _ ___ __ ',
21
+ '| | / (_) /_ ___ ',
22
+ '| | / / / __ \\/ _ \\',
23
+ '| |/ / / /_/ / __/',
24
+ '|___/_/_.___/\\___/ ',
25
+ ].join('\n');
26
+
27
+ function configPath() {
28
+ if (process.platform === 'win32') {
29
+ const appData = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
30
+ return path.join(appData, 'vibecoding', 'settings.json');
31
+ }
32
+ return path.join(os.homedir(), '.vibecoding', 'settings.json');
33
+ }
34
+
35
+ function pkgVersion() {
36
+ try {
37
+ return require('../package.json').version;
38
+ } catch {
39
+ return '';
40
+ }
41
+ }
42
+
43
+ function pkgName() {
44
+ try {
45
+ return require('../package.json').name;
46
+ } catch {
47
+ return '';
48
+ }
49
+ }
50
+
51
+ const ver = pkgVersion();
52
+ const verStr = ver ? ` ${DIM}v${ver}${RESET}` : '';
53
+ const name = pkgName();
54
+ const legacy = name === 'vibecoding-installer';
55
+ const command = legacy ? 'vibecoding' : 'mothx';
56
+
57
+ console.log();
58
+ console.log(`${BRIGHT_CYAN}${BOLD}${logo}${RESET}${verStr}`);
59
+ console.log();
60
+ if (legacy) {
61
+ console.log(` ${YELLOW}${BOLD}vibecoding-installer is a compatibility package.${RESET}`);
62
+ console.log(` ${YELLOW}Future updates move to: npm install -g mothx-installer@latest${RESET}`);
63
+ console.log();
64
+ }
65
+ console.log(` ${BOLD}${WHITE}Your AI pair programmer, right in the terminal.${RESET}`);
66
+ console.log();
67
+ console.log(` ${DIM}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${RESET}`);
68
+ console.log();
69
+ console.log(` ${BOLD}Quick Start${RESET}`);
70
+ console.log();
71
+ console.log(` ${command} ${DIM}Interactive mode${RESET}`);
72
+ console.log(` ${command} -P "write fizzbuzz in Go" ${DIM}One-shot mode${RESET}`);
73
+ console.log();
74
+ console.log(` ${BOLD}Setup${RESET}`);
75
+ console.log();
76
+ console.log(` In TUI, type ${CYAN}${BOLD}/auth${RESET} to add API keys and switch providers`);
77
+ console.log();
78
+ console.log(` ${BOLD}Docs${RESET} ${CYAN}https://startvibecoding.work/${RESET}`);
79
+ console.log(` ${BOLD}Code${RESET} ${CYAN}https://github.com/startvibecoding/mothx${RESET}`);
80
+ console.log(` ${BOLD}Config${RESET} ${DIM}${configPath()}${RESET}`);
81
+ console.log();