@aidotnet/astra-gate 0.10.0 → 0.11.1

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/dist/index.js CHANGED
@@ -660,11 +660,15 @@ function installManagedBinary(o) {
660
660
  fs5.copyFileSync(o.stagedPath, tmp);
661
661
  fs5.renameSync(tmp, target);
662
662
  if (o.platform !== "win32") fs5.chmodSync(target, 493);
663
- for (const lib of o.nativeLibraries ?? []) installNativeCompanion(lib, o.serverDir);
664
663
  return target;
665
664
  }
665
+ function installNativeCompanions(staged, serverDir) {
666
+ fs5.mkdirSync(serverDir, { recursive: true });
667
+ for (const lib of staged) installNativeCompanion(lib, serverDir);
668
+ }
666
669
  function installNativeCompanion(staged, serverDir) {
667
670
  const dest = path6.join(serverDir, path6.basename(staged));
671
+ if (fs5.existsSync(dest) && sameContent(staged, dest)) return;
668
672
  const tmp = `${dest}.tmp`;
669
673
  const prev = `${dest}.prev`;
670
674
  fs5.copyFileSync(staged, tmp);
@@ -672,6 +676,13 @@ function installNativeCompanion(staged, serverDir) {
672
676
  if (fs5.existsSync(dest)) fs5.copyFileSync(dest, prev);
673
677
  fs5.renameSync(tmp, dest);
674
678
  }
679
+ function sameContent(a, b) {
680
+ try {
681
+ return fs5.readFileSync(a).equals(fs5.readFileSync(b));
682
+ } catch {
683
+ return false;
684
+ }
685
+ }
675
686
  function companionPrevNames(serverDir) {
676
687
  let entries = [];
677
688
  try {
@@ -807,7 +818,6 @@ async function applyServerUpdate(o) {
807
818
  if (backupPath) log(`Backed up the current binary to ${backupPath}`);
808
819
  const serverPath = installManagedBinary({
809
820
  stagedPath: staged.path,
810
- nativeLibraries: staged.nativeLibraries,
811
821
  serverDir: paths.serverDir,
812
822
  version: o.manifest.version,
813
823
  platform: o.platform
@@ -820,6 +830,7 @@ async function applyServerUpdate(o) {
820
830
  log("Restarting the Astra server\u2026");
821
831
  await o.control.stop();
822
832
  }
833
+ installNativeCompanions(staged.nativeLibraries, paths.serverDir);
823
834
  try {
824
835
  webRootSwapped = installManagedWebRoot(staged.path, paths.serverDir);
825
836
  } catch (err) {
@@ -1275,7 +1286,7 @@ import { fileURLToPath } from "url";
1275
1286
  // package.json
1276
1287
  var package_default = {
1277
1288
  name: "@aidotnet/astra-gate",
1278
- version: "0.10.0",
1289
+ version: "0.11.1",
1279
1290
  description: "Astra \u2014 a local AI gateway. Install, start, stop and manage the astra-server from the terminal.",
1280
1291
  license: "MIT",
1281
1292
  type: "module",
@@ -1306,12 +1317,12 @@ var package_default = {
1306
1317
  commander: "^12.1.0"
1307
1318
  },
1308
1319
  optionalDependencies: {
1309
- "@aidotnet/server-darwin-arm64": "0.10.0",
1310
- "@aidotnet/server-darwin-x64": "0.10.0",
1311
- "@aidotnet/server-linux-arm64": "0.10.0",
1312
- "@aidotnet/server-linux-x64": "0.10.0",
1313
- "@aidotnet/server-win32-arm64": "0.10.0",
1314
- "@aidotnet/server-win32-x64": "0.10.0"
1320
+ "@aidotnet/server-darwin-arm64": "0.11.1",
1321
+ "@aidotnet/server-darwin-x64": "0.11.1",
1322
+ "@aidotnet/server-linux-arm64": "0.11.1",
1323
+ "@aidotnet/server-linux-x64": "0.11.1",
1324
+ "@aidotnet/server-win32-arm64": "0.11.1",
1325
+ "@aidotnet/server-win32-x64": "0.11.1"
1315
1326
  },
1316
1327
  devDependencies: {
1317
1328
  "@aidotnet/update-core": "workspace:*",
@@ -2079,11 +2090,11 @@ function ensureDesktopServer(o) {
2079
2090
  const { serverDir } = updatePaths(o.home);
2080
2091
  serverPath = installManagedBinary({
2081
2092
  stagedPath: packaged.path,
2082
- nativeLibraries: findNativeCompanions(packaged.path),
2083
2093
  serverDir,
2084
2094
  version: o.version,
2085
2095
  platform: o.platform
2086
2096
  });
2097
+ installNativeCompanions(findNativeCompanions(packaged.path), serverDir);
2087
2098
  if (installManagedWebRoot(packaged.path, serverDir)) commitManagedWebRoot(serverDir);
2088
2099
  commitNativeCompanions(serverDir);
2089
2100
  pruneManagedBinaries(serverDir, serverPath);