@koalaauto/agentchannel 3.57.1 → 3.57.2

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.
@@ -438,6 +438,9 @@ async function moveOldService(io, who, home) {
438
438
  const mark = join(home, `reload-${VERSION}`);
439
439
  if (env.ACH_SERVICE_DIR || existsSync(mark))
440
440
  return false;
441
+ // this release goes into the install first: the launcher would otherwise start the older one copied when the file was rewritten
442
+ if (!adoptFromNpx({ self: thisCliPath(), env, log: (s) => io.err(`[ach run] ${s}`) }))
443
+ return false;
441
444
  try {
442
445
  writeFileSync(mark, '', { mode: 0o600 });
443
446
  reloadService(platform, serviceFile(specOf(own, platform), undefined, env).start, env);
@@ -19,7 +19,7 @@
19
19
  import { execFile, spawn } from 'node:child_process';
20
20
  import { accessSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, unlinkSync, writeFileSync } from 'node:fs';
21
21
  import { dirname, join, sep } from 'node:path';
22
- import { appDir, appWritable, inApp, installIntoApp, setCurrent } from './appinstall.js';
22
+ import { appDir, appWritable, currentVersion, inApp, installIntoApp, setCurrent } from './appinstall.js';
23
23
  import { thisCliPath } from './invite.js';
24
24
  import { CLIENT_PROTO, newerVersion, PKG_NAME, VERSION } from './version.js';
25
25
  /** A restart-worthy exit: not 0 (systemd on-failure and launchd restart only a failure) and not 78 (key refused: do not restart). */
@@ -123,8 +123,17 @@ export async function preflight(kind, target, exec = defaultInstallExec) {
123
123
  export async function installRelease(kind, target, exec = defaultInstallExec) {
124
124
  if (kind.kind === 'other')
125
125
  return { ok: false, detail: kind.why };
126
- if (kind.kind === 'npx')
126
+ if (kind.kind === 'npx') {
127
+ // a home install already here (appinstall.ts): the restart may start its launcher instead of npx (the service was moved to it, or
128
+ // is moved at that start), and the launcher must not find an older release there
129
+ const app = appDir();
130
+ if (currentVersion(app)) {
131
+ const r = await installIntoApp(app, target, exec);
132
+ if (!r.ok)
133
+ return r;
134
+ }
127
135
  return { ok: true, detail: 'npx fetches it on restart' };
136
+ }
128
137
  if (kind.kind === 'app')
129
138
  return installIntoApp(kind.dir, target, exec);
130
139
  const r = await exec('npm', ['install', '-g', '--ignore-scripts', '--no-audit', '--no-fund', `${PKG_NAME}@${target}`], { timeoutMs: 5 * 60_000 });
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "3.57.1";
1
+ export declare const VERSION = "3.57.2";
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export declare const PKG_NAME = "@koalaauto/agentchannel";
4
4
  /**
@@ -1,4 +1,4 @@
1
- export const VERSION = '3.57.1';
1
+ export const VERSION = '3.57.2';
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export const PKG_NAME = '@koalaauto/agentchannel';
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalaauto/agentchannel",
3
- "version": "3.57.1",
3
+ "version": "3.57.2",
4
4
  "description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
5
5
  "keywords": [
6
6
  "agentchannel",