@rehpic/vcli 0.1.0-beta.9.1 → 0.1.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 +24 -5
- package/dist/index.js +3951 -63
- package/dist/index.js.map +1 -1
- package/native/VectorMenuBar.app/Contents/Info.plist +26 -0
- package/native/VectorMenuBar.app/Contents/MacOS/VectorMenuBar +0 -0
- package/native/VectorMenuBar.app/Contents/Resources/vector-menubar.png +0 -0
- package/native/VectorMenuBar.app/Contents/Resources/vector-menubar@2x.png +0 -0
- package/package.json +16 -3
- package/scripts/build-menubar-app.js +117 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>VectorMenuBar</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>com.vector.menubar</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>VectorMenuBar</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>APPL</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>0.1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>0.1.0</string>
|
|
21
|
+
<key>LSUIElement</key>
|
|
22
|
+
<true/>
|
|
23
|
+
<key>NSHighResolutionCapable</key>
|
|
24
|
+
<true/>
|
|
25
|
+
</dict>
|
|
26
|
+
</plist>
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rehpic/vcli",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Command line interface for Vector workspaces.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,19 +28,32 @@
|
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
|
+
"native",
|
|
32
|
+
"scripts",
|
|
31
33
|
"README.md"
|
|
32
34
|
],
|
|
33
35
|
"scripts": {
|
|
34
|
-
"build": "tsup --config tsup.config.ts"
|
|
36
|
+
"build": "node scripts/build-menubar-app.js && tsup --config tsup.config.ts"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
39
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.79",
|
|
37
40
|
"@clack/prompts": "^1.1.0",
|
|
38
41
|
"commander": "^14.0.3",
|
|
39
42
|
"convex": "^1.33.1",
|
|
40
|
-
"dotenv": "^16.4.5"
|
|
43
|
+
"dotenv": "^16.4.5",
|
|
44
|
+
"localtunnel": "^2.0.2",
|
|
45
|
+
"node-datachannel": "^0.32.1",
|
|
46
|
+
"node-pty": "1.2.0-beta.12",
|
|
47
|
+
"tunnelmole": "^2.4.0",
|
|
48
|
+
"werift": "^0.22.9",
|
|
49
|
+
"ws": "^8.19.0"
|
|
41
50
|
},
|
|
42
51
|
"publishConfig": {
|
|
43
52
|
"access": "public",
|
|
44
53
|
"provenance": true
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/localtunnel": "^2.0.4",
|
|
57
|
+
"@types/ws": "^8.18.1"
|
|
45
58
|
}
|
|
46
59
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execFileSync } from 'child_process';
|
|
4
|
+
import {
|
|
5
|
+
copyFileSync,
|
|
6
|
+
existsSync,
|
|
7
|
+
mkdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
rmSync,
|
|
10
|
+
writeFileSync,
|
|
11
|
+
} from 'fs';
|
|
12
|
+
import { dirname, join, resolve } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
|
|
15
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const packageDir = resolve(scriptDir, '..');
|
|
17
|
+
const sourceFile = join(packageDir, 'macos', 'VectorMenuBar.swift');
|
|
18
|
+
const repoRoot = resolve(packageDir, '..', '..');
|
|
19
|
+
const menuBarIcon1x = join(
|
|
20
|
+
repoRoot,
|
|
21
|
+
'cli',
|
|
22
|
+
'macos',
|
|
23
|
+
'assets',
|
|
24
|
+
'vector-menubar.png',
|
|
25
|
+
);
|
|
26
|
+
const menuBarIcon2x = join(
|
|
27
|
+
repoRoot,
|
|
28
|
+
'cli',
|
|
29
|
+
'macos',
|
|
30
|
+
'assets',
|
|
31
|
+
'vector-menubar@2x.png',
|
|
32
|
+
);
|
|
33
|
+
const nativeDir = join(packageDir, 'native');
|
|
34
|
+
const appDir = join(nativeDir, 'VectorMenuBar.app');
|
|
35
|
+
const contentsDir = join(appDir, 'Contents');
|
|
36
|
+
const macOSDir = join(contentsDir, 'MacOS');
|
|
37
|
+
const resourcesDir = join(contentsDir, 'Resources');
|
|
38
|
+
const executablePath = join(macOSDir, 'VectorMenuBar');
|
|
39
|
+
const packageJsonPath = join(packageDir, 'package.json');
|
|
40
|
+
|
|
41
|
+
if (process.platform !== 'darwin') {
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!existsSync(sourceFile)) {
|
|
46
|
+
throw new Error(`Missing Swift source: ${sourceFile}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!existsSync(menuBarIcon1x) || !existsSync(menuBarIcon2x)) {
|
|
50
|
+
throw new Error('Missing Vector menu bar icon assets.');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
rmSync(appDir, { recursive: true, force: true });
|
|
54
|
+
mkdirSync(macOSDir, { recursive: true });
|
|
55
|
+
mkdirSync(resourcesDir, { recursive: true });
|
|
56
|
+
|
|
57
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
58
|
+
const buildDir = join(nativeDir, '.build');
|
|
59
|
+
rmSync(buildDir, { recursive: true, force: true });
|
|
60
|
+
mkdirSync(buildDir, { recursive: true });
|
|
61
|
+
|
|
62
|
+
const arm64Binary = join(buildDir, 'VectorMenuBar-arm64');
|
|
63
|
+
const x64Binary = join(buildDir, 'VectorMenuBar-x64');
|
|
64
|
+
|
|
65
|
+
buildTarget('arm64-apple-macos14.0', arm64Binary);
|
|
66
|
+
buildTarget('x86_64-apple-macos14.0', x64Binary);
|
|
67
|
+
|
|
68
|
+
execFileSync(
|
|
69
|
+
'lipo',
|
|
70
|
+
['-create', '-output', executablePath, arm64Binary, x64Binary],
|
|
71
|
+
{
|
|
72
|
+
stdio: 'inherit',
|
|
73
|
+
},
|
|
74
|
+
);
|
|
75
|
+
execFileSync('chmod', ['+x', executablePath], { stdio: 'inherit' });
|
|
76
|
+
rmSync(buildDir, { recursive: true, force: true });
|
|
77
|
+
copyFileSync(menuBarIcon1x, join(resourcesDir, 'vector-menubar.png'));
|
|
78
|
+
copyFileSync(menuBarIcon2x, join(resourcesDir, 'vector-menubar@2x.png'));
|
|
79
|
+
|
|
80
|
+
writeFileSync(
|
|
81
|
+
join(contentsDir, 'Info.plist'),
|
|
82
|
+
`<?xml version="1.0" encoding="UTF-8"?>
|
|
83
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
84
|
+
<plist version="1.0">
|
|
85
|
+
<dict>
|
|
86
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
87
|
+
<string>en</string>
|
|
88
|
+
<key>CFBundleExecutable</key>
|
|
89
|
+
<string>VectorMenuBar</string>
|
|
90
|
+
<key>CFBundleIdentifier</key>
|
|
91
|
+
<string>com.vector.menubar</string>
|
|
92
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
93
|
+
<string>6.0</string>
|
|
94
|
+
<key>CFBundleName</key>
|
|
95
|
+
<string>VectorMenuBar</string>
|
|
96
|
+
<key>CFBundlePackageType</key>
|
|
97
|
+
<string>APPL</string>
|
|
98
|
+
<key>CFBundleShortVersionString</key>
|
|
99
|
+
<string>${pkg.version}</string>
|
|
100
|
+
<key>CFBundleVersion</key>
|
|
101
|
+
<string>${pkg.version}</string>
|
|
102
|
+
<key>LSUIElement</key>
|
|
103
|
+
<true/>
|
|
104
|
+
<key>NSHighResolutionCapable</key>
|
|
105
|
+
<true/>
|
|
106
|
+
</dict>
|
|
107
|
+
</plist>
|
|
108
|
+
`,
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
function buildTarget(target, outputPath) {
|
|
112
|
+
execFileSync(
|
|
113
|
+
'swiftc',
|
|
114
|
+
['-O', '-target', target, sourceFile, '-o', outputPath],
|
|
115
|
+
{ stdio: 'inherit' },
|
|
116
|
+
);
|
|
117
|
+
}
|