capix-code 1.4.11 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capix-code",
3
- "version": "1.4.11",
3
+ "version": "1.5.0",
4
4
  "description": "Capix Code — decentralized AI coding agent with GPU marketplace",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/scripts/build.sh CHANGED
@@ -23,6 +23,7 @@ echo "▸ Building capix-code standalone binary…"
23
23
  # identifier. Stamp it with the immutable Capix Code package version so the TUI,
24
24
  # API metadata and diagnostics all report the customer release.
25
25
  CAPIX_RELEASE_VERSION="${CAPIX_CODE_VERSION:-$(node -p 'require(process.argv[1]).version' "$DIR/package.json")}"
26
+ export CAPIX_CODE_VERSION="$CAPIX_RELEASE_VERSION"
26
27
  export OPENCODE_VERSION="$CAPIX_RELEASE_VERSION"
27
28
 
28
29
  # Write default config if the init script exists.
@@ -63,6 +64,16 @@ if [ -n "$OUTPUT" ]; then
63
64
  npm install capix-mcp@2.1.0 --prefix "$DIR/dist/mcp-tmp" 2>/dev/null
64
65
  cp -R "$DIR/dist/mcp-tmp/node_modules/capix-mcp/dist/"* "$ARTIFACT/mcp/" 2>/dev/null
65
66
  cp "$DIR/dist/mcp-tmp/node_modules/capix-mcp/package.json" "$ARTIFACT/mcp/" 2>/dev/null
67
+ # Copy capix-mcp's dependencies (SDK, zod, etc.)
68
+ mkdir -p "$ARTIFACT/mcp/node_modules"
69
+ if [ -d "$DIR/dist/mcp-tmp/node_modules/capix-mcp/node_modules" ]; then
70
+ cp -R "$DIR/dist/mcp-tmp/node_modules/capix-mcp/node_modules/"* "$ARTIFACT/mcp/node_modules/" 2>/dev/null
71
+ fi
72
+ for dep in @modelcontextprotocol zod; do
73
+ if [ -d "$DIR/dist/mcp-tmp/node_modules/$dep" ]; then
74
+ cp -R "$DIR/dist/mcp-tmp/node_modules/$dep" "$ARTIFACT/mcp/node_modules/" 2>/dev/null
75
+ fi
76
+ done
66
77
  # Create entry point wrapper that shares credentials with capix-code
67
78
  cat > "$ARTIFACT/mcp/capix-mcp.js" << 'MCPWRAPPER'
68
79
  #!/usr/bin/env node
@@ -9,7 +9,7 @@ if (process.env.CI || process.env.GITHUB_ACTIONS) {
9
9
  process.exit(0);
10
10
  }
11
11
 
12
- const VERSION = '1.4.9';
12
+ const VERSION = '1.5.0';
13
13
  const PLATFORM_MAP = { darwin: 'darwin', linux: 'linux', win32: 'win32' };
14
14
  const ARCH_MAP = { arm64: 'arm64', x64: 'x64' };
15
15
  const platform = PLATFORM_MAP[process.platform] || 'linux';
