capix-code 2.0.1 → 2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/rebrand.sh +68 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capix-code",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Capix Code — decentralized AI coding agent with GPU marketplace",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -243,4 +243,72 @@ fi
243
243
 
244
244
  echo "✓ Rebrand complete. Only the binary name, config dirs, and env vars are rebranded."
245
245
  echo " Runtime plugin/provider are staged by scripts/build.sh and verified fail-closed."
246
+ # ── Standalone binary integration ──────────────────────────────────────
247
+ # Copy our source files into the upstream's capix-code package so they
248
+ # are compiled INTO the binary by Bun. This makes the binary truly
249
+ # standalone — no external .ts files, tsconfig, or typescript needed
250
+ # for the core provider.
251
+
252
+ echo "▸ Integrating Capix provider into upstream source tree…"
253
+
254
+ # Copy our src/*.ts files into the upstream's capix-code/src/
255
+ for file in \
256
+ ai-sdk-provider.ts broker.ts capix-provider.ts credential-constants.ts \
257
+ intelligence-client.ts logger.ts mcp-supervisor.ts native-bridge.ts \
258
+ plugin.ts sandbox.ts url-builder.ts; do
259
+ if [ -f "$DIR/src/$file" ]; then
260
+ cp "$DIR/src/$file" "$CAPIX_CODE_DIR/packages/capix-code/src/$file"
261
+ fi
262
+ done
263
+
264
+ # Copy planner subdir
265
+ if [ -d "$DIR/src/planner" ]; then
266
+ mkdir -p "$CAPIX_CODE_DIR/packages/capix-code/src/planner"
267
+ cp -R "$DIR/src/planner/"* "$CAPIX_CODE_DIR/packages/capix-code/src/planner/"
268
+ fi
269
+
270
+ # Copy our runtime-provider package
271
+ mkdir -p "$CAPIX_CODE_DIR/packages/runtime-provider/src"
272
+ cp "$DIR/packages/runtime-provider/package.json" "$CAPIX_CODE_DIR/packages/runtime-provider/package.json"
273
+ cp "$DIR/packages/runtime-provider/src/index.ts" "$CAPIX_CODE_DIR/packages/runtime-provider/src/index.ts"
274
+
275
+ # Add @capix/runtime-provider to the upstream's workspace
276
+ UPSTREAM_PKG="$CAPIX_CODE_DIR/package.json"
277
+ if [ -f "$UPSTREAM_PKG" ]; then
278
+ if ! grep -q "runtime-provider" "$UPSTREAM_PKG"; then
279
+ sed -i.bak 's|"packages/capix-code"|"packages/capix-code",\n "packages/runtime-provider"|' "$UPSTREAM_PKG"
280
+ rm -f "$UPSTREAM_PKG.bak"
281
+ fi
282
+ fi
283
+
284
+ # Add @capix/runtime-provider to BUNDLED_PROVIDERS in provider.ts
285
+ PROVIDER_TS="$CAPIX_CODE_DIR/packages/capix-code/src/provider/provider.ts"
286
+ if [ -f "$PROVIDER_TS" ] && ! grep -q "capix/runtime-provider" "$PROVIDER_TS"; then
287
+ sed -i.bak 's|const BUNDLED_PROVIDERS: Record<string, () => Promise<(opts: any) => BundledSDK>> = {|const BUNDLED_PROVIDERS: Record<string, () => Promise<(opts: any) => BundledSDK>> = {\n "@capix/runtime-provider": () => import("@capix/runtime-provider").then((m) => m.createCapix),|' "$PROVIDER_TS"
288
+ rm -f "$PROVIDER_TS.bak"
289
+ fi
290
+
291
+ # The @ai-sdk/provider import in runtime-provider needs to resolve
292
+ # from the upstream's node_modules. Add it to the workspace deps.
293
+ RT_PKG="$CAPIX_CODE_DIR/packages/runtime-provider/package.json"
294
+ if [ -f "$RT_PKG" ]; then
295
+ # Change export path to work from upstream context
296
+ cat > "$RT_PKG" << 'RTPKG'
297
+ {
298
+ "name": "@capix/runtime-provider",
299
+ "version": "0.1.0",
300
+ "private": true,
301
+ "type": "module",
302
+ "exports": "./src/index.ts",
303
+ "dependencies": {
304
+ "@ai-sdk/provider": "3.0.8"
305
+ }
306
+ }
307
+ RTPKG
308
+ fi
309
+
310
+ echo " ✓ Capix provider integrated into source tree"
311
+
312
+ # ── End standalone integration ────────────────────────────────────────
313
+
246
314
  "$DIR/scripts/assert-upstream-brand.sh" "$CAPIX_CODE_DIR"