apteva 0.2.10 → 0.2.11

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/src/binary.ts +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apteva",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Run AI agents locally. Multi-provider support for Claude, GPT, Gemini, Llama, and more.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/binary.ts CHANGED
@@ -489,7 +489,7 @@ export async function downloadLatestBinary(binDir: string): Promise<{
489
489
  };
490
490
  }
491
491
 
492
- // Install via npm (preferred method)
492
+ // Install/update via npm (locally in project)
493
493
  export async function installViaNpm(): Promise<{
494
494
  success: boolean;
495
495
  version?: string;
@@ -497,12 +497,14 @@ export async function installViaNpm(): Promise<{
497
497
  }> {
498
498
  const packageName = getNpmPackageName();
499
499
 
500
- console.log(`${c.gray}Installing ${packageName}...${c.reset}`);
500
+ console.log(`${c.gray}Updating ${packageName}...${c.reset}`);
501
501
 
502
502
  try {
503
- const proc = Bun.spawn(["npm", "install", "-g", packageName], {
503
+ // Install locally (not globally) - updates the package in node_modules
504
+ const proc = Bun.spawn(["npm", "update", packageName], {
504
505
  stdout: "pipe",
505
506
  stderr: "pipe",
507
+ cwd: join(import.meta.dir, ".."), // Run in package root
506
508
  });
507
509
 
508
510
  const exitCode = await proc.exited;
@@ -511,7 +513,7 @@ export async function installViaNpm(): Promise<{
511
513
  const stderr = await new Response(proc.stderr).text();
512
514
  return {
513
515
  success: false,
514
- error: stderr || `npm install failed with code ${exitCode}`,
516
+ error: stderr || `npm update failed with code ${exitCode}`,
515
517
  };
516
518
  }
517
519
 
@@ -519,7 +521,7 @@ export async function installViaNpm(): Promise<{
519
521
  if (version) {
520
522
  saveVersion(version);
521
523
  }
522
- console.log(`${c.green}Installed agent v${version || "latest"}${c.reset}`);
524
+ console.log(`${c.green}Updated agent to v${version || "latest"}${c.reset}`);
523
525
 
524
526
  return {
525
527
  success: true,