@vibesdotdev/bin 1.0.1 → 1.0.3-rc.1

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/checkout.mjs ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bun
2
+ import { captureCheckoutCliLaunch } from '@vibesdotdev/host-bun/cli-checkout';
3
+ import { startHost } from '@vibesdotdev/plugins/host-start.mjs';
4
+ // The checkout command is the same public CLI rooted at the declared checkout:
5
+ // it declares the published package's version, `vibes.plugins` selection and
6
+ // `vibes.config` block, resolved in the checkout's own graph.
7
+ import manifest from './package.json' with { type: 'json' };
8
+
9
+ const launch = captureCheckoutCliLaunch(import.meta.url);
10
+ await startHost({
11
+ ...launch,
12
+ host: { ...launch.host, version: manifest.version },
13
+ hostPluginSpecifiers: manifest.vibes.plugins,
14
+ hostConfig: manifest.vibes.config,
15
+ attestHostGraph: true,
16
+ globalPackagePlugins: false
17
+ });
package/package.json CHANGED
@@ -1,42 +1,116 @@
1
1
  {
2
2
  "name": "@vibesdotdev/bin",
3
- "version": "1.0.1",
4
- "description": "Vibes CLI - the command-line interface for the Vibes platform",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/vibesdotdev/monorepo.git",
9
- "directory": "packages/cli-bin"
10
- },
11
- "homepage": "https://vibes.dev",
12
- "bin": {
13
- "vibes": "bin/vibes"
3
+ "version": "1.0.3-rc.1",
4
+ "dependencies": {
5
+ "@vibesdotdev/account": "^1.0.0-rc.2",
6
+ "@vibesdotdev/agent-execution": "^1.0.0-rc.1",
7
+ "@vibesdotdev/ai": "^1.0.0-rc.3",
8
+ "@vibesdotdev/ai-schemas": "^1.0.0-rc.3",
9
+ "@vibesdotdev/applets": "^1.0.0-rc.2",
10
+ "@vibesdotdev/auth": "^1.0.0-rc.3",
11
+ "@vibesdotdev/bridge": "^1.0.0-rc.0",
12
+ "@vibesdotdev/chat": "^1.0.0-rc.0",
13
+ "@vibesdotdev/cli": "^1.0.0-rc.2",
14
+ "@vibesdotdev/code-sessions": "^1.0.0-rc.0",
15
+ "@vibesdotdev/command-palette": "^1.0.0-rc.3",
16
+ "@vibesdotdev/control": "^1.0.0-rc.2",
17
+ "@vibesdotdev/execution-local": "^1.0.0-rc.3",
18
+ "@vibesdotdev/filesystem": "^1.0.0-rc.2",
19
+ "@vibesdotdev/git-operations": "^1.0.0-rc.2",
20
+ "@vibesdotdev/host-bun": "^1.0.0-rc.2",
21
+ "@vibesdotdev/hq": "^1.0.0-rc.1",
22
+ "@vibesdotdev/infra-core": "^1.0.0-rc.4",
23
+ "@vibesdotdev/infra-deploy": "^1.0.0-rc.4",
24
+ "@vibesdotdev/integrations": "^1.0.0-rc.2",
25
+ "@vibesdotdev/integrations-vibes": "^1.0.0-rc.1",
26
+ "@vibesdotdev/kernel": "^1.0.0-rc.6",
27
+ "@vibesdotdev/kernel-rpc": "^1.0.0-rc.2",
28
+ "@vibesdotdev/kit": "^1.0.0-rc.3",
29
+ "@vibesdotdev/knowledge": "^1.0.0-rc.1",
30
+ "@vibesdotdev/mcp": "^1.0.0-rc.0",
31
+ "@vibesdotdev/notifications": "^1.0.0-rc.2",
32
+ "@vibesdotdev/platform": "^1.0.0-rc.1",
33
+ "@vibesdotdev/plugins": "^1.0.0-rc.0",
34
+ "@vibesdotdev/pm": "^1.0.0-rc.2",
35
+ "@vibesdotdev/projects": "^1.0.0-rc.0",
36
+ "@vibesdotdev/prompts": "^1.0.0-rc.0",
37
+ "@vibesdotdev/registry": "^1.0.0-rc.3",
38
+ "@vibesdotdev/scope": "^1.0.0-rc.2",
39
+ "@vibesdotdev/secrets": "^1.0.0-rc.3",
40
+ "@vibesdotdev/session": "^1.0.0-rc.1",
41
+ "@vibesdotdev/storage": "^1.0.0-rc.3",
42
+ "@vibesdotdev/studio": "^1.0.0-rc.0",
43
+ "@vibesdotdev/surface-sveltekit": "^1.0.0-rc.3",
44
+ "@vibesdotdev/sync": "^1.0.0-rc.2",
45
+ "@vibesdotdev/terminal-client": "^1.0.0-rc.2",
46
+ "@vibesdotdev/testing": "^1.0.0-rc.2",
47
+ "@vibesdotdev/tui": "^1.0.0-rc.2",
48
+ "@vibesdotdev/vessel": "^1.0.0-rc.2",
49
+ "@vibesdotdev/workboard": "^1.0.0-rc.0",
50
+ "@vibesdotdev/workspace": "^1.0.0-rc.1"
14
51
  },
15
52
  "files": [
16
- "bin/vibes",
17
- "scripts/postinstall.js",
18
- "README.md"
53
+ "vibes.mjs",
54
+ "checkout.mjs"
19
55
  ],
20
- "scripts": {
21
- "postinstall": "node scripts/postinstall.js",
22
- "pack:dry-run": "npm pack --dry-run --json --ignore-scripts",
23
- "publish:npm": "npm publish --access public --registry=https://registry.npmjs.org",
24
- "check": "bun --bun tsc -p tsconfig.json --noEmit"
25
- },
26
- "os": [
27
- "darwin",
28
- "linux",
29
- "win32"
30
- ],
31
- "cpu": [
32
- "x64",
33
- "arm64"
34
- ],
35
- "engines": {
36
- "node": ">=18"
37
- },
38
56
  "publishConfig": {
39
- "registry": "https://registry.npmjs.org",
57
+ "registry": "https://packages.vibes.dev",
40
58
  "access": "public"
59
+ },
60
+ "vibes": {
61
+ "visibility": "public",
62
+ "tier": "public",
63
+ "compositionRoots": [
64
+ "vibes.mjs",
65
+ "checkout.mjs"
66
+ ],
67
+ "plugins": [
68
+ "@vibesdotdev/plugins/consumer.plugin",
69
+ "@vibesdotdev/infra-core/service",
70
+ "@vibesdotdev/integrations-vibes/services",
71
+ "@vibesdotdev/infra-core/plugin",
72
+ "@vibesdotdev/infra-core/generate/plugin",
73
+ "@vibesdotdev/infra-deploy/plugin",
74
+ "@vibesdotdev/infra-deploy/cli/plugin",
75
+ "@vibesdotdev/pm/plugin",
76
+ "@vibesdotdev/pm/cli/plugin",
77
+ "@vibesdotdev/platform/cli/plugin",
78
+ "@vibesdotdev/platform/fleets/cli/plugin",
79
+ "@vibesdotdev/workboard/marshal/cli/plugin",
80
+ "@vibesdotdev/sync/plugin",
81
+ "@vibesdotdev/sync/cli/plugin",
82
+ "@vibesdotdev/studio/cli/plugin",
83
+ "@vibesdotdev/projects/app/cli/plugin",
84
+ "@vibesdotdev/plugins/tui/plugin"
85
+ ],
86
+ "config": {
87
+ "runtime.host": {
88
+ "environmentTier": "local"
89
+ },
90
+ "infra.services": {
91
+ "environment": "production"
92
+ }
93
+ },
94
+ "registry": {
95
+ "repositoryId": "80ee5ed7-a88d-49f8-86e8-f867006d1b4d",
96
+ "directory": "npm-bin"
97
+ }
98
+ },
99
+ "description": "Vibes CLI. Starts the public plugin host with no setup command.",
100
+ "type": "module",
101
+ "license": "MIT",
102
+ "bin": {
103
+ "vibes": "./vibes.mjs"
104
+ },
105
+ "repository": {
106
+ "type": "git",
107
+ "url": "ssh://git@git.vibes.dev/vibesdotdev/cli-bin.git",
108
+ "directory": "npm-bin"
109
+ },
110
+ "gitHead": "a7f6e9d14b82eb7b4e792d85047b071108d7f190",
111
+ "_vibes_source": {
112
+ "repo": "ssh://git@git.vibes.dev/vibesdotdev/cli-bin.git",
113
+ "sha": "a7f6e9d14b82eb7b4e792d85047b071108d7f190",
114
+ "workspaceDigest": "sha256:5d4d9f9b903fb38485a09b0f2c4cc1c33d839d24c11048f23dff55177ab7a24a"
41
115
  }
42
116
  }
