instar 0.23.7 → 0.23.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwPH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA8gCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA80EtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwPH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA8gCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAy1EtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -3212,27 +3212,39 @@ export async function startServer(options) {
3212
3212
  const hasTelegram = !!telegram;
3213
3213
  const autostartInstalled = isAutostartInstalled(config.projectName);
3214
3214
  let needsReinstall = !autostartInstalled;
3215
- // On macOS, check if plist uses the modern JS boot wrapper
3216
- if (!needsReinstall && process.platform === 'darwin') {
3217
- const label = `ai.instar.${config.projectName}`;
3218
- const plistPath = path.join(os.homedir(), 'Library', 'LaunchAgents', `${label}.plist`);
3215
+ // On macOS, keep node symlink fresh and check plist format
3216
+ if (process.platform === 'darwin') {
3217
+ // Always update the node symlink — primary defense against NVM/asdf switches
3219
3218
  try {
3220
- const plistContent = fs.readFileSync(plistPath, 'utf-8');
3221
- if (!plistContent.includes('instar-boot.js')) {
3222
- needsReinstall = true;
3223
- console.log(pc.yellow(` Auto-start uses legacy format — upgrading to TCC-safe node entry point`));
3224
- }
3225
- else {
3226
- // Verify node path in plist still exists
3227
- const nodeMatch = plistContent.match(/<string>(\/[^<]+node[^<]*)<\/string>/);
3228
- if (nodeMatch && !fs.existsSync(nodeMatch[1])) {
3219
+ const { ensureStableNodeSymlink } = await import('./setup.js');
3220
+ ensureStableNodeSymlink(config.projectDir);
3221
+ }
3222
+ catch { /* non-critical */ }
3223
+ if (!needsReinstall) {
3224
+ const label = `ai.instar.${config.projectName}`;
3225
+ const plistPath = path.join(os.homedir(), 'Library', 'LaunchAgents', `${label}.plist`);
3226
+ try {
3227
+ const plistContent = fs.readFileSync(plistPath, 'utf-8');
3228
+ if (!plistContent.includes('instar-boot.js')) {
3229
+ needsReinstall = true;
3230
+ console.log(pc.yellow(` Auto-start uses legacy format — upgrading to TCC-safe node entry point`));
3231
+ }
3232
+ else if (!plistContent.includes('.instar/bin/node')) {
3229
3233
  needsReinstall = true;
3230
- console.log(pc.yellow(` Auto-start node path stale (${nodeMatch[1]}) regenerating`));
3234
+ console.log(pc.yellow(` Auto-start uses direct node path upgrading to stable symlink`));
3235
+ }
3236
+ else {
3237
+ // Verify node path in plist still exists (should be the symlink)
3238
+ const nodeMatch = plistContent.match(/<string>(\/[^<]+node[^<]*)<\/string>/);
3239
+ if (nodeMatch && !fs.existsSync(nodeMatch[1])) {
3240
+ needsReinstall = true;
3241
+ console.log(pc.yellow(` Auto-start node path stale (${nodeMatch[1]}) — regenerating`));
3242
+ }
3231
3243
  }
3232
3244
  }
3233
- }
3234
- catch { /* plist read failed — will reinstall */
3235
- needsReinstall = true;
3245
+ catch { /* plist read failed — will reinstall */
3246
+ needsReinstall = true;
3247
+ }
3236
3248
  }
3237
3249
  }
3238
3250
  if (needsReinstall) {