@aidotnet/astra-gate 0.11.0 → 0.11.3

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
@@ -202,7 +202,8 @@ var CLIENT_KINDS = [
202
202
  "workbuddy",
203
203
  "workbuddy-ai",
204
204
  "muse-code",
205
- "paseo"
205
+ "paseo",
206
+ "tkcode"
206
207
  ];
207
208
  var PLUGIN_CLIENT_KIND = /^plugin-[a-z0-9][a-z0-9._-]{0,63}$/;
208
209
  function isClientKind(kind) {
@@ -660,11 +661,15 @@ function installManagedBinary(o) {
660
661
  fs5.copyFileSync(o.stagedPath, tmp);
661
662
  fs5.renameSync(tmp, target);
662
663
  if (o.platform !== "win32") fs5.chmodSync(target, 493);
663
- for (const lib of o.nativeLibraries ?? []) installNativeCompanion(lib, o.serverDir);
664
664
  return target;
665
665
  }
666
+ function installNativeCompanions(staged, serverDir) {
667
+ fs5.mkdirSync(serverDir, { recursive: true });
668
+ for (const lib of staged) installNativeCompanion(lib, serverDir);
669
+ }
666
670
  function installNativeCompanion(staged, serverDir) {
667
671
  const dest = path6.join(serverDir, path6.basename(staged));
672
+ if (fs5.existsSync(dest) && sameContent(staged, dest)) return;
668
673
  const tmp = `${dest}.tmp`;
669
674
  const prev = `${dest}.prev`;
670
675
  fs5.copyFileSync(staged, tmp);
@@ -672,6 +677,13 @@ function installNativeCompanion(staged, serverDir) {
672
677
  if (fs5.existsSync(dest)) fs5.copyFileSync(dest, prev);
673
678
  fs5.renameSync(tmp, dest);
674
679
  }
680
+ function sameContent(a, b) {
681
+ try {
682
+ return fs5.readFileSync(a).equals(fs5.readFileSync(b));
683
+ } catch {
684
+ return false;
685
+ }
686
+ }
675
687
  function companionPrevNames(serverDir) {
676
688
  let entries = [];
677
689
  try {
@@ -807,7 +819,6 @@ async function applyServerUpdate(o) {
807
819
  if (backupPath) log(`Backed up the current binary to ${backupPath}`);
808
820
  const serverPath = installManagedBinary({
809
821
  stagedPath: staged.path,
810
- nativeLibraries: staged.nativeLibraries,
811
822
  serverDir: paths.serverDir,
812
823
  version: o.manifest.version,
813
824
  platform: o.platform
@@ -820,6 +831,7 @@ async function applyServerUpdate(o) {
820
831
  log("Restarting the Astra server\u2026");
821
832
  await o.control.stop();
822
833
  }
834
+ installNativeCompanions(staged.nativeLibraries, paths.serverDir);
823
835
  try {
824
836
  webRootSwapped = installManagedWebRoot(staged.path, paths.serverDir);
825
837
  } catch (err) {
@@ -1092,6 +1104,7 @@ function homePaths(home) {
1092
1104
  keysDir: path8.join(home, "keys"),
1093
1105
  pluginsDir: path8.join(home, "plugins"),
1094
1106
  toolsDir: path8.join(home, "tools"),
1107
+ connectDir: path8.join(home, "connect"),
1095
1108
  desktopPrefix: path8.join(home, "desktop")
1096
1109
  };
1097
1110
  }
@@ -1275,7 +1288,7 @@ import { fileURLToPath } from "url";
1275
1288
  // package.json
1276
1289
  var package_default = {
1277
1290
  name: "@aidotnet/astra-gate",
1278
- version: "0.11.0",
1291
+ version: "0.11.3",
1279
1292
  description: "Astra \u2014 a local AI gateway. Install, start, stop and manage the astra-server from the terminal.",
1280
1293
  license: "MIT",
1281
1294
  type: "module",
@@ -1306,12 +1319,12 @@ var package_default = {
1306
1319
  commander: "^12.1.0"
1307
1320
  },
1308
1321
  optionalDependencies: {
1309
- "@aidotnet/server-darwin-arm64": "0.11.0",
1310
- "@aidotnet/server-darwin-x64": "0.11.0",
1311
- "@aidotnet/server-linux-arm64": "0.11.0",
1312
- "@aidotnet/server-linux-x64": "0.11.0",
1313
- "@aidotnet/server-win32-arm64": "0.11.0",
1314
- "@aidotnet/server-win32-x64": "0.11.0"
1322
+ "@aidotnet/server-darwin-arm64": "0.11.3",
1323
+ "@aidotnet/server-darwin-x64": "0.11.3",
1324
+ "@aidotnet/server-linux-arm64": "0.11.3",
1325
+ "@aidotnet/server-linux-x64": "0.11.3",
1326
+ "@aidotnet/server-win32-arm64": "0.11.3",
1327
+ "@aidotnet/server-win32-x64": "0.11.3"
1315
1328
  },
1316
1329
  devDependencies: {
1317
1330
  "@aidotnet/update-core": "workspace:*",
@@ -1362,7 +1375,7 @@ function resolveServerBinary(options = {}) {
1362
1375
  }
1363
1376
  const repoRoot = findRepoRoot(cwd, exists);
1364
1377
  if (repoRoot) {
1365
- const binDir = path11.join(repoRoot, "src", "Astra.Server", "bin", "Debug", "net10.0");
1378
+ const binDir = path11.join(repoRoot, "src", "Astra.Server", "bin", "Debug", "net11.0");
1366
1379
  const native = path11.join(binDir, plat.binaryName);
1367
1380
  if (exists(native)) return { command: native, args: [], serverPath: native, source: "repo" };
1368
1381
  const dll = path11.join(binDir, "astra-server.dll");
@@ -2079,11 +2092,11 @@ function ensureDesktopServer(o) {
2079
2092
  const { serverDir } = updatePaths(o.home);
2080
2093
  serverPath = installManagedBinary({
2081
2094
  stagedPath: packaged.path,
2082
- nativeLibraries: findNativeCompanions(packaged.path),
2083
2095
  serverDir,
2084
2096
  version: o.version,
2085
2097
  platform: o.platform
2086
2098
  });
2099
+ installNativeCompanions(findNativeCompanions(packaged.path), serverDir);
2087
2100
  if (installManagedWebRoot(packaged.path, serverDir)) commitManagedWebRoot(serverDir);
2088
2101
  commitNativeCompanions(serverDir);
2089
2102
  pruneManagedBinaries(serverDir, serverPath);