@cordfuse/crosstalk 7.0.0-alpha.13 → 7.0.0-alpha.15

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/commands/init.js CHANGED
@@ -31,11 +31,9 @@ import {
31
31
  storagePaths,
32
32
  pickFreePort,
33
33
  DEFAULT_CONTAINER_NAME,
34
+ DEFAULT_IMAGE,
34
35
  } from '../lib/resolve.js';
35
36
 
36
- const DEFAULT_IMAGE = process.env.CROSSTALK_IMAGE
37
- ?? 'ghcr.io/cordfuse/crosstalk-server:7.0.0-alpha.8';
38
-
39
37
  function usage(exit = 0) {
40
38
  const w = exit === 0 ? process.stdout : process.stderr;
41
39
  w.write(
package/commands/up.js CHANGED
@@ -20,12 +20,10 @@ import {
20
20
  containerExists,
21
21
  apiPortFor,
22
22
  DEFAULT_CONTAINER_NAME,
23
+ DEFAULT_IMAGE,
23
24
  CROSSTALK_LABEL,
24
25
  } from '../lib/resolve.js';
25
26
 
26
- const DEFAULT_IMAGE = process.env.CROSSTALK_IMAGE
27
- ?? 'ghcr.io/cordfuse/crosstalk-server:7.0.0-alpha.8';
28
-
29
27
  function usage(exit = 0) {
30
28
  const w = exit === 0 ? process.stdout : process.stderr;
31
29
  w.write(
package/lib/resolve.js CHANGED
@@ -12,13 +12,28 @@
12
12
 
13
13
  import { existsSync, readFileSync, mkdirSync, readdirSync } from 'fs';
14
14
  import { spawnSync } from 'child_process';
15
- import { join } from 'path';
15
+ import { dirname, join } from 'path';
16
+ import { fileURLToPath } from 'url';
16
17
  import { homedir } from 'os';
17
18
 
18
19
  export const DEFAULT_CONTAINER_NAME = 'crosstalk';
19
20
  export const DEFAULT_API_PORT = 7000;
20
21
  export const CROSSTALK_LABEL = 'crosstalk.transport=true';
21
22
 
23
+ // Client version is the single source of truth for the bundled engine
24
+ // image tag. Both must move together — if they don't, a fresh operator
25
+ // running `npm i -g @cordfuse/crosstalk && crosstalk init && crosstalk up`
26
+ // gets an engine that's N versions behind the client and the skew WARN
27
+ // fires on the first API call. Before alpha.14 these were two hardcoded
28
+ // literals in init.js + up.js that rotted independently of package.json
29
+ // (caught by mac at the alpha.13 → beta.1 gate; the literal was still
30
+ // alpha.8 five cuts later). Reading once at module load.
31
+ const _thisDir = dirname(fileURLToPath(import.meta.url));
32
+ const _pkg = JSON.parse(readFileSync(join(_thisDir, '..', 'package.json'), 'utf-8'));
33
+ export const CLIENT_VERSION = _pkg.version;
34
+ export const DEFAULT_IMAGE = process.env.CROSSTALK_IMAGE
35
+ ?? `ghcr.io/cordfuse/crosstalk-server:${CLIENT_VERSION}`;
36
+
22
37
  // Per-OS storage bases. User-mode (default) keeps everything under the
23
38
  // operator's home — no sudo/UAC, no Docker Desktop file-sharing allowlist
24
39
  // gymnastics. System-mode is for headless multi-operator deployments.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cordfuse/crosstalk",
3
- "version": "7.0.0-alpha.13",
3
+ "version": "7.0.0-alpha.15",
4
4
  "description": "Crosstalk client — host-side CLI that talks to the crosstalkd daemon running inside the crosstalk-server container.",
5
5
  "type": "module",
6
6
  "license": "MIT",