capix-code 1.4.4 → 1.4.5
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 -2
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
|
@@ -39,7 +39,7 @@ try {
|
|
|
39
39
|
const customerSrc = path.join(tmpDir, 'customer');
|
|
40
40
|
if (fs.existsSync(customerSrc)) {
|
|
41
41
|
// Copy bin/ and engine/ and runtime/ to ~/.capix-code
|
|
42
|
-
for (const dir of ['bin', 'engine', 'runtime', 'config']) {
|
|
42
|
+
for (const dir of ['bin', 'engine', 'runtime', 'config', 'mcp']) {
|
|
43
43
|
const src = path.join(customerSrc, dir);
|
|
44
44
|
const dst = path.join(installDir, dir);
|
|
45
45
|
if (fs.existsSync(src)) {
|
|
@@ -53,7 +53,21 @@ try {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
//
|
|
56
|
+
// Ensure MCP is available — download from npm if not in the tarball
|
|
57
|
+
const mcpDir = path.join(installDir, 'mcp');
|
|
58
|
+
const mcpEntry = path.join(mcpDir, 'capix-mcp.js');
|
|
59
|
+
if (!fs.existsSync(mcpEntry)) {
|
|
60
|
+
console.log('Installing capix-mcp server...');
|
|
61
|
+
try {
|
|
62
|
+
execSync(`npm install capix-mcp@2.1.0 --prefix "${mcpDir}" 2>&1`, { stdio: 'inherit' });
|
|
63
|
+
// Create a wrapper entry point
|
|
64
|
+
fs.writeFileSync(mcpEntry, `#!/usr/bin/env node\nimport('${path.join(mcpDir, 'node_modules', 'capix-mcp', 'dist', 'index.js')}');\n`);
|
|
65
|
+
fs.chmodSync(mcpEntry, 0o755);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.warn('⚠ capix-mcp install failed. Install manually: npm install -g capix-mcp');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
57
71
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
58
72
|
|
|
59
73
|
console.log(`✓ Capix Code v${VERSION} installed to ${installDir}`);
|