@dinoxx/dinox-cli 2.5.2 → 2.7.0

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.
@@ -42,6 +42,8 @@ export type DaemonPingResult = {
42
42
  runtimeConfigFingerprint: string | null;
43
43
  /** True only for daemons using the current authenticated local protocol. */
44
44
  authenticated: boolean;
45
+ /** Service manager that owns the process; null or absent (older daemons) when unmanaged. */
46
+ supervisor?: 'launchd' | 'systemd' | 'schtasks' | null;
45
47
  };
46
48
  /** Kept only for old scripts that pass --port; the daemon transport is socket-based. */
47
49
  export declare const DEFAULT_DAEMON_PORT = 45678;
@@ -213,6 +213,8 @@ export class AcpGatewayAdapter {
213
213
  cwd: this.gateway.cwd ?? os.homedir(),
214
214
  env: { ...process.env, ...(this.gateway.env ?? {}) },
215
215
  stdio: ['pipe', 'pipe', 'pipe'],
216
+ // The daemon runs without a visible console on Windows; keep agents that way.
217
+ windowsHide: true,
216
218
  });
217
219
  child.stderr.on('data', (chunk) => this.log('agent stderr', { text: chunk.toString('utf8').slice(0, 2000) }));
218
220
  const exited = new Promise((_, reject) => {
@@ -70,7 +70,7 @@ export async function findExecutable(name, envPath = process.env.PATH ?? '') {
70
70
  }
71
71
  /** Starts the agent, runs `initialize`, and stops it. Never leaves the process running. */
72
72
  export async function probeAcpAgent(command, args, timeoutMs = PROBE_TIMEOUT_MS) {
73
- const child = spawn(command, args, { stdio: ['pipe', 'pipe', 'ignore'], env: process.env });
73
+ const child = spawn(command, args, { stdio: ['pipe', 'pipe', 'ignore'], env: process.env, windowsHide: true });
74
74
  let timer;
75
75
  try {
76
76
  const exited = new Promise((_, reject) => {
@@ -1,5 +1,6 @@
1
1
  import os from 'node:os';
2
2
  import { getPackageVersion } from '../utils/version.js';
3
+ import { writeDaemonLogLine } from '../daemon/log.js';
3
4
  import { createGatewayAdapter } from './adapters/index.js';
4
5
  import { getMachineId, loadGateways, updateGatewaySettings } from './config.js';
5
6
  import { GatewayDeviceHost } from './deviceHost.js';
@@ -15,9 +16,7 @@ function applyLiveSettings(target, source) {
15
16
  target[key] = source[key];
16
17
  }
17
18
  }
18
- const defaultLog = (message, details) => {
19
- process.stderr.write(`[dinox-gateway] ${message}${details ? ` ${JSON.stringify(details)}` : ''}\n`);
20
- };
19
+ const defaultLog = (message, details) => writeDaemonLogLine('dinox-gateway', message, details);
21
20
  /**
22
21
  * Runs every enabled gateway inside the daemon: the daemon owns the PowerSync
23
22
  * database, so gateway writes share its connection and upload queue.
@@ -63,6 +63,14 @@ export declare const ERROR_CODES: {
63
63
  readonly exitCode: 1;
64
64
  readonly description: "The daemon did not release database ownership in time.";
65
65
  };
66
+ readonly DAEMON_SERVICE_FAILED: {
67
+ readonly exitCode: 1;
68
+ readonly description: "The service manager (launchd / systemd) rejected a daemon service operation.";
69
+ };
70
+ readonly DAEMON_SERVICE_UNSUPPORTED: {
71
+ readonly exitCode: 5;
72
+ readonly description: "The daemon cannot run as a login service on this platform or with this auth setup.";
73
+ };
66
74
  readonly DAEMON_STALE: {
67
75
  readonly exitCode: 5;
68
76
  readonly description: "The daemon state is stale and needs a restart.";
@@ -21,6 +21,8 @@ export const ERROR_CODES = {
21
21
  DAEMON_LEGACY_UNVERIFIED: { exitCode: 1, description: 'A daemon from an older CLI could not be verified safely.' },
22
22
  DAEMON_RELEASE_FAILED: { exitCode: 1, description: 'The daemon could not release database ownership.' },
23
23
  DAEMON_RELEASE_TIMEOUT: { exitCode: 1, description: 'The daemon did not release database ownership in time.' },
24
+ DAEMON_SERVICE_FAILED: { exitCode: 1, description: 'The service manager (launchd / systemd) rejected a daemon service operation.' },
25
+ DAEMON_SERVICE_UNSUPPORTED: { exitCode: 5, description: 'The daemon cannot run as a login service on this platform or with this auth setup.' },
24
26
  DAEMON_STALE: { exitCode: 5, description: 'The daemon state is stale and needs a restart.' },
25
27
  DAEMON_START_FAILED: { exitCode: 5, description: 'The daemon process failed to start.' },
26
28
  DAEMON_START_TIMEOUT: { exitCode: 1, description: 'The daemon did not become ready in time.' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dinoxx/dinox-cli",
3
- "version": "2.5.2",
3
+ "version": "2.7.0",
4
4
  "description": "Dinox CLI",
5
5
  "main": "dist/dinox.js",
6
6
  "scripts": {