@@ -1,81 +0,0 @@
1
- #!/usr/bin/env bash
2
- # build.sh — produce packaged capix-code binaries.
3
- set -euo pipefail
4
-
5
- DIR="$(cd "$(dirname "$0")/.." && pwd)"
6
- CAPIX_CODE_DIR="${CAPIX_CODE_DIR:-$DIR/upstream}"
7
- BUN="${BUN_BIN:-$(command -v bun || true)}"
8
- if [ -z "$BUN" ] && [ -x "$DIR/node_modules/.bin/bun" ]; then BUN="$DIR/node_modules/.bin/bun"; fi
9
- [ -n "$BUN" ] || { echo "✗ Bun 1.3.14 is required"; exit 1; }
10
- [ "$($BUN --version)" = "1.3.14" ] || { echo "✗ Expected Bun 1.3.14"; exit 1; }
11
-
12
- if [ ! -d "$CAPIX_CODE_DIR" ]; then
13
- echo "✗ No $CAPIX_CODE_DIR. Run ./scripts/bootstrap.sh first."
14
- exit 1
15
- fi
16
-
17
- cd "$CAPIX_CODE_DIR"
18
-
19
- echo "▸ Building capix-code standalone binary…"
20
- "$BUN" install
21
-
22
- # The embedded engine otherwise falls back to a timestamped 0.0.0 development
23
- # identifier. Stamp it with the immutable Capix Code package version so the TUI,
24
- # API metadata and diagnostics all report the customer release.
25
- CAPIX_RELEASE_VERSION="${CAPIX_CODE_VERSION:-$(node -p 'require(process.argv[1]).version' "$DIR/package.json")}"
26
- export OPENCODE_VERSION="$CAPIX_RELEASE_VERSION"
27
-
28
- # Write default config if the init script exists.
29
- if [ -f "packages/capix-code/scripts/init-capix-config.ts" ]; then
30
- "$BUN" run packages/capix-code/scripts/init-capix-config.ts 2>/dev/null || true
31
- fi
32
-
33
- # Build using the upstream build script.
34
- if [ -f "packages/capix-code/script/build.ts" ]; then
35
- "$BUN" run --cwd packages/capix-code script/build.ts --single
36
- fi
37
-
38
- # Find the output — handle both renamed and original patterns.
39
- EXE_SUFFIX=""
40
- case "$(uname -s)" in MINGW*|MSYS*|CYGWIN*) EXE_SUFFIX=".exe";; esac
41
- OUTPUT=$(find packages/capix-code/dist -name "capix-code$EXE_SUFFIX" -type f 2>/dev/null | head -1)
42
- if [ -z "$OUTPUT" ]; then
43
- OUTPUT=$(find packages/capix-code/dist -name "opencode$EXE_SUFFIX" -type f 2>/dev/null | head -1)
44
- if [ -n "$OUTPUT" ]; then
45
- NEW_OUTPUT="$(dirname "$OUTPUT")/capix-code$EXE_SUFFIX"
46
- mv "$OUTPUT" "$NEW_OUTPUT"
47
- OUTPUT="$NEW_OUTPUT"
48
- fi
49
- fi
50
-
51
- if [ -n "$OUTPUT" ]; then
52
- ARTIFACT="$DIR/dist/customer"
53
- rm -rf "$ARTIFACT"
54
- mkdir -p "$ARTIFACT/bin" "$ARTIFACT/engine" "$ARTIFACT/runtime/packages" "$ARTIFACT/config" "$ARTIFACT/mcp"
55
- cp "$OUTPUT" "$ARTIFACT/engine/capix-engine$EXE_SUFFIX"
56
- cp -R "$DIR/src" "$ARTIFACT/runtime/src"
57
- cp -R "$DIR/packages/runtime-provider" "$ARTIFACT/runtime/packages/runtime-provider"
58
- cp "$DIR/config/runtime-package.json" "$ARTIFACT/runtime/package.json"
59
- cp "$DIR/config/capix-defaults.json" "$DIR/config/defaults.json" "$ARTIFACT/config/"
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"
68
- chmod 0755 "$ARTIFACT/engine/capix-engine$EXE_SUFFIX"
69
- # Install from the dedicated runtime manifest. The outer npm package has
70
- # platform selectors which do not belong inside the embedded runtime.
71
- (cd "$ARTIFACT/runtime" && npm install --omit=dev --ignore-scripts)
72
- (cd "$DIR/launcher" && cargo build --locked --release)
73
- cp "$DIR/launcher/target/release/capix-code$EXE_SUFFIX" "$ARTIFACT/bin/capix-code$EXE_SUFFIX"
74
- chmod 0755 "$ARTIFACT/bin/capix-code$EXE_SUFFIX"
75
- "$DIR/scripts/assert-artifact.sh" "$ARTIFACT"
76
- "$DIR/scripts/assert-customer-brand.sh" "$ARTIFACT"
77
- echo "✓ Customer artifact staged: $ARTIFACT"
78
- else
79
- echo "✗ No binary found in dist/ — build may have failed."
80
- exit 1
81
- fi