@jini-ai/sidecar 0.4.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @jini-ai/sidecar
2
2
 
3
+ ## 0.4.2 — 2026-10-13
4
+
5
+ - The Node supervisor imports `@jini-ai/platform/command` and `/process` instead of the platform root; peer `@jini-ai/platform` floor is now `^0.5.5`.
6
+
7
+ ## 0.4.1
8
+
9
+ ### Patch Changes
10
+
11
+ - Tovu clean-up release (2026-10-08): code Tovu moved into Jini, plus the Jini clean-up (see the commit log since 0.4.0).
12
+
3
13
  ## 0.4.0 — 2026-10-02
4
14
 
5
15
  ### BREAKING
@@ -1,4 +1,5 @@
1
1
  import type { Writable } from "node:stream";
2
+ import type { ChildProcess, SpawnOptions } from "node:child_process";
2
3
  import type { LocalDaemonRegistryRecord } from "./daemon-registry.js";
3
4
  import type { SpawnedDaemonProcess, SupervisorScheduler } from "./supervisor.js";
4
5
  export interface SupervisorRegistry {
@@ -31,11 +32,17 @@ export interface NodeDaemonProcessOptions {
31
32
  stdout?: Writable;
32
33
  stderr?: Writable;
33
34
  platform?: NodeJS.Platform;
35
+ /** Native spawn effect port; the adapter still constructs argv, environment and process options. */
36
+ spawn?: (input: {
37
+ command: string;
38
+ args: string[];
39
+ options: SpawnOptions;
40
+ }, optional?: Record<string, never>) => ChildProcess;
34
41
  }
35
42
  /**
36
43
  * Node launch/tree-stop adapter using platform command quoting, snapshots and signal escalation.
37
44
  * @param required Complete host launch settings and the shared sidecar registry port.
38
- * @param options Optional sinks; output is piped through the parent rather than inherited.
45
+ * @param options Optional native spawn port and sinks; output is piped through the parent rather than inherited.
39
46
  * @returns Supervisor process ports. Construction has no process or filesystem effects.
40
47
  * @complexity Tree stop is O(p) for p process snapshots, plus platform exit polling.
41
48
  */
@@ -1,5 +1,6 @@
1
1
  import { execFileSync, spawn } from "node:child_process";
2
- import { collectProcessTreePids, createCommandInvocation, listProcessSnapshots, stopProcesses } from "@jini-ai/platform";
2
+ import { createCommandInvocation } from "@jini-ai/platform/command";
3
+ import { collectProcessTreePids, listProcessSnapshots, stopProcesses } from "@jini-ai/platform/process";
3
4
  import { readLiveDaemonRegistryRecord, removeDaemonRegistryRecordIfCurrent, writeDaemonRegistryRecord } from "./daemon-registry.js";
4
5
  /**
5
6
  * Reuse the sidecar registry's atomic records, liveness checks and ownership-guarded removal.
@@ -18,7 +19,7 @@ export function createSupervisorRegistry({ registryPath }) {
18
19
  /**
19
20
  * Node launch/tree-stop adapter using platform command quoting, snapshots and signal escalation.
20
21
  * @param required Complete host launch settings and the shared sidecar registry port.
21
- * @param options Optional sinks; output is piped through the parent rather than inherited.
22
+ * @param options Optional native spawn port and sinks; output is piped through the parent rather than inherited.
22
23
  * @returns Supervisor process ports. Construction has no process or filesystem effects.
23
24
  * @complexity Tree stop is O(p) for p process snapshots, plus platform exit polling.
24
25
  */
@@ -30,11 +31,14 @@ export function createNodeDaemonProcessAdapter(required, options = {}) {
30
31
  // launcher hop; windowsHide avoids an otherwise visible detached Windows console.
31
32
  // Pipe output through the parent instead of inheriting its descriptors: an orphan
32
33
  // retaining those descriptors previously kept parent/test teardown waiting forever.
33
- const child = spawn(invocation.command, invocation.args, {
34
+ const spawnOptions = {
34
35
  cwd: required.cwd, env: { ...required.env }, detached: true, windowsHide: true,
35
36
  stdio: ["ignore", "pipe", "pipe"],
36
37
  ...(invocation.windowsVerbatimArguments === undefined ? {} : { windowsVerbatimArguments: invocation.windowsVerbatimArguments }),
37
- });
38
+ };
39
+ const child = options.spawn
40
+ ? options.spawn({ command: invocation.command, args: invocation.args, options: spawnOptions }, {})
41
+ : spawn(invocation.command, invocation.args, spawnOptions);
38
42
  if (options.stdout !== undefined)
39
43
  child.stdout?.pipe(options.stdout);
40
44
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/sidecar",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Sidecar process runtime: JSON-IPC server and client, IPC path validation, namespace/runtime path resolution, port allocation, launch bootstrap, and a local daemon registry.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -61,12 +61,21 @@
61
61
  "access": "public",
62
62
  "registry": "https://registry.npmjs.org"
63
63
  },
64
+ "devDependencies": {
65
+ "@vitest/coverage-v8": "^2.1.9",
66
+ "@jini-ai/core": "0.4.4",
67
+ "@jini-ai/platform": "0.5.5"
68
+ },
64
69
  "dependencies": {
65
- "@jini-ai/core": "0.4.0",
66
- "@jini-ai/platform": "0.5.0"
70
+ "@jini-ai/core": "^0.4.4"
67
71
  },
68
- "devDependencies": {
69
- "@vitest/coverage-v8": "^2.1.9"
72
+ "peerDependencies": {
73
+ "@jini-ai/platform": "^0.5.5"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@jini-ai/platform": {
77
+ "optional": true
78
+ }
70
79
  },
71
80
  "scripts": {
72
81
  "build": "tsc -p tsconfig.json",