package/vibes.mjs ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bun
2
+ import { loadedCliHostDeclaration } from '@vibesdotdev/host-bun/resolution-root';
3
+ import { startHost } from '@vibesdotdev/plugins/host-start.mjs';
4
+ // The published package identity is the executable's declaration: its version
5
+ // is what `vibes --version` reports, and `vibes.plugins` is the public plugin
6
+ // selection this package installs as `dependencies` and composes at the graph
7
+ // it was installed into. `vibes.config` is the executable's own config block
8
+ // (the environment tier credentials resolve under, the services environment).
9
+ // Nothing here lists a plugin or a setting.
10
+ import manifest from './package.json' with { type: 'json' };
11
+
12
+ await startHost({
13
+ host: {
14
+ ...loadedCliHostDeclaration({
15
+ scriptUrl: import.meta.url,
16
+ hostEntryUrl: import.meta.resolve('@vibesdotdev/plugins/host-start.mjs')
17
+ }),
18
+ version: manifest.version
19
+ },
20
+ hostPluginSpecifiers: manifest.vibes.plugins,
21
+ hostConfig: manifest.vibes.config
22
+ });
package/README.md DELETED
@@ -1,37 +0,0 @@
1
- # Vibes CLI
2
-
3
- Published npm wrapper for the public `vibes` binary.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install -g @vibesdotdev/bin
9
- ```
10
-
11
- Or with bun:
12
-
13
- ```bash
14
- bun add -g @vibesdotdev/bin
15
- ```
16
-
17
- ## Usage
18
-
19
- The package downloads a platform-specific `vibes` binary during `postinstall` and exposes it through the package `bin` field.
20
-
21
- Set `VIBES_BINARY_MIRROR` to override the release download base URL. The default
22
- mirror is `https://assets.vibes.dev/downloads/cli`. The installer verifies the
23
- download against `SHA256SUMS.txt` from the same mirror before completing.
24
-
25
- To inspect the exact npm tarball before release:
26
-
27
- ```bash
28
- npm run pack:dry-run
29
- ```
30
-
31
- To publish from this package after npm auth is configured:
32
-
33
- ```bash
34
- npm run publish:npm
35
- ```
36
-
37
- See [https://vibes.dev](https://vibes.dev) for documentation.
package/bin/vibes DELETED
@@ -1,90 +0,0 @@
1
- #!/usr/bin/env node
2
- // Cross-platform launcher for the vibes CLI binary.
3
- //
4
- // npm's bin field is static, but the published package downloads a
5
- // platform-specific binary at install time (scripts/postinstall.js):
6
- // - Unix: overwrites THIS file (bin/vibes) with the binary itself,
7
- // so subsequent invocations skip Node entirely.
8
- // - Windows: writes bin/vibes.exe alongside this file. npm-on-Windows
9
- // generates a vibes.cmd that does `node bin/vibes`, so this
10
- // shim has to be a JS file that spawns the .exe. Without it,
11
- // Windows would try to execute a shell script and fail.
12
- //
13
- // If neither artifact is present, postinstall didn't complete — surface a
14
- // clear error rather than silently doing nothing.
15
-
16
- 'use strict';
17
-
18
- const { spawnSync } = require('child_process');
19
- const fs = require('fs');
20
- const path = require('path');
21
-
22
- const binDir = __dirname;
23
- const installerPath = path.join(binDir, '..', 'scripts', 'postinstall.js');
24
- const exePath = path.join(binDir, 'vibes.exe');
25
-
26
- function runInstaller() {
27
- const result = spawnSync(process.execPath, [installerPath], {
28
- stdio: 'inherit',
29
- windowsHide: false
30
- });
31
- if (result.error) {
32
- process.stderr.write(`Failed to run installer: ${result.error.message}\n`);
33
- process.exit(1);
34
- }
35
- if (result.status !== 0) {
36
- process.exit(result.status === null ? 1 : result.status);
37
- }
38
- }
39
-
40
- function reportMissingBinary() {
41
- process.stderr.write('Error: vibes binary not installed.\n');
42
- process.stderr.write('\n');
43
- process.stderr.write('The installer could not place the platform binary.\n');
44
- process.stderr.write('\n');
45
- process.stderr.write('If the problem persists, see https://github.com/vibesdotdev/monorepo/issues\n');
46
- process.exit(1);
47
- }
48
-
49
- function isStillNodeShim(filePath) {
50
- try {
51
- const content = fs.readFileSync(filePath, 'utf8');
52
- return content.includes('Cross-platform launcher for the vibes CLI binary');
53
- } catch {
54
- return false;
55
- }
56
- }
57
-
58
- if (process.platform === 'win32') {
59
- if (!fs.existsSync(exePath)) {
60
- runInstaller();
61
- }
62
- if (!fs.existsSync(exePath)) {
63
- reportMissingBinary();
64
- }
65
- const result = spawnSync(exePath, process.argv.slice(2), {
66
- stdio: 'inherit',
67
- windowsHide: false
68
- });
69
- if (result.error) {
70
- process.stderr.write(`Failed to spawn vibes.exe: ${result.error.message}\n`);
71
- process.exit(1);
72
- }
73
- process.exit(result.status === null ? 1 : result.status);
74
- }
75
-
76
- runInstaller();
77
-
78
- if (isStillNodeShim(path.join(binDir, 'vibes'))) {
79
- reportMissingBinary();
80
- }
81
-
82
- const result = spawnSync(path.join(binDir, 'vibes'), process.argv.slice(2), {
83
- stdio: 'inherit',
84
- windowsHide: false
85
- });
86
- if (result.error) {
87
- process.stderr.write(`Failed to spawn vibes: ${result.error.message}\n`);
88
- process.exit(1);
89
- }
90
- process.exit(result.status === null ? 1 : result.status);
@@ -1,260 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const https = require('https');
4
- const http = require('http');
5
- const crypto = require('crypto');
6
- const fs = require('fs');
7
- const path = require('path');
8
- const os = require('os');
9
- const BASE_URL = process.env.VIBES_BINARY_MIRROR || 'https://assets.vibes.dev/downloads/cli';
10
-
11
- function getPlatform() {
12
- const platform = os.platform();
13
- if (platform === 'win32') return 'win32';
14
- if (platform === 'darwin') return 'darwin';
15
- return 'linux';
16
- }
17
-
18
- function getArch() {
19
- const arch = os.arch();
20
- if (arch === 'x64') return 'x64';
21
- if (arch === 'arm64') return 'arm64';
22
- // Node on macOS can report 'arm' for Apple Silicon
23
- if (arch === 'arm' && getPlatform() === 'darwin') return 'arm64';
24
- return 'x64';
25
- }
26
-
27
- function getBinaryName() {
28
- const platform = getPlatform();
29
- const arch = getArch();
30
- const baseName = `vibes-${platform}-${arch}`;
31
- return platform === 'win32' ? `${baseName}.exe` : baseName;
32
- }
33
-
34
- function getOutputPath() {
35
- const platform = getPlatform();
36
- const dir = path.join(__dirname, '..', 'bin');
37
- const outputName = platform === 'win32' ? 'vibes.exe' : 'vibes';
38
- return path.join(dir, outputName);
39
- }
40
-
41
- function showProgress(total, current) {
42
- if (total > 0) {
43
- const percent = Math.round((current / total) * 100);
44
- const bar = '[' + '='.repeat(Math.floor(percent / 5)) + ' '.repeat(20 - Math.floor(percent / 5)) + ']';
45
- process.stdout.write(`\r${bar} ${percent}%`);
46
- } else {
47
- process.stdout.write('.');
48
- }
49
- }
50
-
51
- function download(url, dest, callback) {
52
- const protocol = url.startsWith('https') ? https : http;
53
-
54
- const request = protocol.get(url, { timeout: 30000 }, (response) => {
55
- // Handle redirects
56
- if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
57
- download(response.headers.location, dest, callback);
58
- return;
59
- }
60
-
61
- if (response.statusCode !== 200) {
62
- callback(new Error(`Failed to download: HTTP ${response.statusCode}`));
63
- return;
64
- }
65
-
66
- const total = parseInt(response.headers['content-length'], 10);
67
- let downloaded = 0;
68
-
69
- const fp = fs.openSync(dest, 'w');
70
- response.on('data', (chunk) => {
71
- downloaded += chunk.length;
72
- showProgress(total, downloaded);
73
- fs.writeSync(fp, chunk);
74
- });
75
-
76
- response.on('end', () => {
77
- fs.closeSync(fp);
78
- console.log();
79
- callback(null);
80
- });
81
-
82
- response.on('error', (err) => {
83
- fs.closeSync(fp);
84
- callback(err);
85
- });
86
- });
87
-
88
- request.on('error', (err) => {
89
- callback(err);
90
- });
91
-
92
- request.on('timeout', () => {
93
- request.destroy();
94
- callback(new Error('Download timed out'));
95
- });
96
- }
97
-
98
- function fetchText(url, callback) {
99
- const protocol = url.startsWith('https') ? https : http;
100
-
101
- const request = protocol.get(url, { timeout: 30000 }, (response) => {
102
- if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
103
- fetchText(response.headers.location, callback);
104
- return;
105
- }
106
-
107
- if (response.statusCode !== 200) {
108
- callback(new Error(`HTTP ${response.statusCode}`));
109
- return;
110
- }
111
-
112
- let body = '';
113
- response.setEncoding('utf8');
114
- response.on('data', (chunk) => {
115
- body += chunk;
116
- });
117
- response.on('end', () => callback(null, body));
118
- response.on('error', callback);
119
- });
120
-
121
- request.on('error', callback);
122
- request.on('timeout', () => {
123
- request.destroy();
124
- callback(new Error('Download timed out'));
125
- });
126
- }
127
-
128
- function verifyChecksum(binaryName, filePath) {
129
- return new Promise((resolve, reject) => {
130
- if (process.env.VIBES_SKIP_CHECKSUM === '1') {
131
- console.warn('Warning: VIBES_SKIP_CHECKSUM=1 set; skipping checksum verification.');
132
- resolve();
133
- return;
134
- }
135
-
136
- const checksumUrl = `${BASE_URL}/SHA256SUMS.txt`;
137
- fetchText(checksumUrl, (err, text) => {
138
- if (err) {
139
- reject(new Error(`Could not fetch checksum file from ${checksumUrl}: ${err.message}`));
140
- return;
141
- }
142
-
143
- const line = text
144
- .split(/\r?\n/)
145
- .find((entry) => entry.trim().endsWith(` ${binaryName}`));
146
- if (!line) {
147
- reject(new Error(`No checksum entry for ${binaryName} in ${checksumUrl}`));
148
- return;
149
- }
150
-
151
- const expected = line.trim().split(/\s+/)[0];
152
- const actual = crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');
153
- if (actual !== expected) {
154
- reject(new Error(`Checksum mismatch for ${binaryName}`));
155
- return;
156
- }
157
-
158
- console.log('Verified release checksum');
159
- resolve();
160
- });
161
- });
162
- }
163
-
164
- function makeExecutable(filePath) {
165
- const platform = getPlatform();
166
- if (platform === 'win32') return;
167
-
168
- try {
169
- fs.chmodSync(filePath, 0o755);
170
- } catch (err) {
171
- console.error('Warning: Could not chmod +x:', err.message);
172
- }
173
- }
174
-
175
- function isWorkspaceInstall() {
176
- // Explicit opt-out (set in CI, the monorepo's bun install, or any env that
177
- // already has the binary built locally and doesn't want network on install).
178
- if (process.env.VIBES_SKIP_BINARY_DOWNLOAD === '1') return true;
179
-
180
- // When this package is installed from the npm registry, the realpath of the
181
- // script location includes `/node_modules/` (the unpacked tarball path). When
182
- // bun installs us via a workspace link, realpath dereferences the symlink to
183
- // the monorepo source — which lives outside any `node_modules` directory. We
184
- // use this asymmetry to skip downloads cleanly inside the workspace while
185
- // failing loudly for real end-user installs.
186
- try {
187
- const real = fs.realpathSync(__dirname);
188
- const sep = path.sep;
189
- return !real.includes(`${sep}node_modules${sep}`);
190
- } catch {
191
- return false;
192
- }
193
- }
194
-
195
- async function main() {
196
- if (isWorkspaceInstall()) {
197
- console.log('Vibes CLI installer: workspace install detected, skipping binary download.');
198
- return;
199
- }
200
-
201
- const binaryName = getBinaryName();
202
- const outputPath = getOutputPath();
203
- const url = `${BASE_URL}/${binaryName}`;
204
-
205
- console.log(`Vibes CLI installer`);
206
- console.log(`Platform: ${getPlatform()}, Arch: ${getArch()}`);
207
- console.log(`Downloading ${binaryName}...`);
208
-
209
- // Ensure bin directory exists
210
- const binDir = path.dirname(outputPath);
211
- if (!fs.existsSync(binDir)) {
212
- fs.mkdirSync(binDir, { recursive: true });
213
- }
214
-
215
- // Check if already exists and up-to-date
216
- if (fs.existsSync(outputPath)) {
217
- try {
218
- fs.unlinkSync(outputPath);
219
- } catch (err) {
220
- console.error('Could not remove existing binary:', err.message);
221
- }
222
- }
223
-
224
- return new Promise((resolve, reject) => {
225
- download(url, outputPath, (err) => {
226
- if (err) {
227
- console.error();
228
- console.error('Error:', err.message);
229
- console.error(`Could not download binary from ${url}`);
230
- console.error();
231
- console.error('To resolve:');
232
- console.error(` - Confirm a release exists at ${BASE_URL}`);
233
- console.error(` - Confirm ${BASE_URL}/SHA256SUMS.txt is reachable and contains ${binaryName}`);
234
- console.error(' - Or point VIBES_BINARY_MIRROR at an alternate download base URL');
235
- console.error(' - Or download the binary manually and place it at:');
236
- console.error(` ${outputPath}`);
237
- console.error(' - Or set VIBES_SKIP_BINARY_DOWNLOAD=1 to skip this step');
238
- console.error(' - Or set VIBES_SKIP_CHECKSUM=1 only if you trust the mirror and need to bypass checksum verification');
239
- reject(err);
240
- return;
241
- }
242
-
243
- verifyChecksum(binaryName, outputPath)
244
- .then(() => {
245
- makeExecutable(outputPath);
246
- console.log(`Installed to ${outputPath}`);
247
- resolve();
248
- })
249
- .catch(reject);
250
- });
251
- });
252
- }
253
-
254
- main().catch((err) => {
255
- console.error('Installation failed:', err.message);
256
- // End-user installs reach here when isWorkspaceInstall() was false above
257
- // (i.e., the script lives under node_modules) and the download failed. Fail
258
- // loud so the user sees a broken install instead of a silently empty bin/.
259
- process.exit(1);
260
- });