@harness-mix/cli 0.1.3 → 0.1.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harness-mix/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Harness Mix native Codex UI bridge for Codex, Pi, Claude Code, DeepSeek Harness, Antigravity, CodeBuddy, Kiro CLI, Cursor CLI and other native coding harnesses.",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
+
"postinstall": "node scripts/install-native.cjs",
|
|
35
36
|
"files": [
|
|
36
37
|
"CHANGELOG.md",
|
|
37
38
|
"src",
|
|
@@ -164,5 +165,13 @@
|
|
|
164
165
|
"@deepseek-ai/dsh": "0.1.2-rc.1",
|
|
165
166
|
"lucide": "1.28.0",
|
|
166
167
|
"zod": "4.4.3"
|
|
168
|
+
},
|
|
169
|
+
"optionalDependencies": {
|
|
170
|
+
"@harness-mix/native-win32-x64": "0.1.4",
|
|
171
|
+
"@harness-mix/native-win32-arm64": "0.1.4",
|
|
172
|
+
"@harness-mix/native-darwin-x64": "0.1.4",
|
|
173
|
+
"@harness-mix/native-darwin-arm64": "0.1.4",
|
|
174
|
+
"@harness-mix/native-linux-x64": "0.1.4",
|
|
175
|
+
"@harness-mix/native-linux-arm64": "0.1.4"
|
|
167
176
|
}
|
|
168
177
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
|
|
4
|
+
const root = path.resolve(__dirname, '..');
|
|
5
|
+
const platform = process.platform;
|
|
6
|
+
const arch = process.arch;
|
|
7
|
+
const packageName = `@harness-mix/native-${platform}-${arch}`;
|
|
8
|
+
const packageRoot = path.join(root, 'node_modules', '@harness-mix', `native-${platform}-${arch}`);
|
|
9
|
+
const destination = path.join(root, 'output', 'native-build');
|
|
10
|
+
const files = platform === 'win32'
|
|
11
|
+
? ['harness-mix-shim.exe', 'harness-mix-appx.exe', 'harness-mix-secret.exe']
|
|
12
|
+
: ['harness-mix-shim'];
|
|
13
|
+
|
|
14
|
+
if (!fs.existsSync(packageRoot)) {
|
|
15
|
+
console.warn(`[Harness Mix] Optional native package ${packageName} is not installed; build:native can create a local Shim.`);
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
19
|
+
for (const name of files) {
|
|
20
|
+
const source = path.join(packageRoot, 'bin', name);
|
|
21
|
+
if (!fs.existsSync(source)) throw new Error(`${packageName} is missing bin/${name}`);
|
|
22
|
+
const target = path.join(destination, name);
|
|
23
|
+
fs.copyFileSync(source, target);
|
|
24
|
+
if (platform !== 'win32') fs.chmodSync(target, 0o755);
|
|
25
|
+
}
|
|
26
|
+
console.log(`[Harness Mix] Installed native runtime for ${platform}-${arch}`);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const os = require('node:os');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { execFileSync } = require('node:child_process');
|
|
5
|
+
|
|
6
|
+
const [platform = process.platform, arch = process.arch, ...flags] = process.argv.slice(2);
|
|
7
|
+
const allowed = new Set(['win32-x64', 'win32-arm64', 'darwin-x64', 'darwin-arm64', 'linux-x64', 'linux-arm64']);
|
|
8
|
+
const key = `${platform}-${arch}`;
|
|
9
|
+
if (!allowed.has(key)) throw new Error(`Unsupported native package target: ${key}`);
|
|
10
|
+
const root = path.resolve(__dirname, '..');
|
|
11
|
+
const output = path.join(root, 'output', 'native-build');
|
|
12
|
+
const work = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-mix-native-package-'));
|
|
13
|
+
const pkg = path.join(work, 'package');
|
|
14
|
+
fs.mkdirSync(path.join(pkg, 'bin'), { recursive: true });
|
|
15
|
+
const version = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).version;
|
|
16
|
+
const names = platform === 'win32' ? ['harness-mix-shim.exe', 'harness-mix-appx.exe', 'harness-mix-secret.exe'] : ['harness-mix-shim'];
|
|
17
|
+
for (const name of names) {
|
|
18
|
+
const source = path.join(output, name);
|
|
19
|
+
if (!fs.existsSync(source)) throw new Error(`Missing ${source}; build the target runtime first`);
|
|
20
|
+
fs.copyFileSync(source, path.join(pkg, 'bin', name));
|
|
21
|
+
}
|
|
22
|
+
fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify({
|
|
23
|
+
name: `@harness-mix/native-${key}`, version, description: `Harness Mix native runtime for ${key}`,
|
|
24
|
+
license: 'Apache-2.0', os: [platform], cpu: [arch], files: ['bin'], publishConfig: { access: 'public' },
|
|
25
|
+
}, null, 2) + '\n');
|
|
26
|
+
fs.writeFileSync(path.join(pkg, 'README.md'), `# @harness-mix/native-${key}\n\nNative runtime selected automatically by @harness-mix/cli.\n`);
|
|
27
|
+
const publish = flags.includes('--publish');
|
|
28
|
+
const npmArgs = ['pack', '--json'];
|
|
29
|
+
if (publish) npmArgs.splice(0, npmArgs.length, 'publish', '--access', 'public', '--registry=https://registry.npmjs.org');
|
|
30
|
+
const npmCommand = process.platform === 'win32' ? (process.env.ComSpec || 'cmd.exe') : 'npm';
|
|
31
|
+
const commandArgs = process.platform === 'win32' ? ['/d', '/s', '/c', 'npm.cmd', ...npmArgs] : npmArgs;
|
|
32
|
+
const result = execFileSync(npmCommand, commandArgs, { cwd: pkg, encoding: 'utf8', stdio: 'pipe' });
|
|
33
|
+
process.stdout.write(result);
|
|
34
|
+
console.log(`${publish ? 'Published' : 'Packed'} @harness-mix/native-${key}@${version}`);
|