@serverkgg/bridge 0.0.6 → 0.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serverkgg/bridge",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Serverk game bridge — driver runtime, wire protocol, manifest schema, and maintainer CLI",
5
5
  "homepage": "https://serverk.gg",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "scripts": {
27
27
  "tsc": "tsc",
28
- "test": "bun test"
28
+ "test": "bun test --parallel"
29
29
  },
30
30
  "dependencies": {
31
31
  "zod": "4.4.3"
@@ -97,9 +97,10 @@ export const createBridgeExec = (target: BridgeExecTarget) => {
97
97
  throw new BridgeExecError("the exec command is empty");
98
98
  }
99
99
 
100
- const { argv } = await unprivilegedArgv(command, target.uid, target.gid);
100
+ const { argv, credentials } = await unprivilegedArgv(command, target.uid, target.gid);
101
101
 
102
102
  const child = Bun.spawn(argv, {
103
+ ...credentials,
103
104
  cwd: target.cwd,
104
105
  env: {
105
106
  ...baseEnvironment(),
@@ -39,14 +39,16 @@ export const settleUid = async (pid: number, expected: number) => {
39
39
  return observed;
40
40
  };
41
41
 
42
- const spawnWithUid = (command: string[], uid: number, gid: number) => {
43
- const credentials: object = {
42
+ export const spawnCredentials = (uid: number, gid: number): object => {
43
+ return {
44
44
  uid,
45
45
  gid,
46
46
  };
47
+ };
47
48
 
49
+ const spawnWithUid = (command: string[], uid: number, gid: number) => {
48
50
  return Bun.spawn(command, {
49
- ...credentials,
51
+ ...spawnCredentials(uid, gid),
50
52
  stderr: "ignore",
51
53
  stdin: "ignore",
52
54
  stdout: "ignore",
@@ -94,6 +96,6 @@ export const unprivilegedArgv = async (command: string[], uid: number, gid: numb
94
96
 
95
97
  return {
96
98
  argv: native ? command : setprivArgv(command, uid, gid),
97
- native,
99
+ credentials: native ? spawnCredentials(uid, gid) : {},
98
100
  };
99
101
  };
@@ -218,8 +218,9 @@ export const createSupervisor = (options: SupervisorOptions) => {
218
218
  ...rest,
219
219
  ];
220
220
 
221
- const { argv: spawnArgv } = await unprivilegedArgv(argv, options.uid, options.gid);
221
+ const { argv: spawnArgv, credentials } = await unprivilegedArgv(argv, options.uid, options.gid);
222
222
  const spawned = Bun.spawn(spawnArgv, {
223
+ ...credentials,
223
224
  cwd: options.cwd,
224
225
  stderr: "pipe",
225
226
  stdin: "pipe",