capix-code 1.4.4 → 1.4.6
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 +1 -1
- package/scripts/assert-artifact.sh +1 -0
- package/scripts/build.sh +8 -1
- package/scripts/postinstall.cjs +16 -5
package/package.json
CHANGED
package/scripts/build.sh
CHANGED
|
@@ -51,13 +51,20 @@ fi
|
|
|
51
51
|
if [ -n "$OUTPUT" ]; then
|
|
52
52
|
ARTIFACT="$DIR/dist/customer"
|
|
53
53
|
rm -rf "$ARTIFACT"
|
|
54
|
-
mkdir -p "$ARTIFACT/bin" "$ARTIFACT/engine" "$ARTIFACT/runtime/packages" "$ARTIFACT/config"
|
|
54
|
+
mkdir -p "$ARTIFACT/bin" "$ARTIFACT/engine" "$ARTIFACT/runtime/packages" "$ARTIFACT/config" "$ARTIFACT/mcp"
|
|
55
55
|
cp "$OUTPUT" "$ARTIFACT/engine/capix-engine$EXE_SUFFIX"
|
|
56
56
|
cp -R "$DIR/src" "$ARTIFACT/runtime/src"
|
|
57
57
|
cp -R "$DIR/packages/runtime-provider" "$ARTIFACT/runtime/packages/runtime-provider"
|
|
58
58
|
cp "$DIR/config/runtime-package.json" "$ARTIFACT/runtime/package.json"
|
|
59
59
|
cp "$DIR/config/capix-defaults.json" "$DIR/config/defaults.json" "$ARTIFACT/config/"
|
|
60
60
|
cp -R "$DIR/commands" "$ARTIFACT/commands"
|
|
61
|
+
# Build and bundle the MCP server from the capix-mcp package
|
|
62
|
+
mkdir -p "$ARTIFACT/mcp"
|
|
63
|
+
npm install capix-mcp@2.1.0 --prefix "$DIR/dist/mcp-tmp" 2>/dev/null
|
|
64
|
+
cp -R "$DIR/dist/mcp-tmp/node_modules/capix-mcp/dist/"* "$ARTIFACT/mcp/" 2>/dev/null
|
|
65
|
+
cp "$DIR/dist/mcp-tmp/node_modules/capix-mcp/package.json" "$ARTIFACT/mcp/" 2>/dev/null
|
|
66
|
+
cp -R "$DIR/dist/mcp-tmp/node_modules/capix-mcp/node_modules/" "$ARTIFACT/mcp/node_modules/" 2>/dev/null
|
|
67
|
+
rm -rf "$DIR/dist/mcp-tmp"
|
|
61
68
|
chmod 0755 "$ARTIFACT/engine/capix-engine$EXE_SUFFIX"
|
|
62
69
|
# Install from the dedicated runtime manifest. The outer npm package has
|
|
63
70
|
# platform selectors which do not belong inside the embedded runtime.
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -4,7 +4,6 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
6
|
|
|
7
|
-
// Skip in CI environments
|
|
8
7
|
if (process.env.CI || process.env.GITHUB_ACTIONS) {
|
|
9
8
|
console.log('Skipping binary download in CI environment.');
|
|
10
9
|
process.exit(0);
|
|
@@ -38,7 +37,6 @@ try {
|
|
|
38
37
|
|
|
39
38
|
const customerSrc = path.join(tmpDir, 'customer');
|
|
40
39
|
if (fs.existsSync(customerSrc)) {
|
|
41
|
-
// Copy bin/ and engine/ and runtime/ to ~/.capix-code
|
|
42
40
|
for (const dir of ['bin', 'engine', 'runtime', 'config']) {
|
|
43
41
|
const src = path.join(customerSrc, dir);
|
|
44
42
|
const dst = path.join(installDir, dir);
|
|
@@ -46,16 +44,29 @@ try {
|
|
|
46
44
|
execSync(`cp -a "${src}" "${dst}"`, { stdio: 'inherit' });
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
|
-
// Ensure bin is executable
|
|
50
47
|
const binPath = path.join(installDir, 'bin', 'capix-code');
|
|
51
48
|
if (fs.existsSync(binPath)) {
|
|
52
49
|
fs.chmodSync(binPath, 0o755);
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
//
|
|
57
|
-
|
|
53
|
+
// Install MCP server from npm
|
|
54
|
+
const mcpDir = path.join(installDir, 'mcp');
|
|
55
|
+
const mcpEntry = path.join(mcpDir, 'capix-mcp.js');
|
|
56
|
+
if (!fs.existsSync(mcpEntry)) {
|
|
57
|
+
console.log('Installing capix-mcp server from npm...');
|
|
58
|
+
fs.mkdirSync(mcpDir, { recursive: true });
|
|
59
|
+
execSync(`npm install capix-mcp@2.1.0`, { cwd: mcpDir, stdio: 'inherit' });
|
|
60
|
+
// Create entry point wrapper
|
|
61
|
+
fs.writeFileSync(mcpEntry,
|
|
62
|
+
'#!/usr/bin/env node\n' +
|
|
63
|
+
`require('${path.join(mcpDir, 'node_modules', 'capix-mcp', 'dist', 'index.js')}');\n`
|
|
64
|
+
);
|
|
65
|
+
fs.chmodSync(mcpEntry, 0o755);
|
|
66
|
+
console.log('✓ capix-mcp installed');
|
|
67
|
+
}
|
|
58
68
|
|
|
69
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
59
70
|
console.log(`✓ Capix Code v${VERSION} installed to ${installDir}`);
|
|
60
71
|
console.log('Run: capix-code --version');
|
|
61
72
|
} catch (err) {
|