@ricsam/r5d-worker 0.0.126 → 0.0.127

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/dist/cjs/main.cjs CHANGED
@@ -3014,6 +3014,7 @@ async function executeStreamingCommand(input) {
3014
3014
  let timeout;
3015
3015
  let spawnedProcess;
3016
3016
  let preparationSettled = false;
3017
+ let stagedEnvFiles;
3017
3018
  const settlePreparation = () => {
3018
3019
  if (preparationSettled) return;
3019
3020
  preparationSettled = true;
@@ -3042,7 +3043,13 @@ async function executeStreamingCommand(input) {
3042
3043
  const interactive = input.message.interactive === true;
3043
3044
  const control = input.message.commandClass === "control";
3044
3045
  let argv = input.message.argv;
3045
- let environment = workerChildProcessEnvironment([githubProcessEnv(), input.message.env ?? {}, targetProcessEnv2]);
3046
+ if (control && input.message.envFiles?.length) throw new Error("Control commands cannot receive secret files");
3047
+ stagedEnvFiles = stagePtyEnvFiles(input.message.envFiles);
3048
+ let environment = workerChildProcessEnvironment([
3049
+ githubProcessEnv(),
3050
+ resolvePtyEnvFileReferences(input.message.env ?? {}, stagedEnvFiles),
3051
+ targetProcessEnv2
3052
+ ]);
3046
3053
  if (control) {
3047
3054
  (0, import_control_command_policy.assertControlCommandArgv)(argv);
3048
3055
  if (interactive) throw new Error("Control commands cannot be interactive");
@@ -3177,6 +3184,7 @@ async function executeStreamingCommand(input) {
3177
3184
  if (spawnedProcess) {
3178
3185
  await reapCompletedCredentialBearingProcessGroup(input.message.runId, spawnedProcess);
3179
3186
  }
3187
+ if (stagedEnvFiles) removePtyEnvFiles(stagedEnvFiles.paths);
3180
3188
  await releaseWorkerCommandLaunch(input.resources);
3181
3189
  activeProcesses.delete(input.message.runId);
3182
3190
  cancelledProcessRuns.delete(input.message.runId);
@@ -6051,6 +6059,7 @@ async function startWorker(options, projectRuntime = {
6051
6059
  browserFileUploads: true,
6052
6060
  execStdinV1: true,
6053
6061
  ptyEnvFilesV1: true,
6062
+ execEnvFilesV1: true,
6054
6063
  workspaceRemediationAncestorGuardV1: true,
6055
6064
  workspaceIncidentConfigDeferralV1: true,
6056
6065
  workspaceConfigResetToCanonicalV1: true,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.126",
3
+ "version": "0.0.127",
4
4
  "type": "commonjs"
5
5
  }
package/dist/mjs/main.mjs CHANGED
@@ -3035,6 +3035,7 @@ async function executeStreamingCommand(input) {
3035
3035
  let timeout;
3036
3036
  let spawnedProcess;
3037
3037
  let preparationSettled = false;
3038
+ let stagedEnvFiles;
3038
3039
  const settlePreparation = () => {
3039
3040
  if (preparationSettled) return;
3040
3041
  preparationSettled = true;
@@ -3063,7 +3064,13 @@ async function executeStreamingCommand(input) {
3063
3064
  const interactive = input.message.interactive === true;
3064
3065
  const control = input.message.commandClass === "control";
3065
3066
  let argv = input.message.argv;
3066
- let environment = workerChildProcessEnvironment([githubProcessEnv(), input.message.env ?? {}, targetProcessEnv2]);
3067
+ if (control && input.message.envFiles?.length) throw new Error("Control commands cannot receive secret files");
3068
+ stagedEnvFiles = stagePtyEnvFiles(input.message.envFiles);
3069
+ let environment = workerChildProcessEnvironment([
3070
+ githubProcessEnv(),
3071
+ resolvePtyEnvFileReferences(input.message.env ?? {}, stagedEnvFiles),
3072
+ targetProcessEnv2
3073
+ ]);
3067
3074
  if (control) {
3068
3075
  assertControlCommandArgv(argv);
3069
3076
  if (interactive) throw new Error("Control commands cannot be interactive");
@@ -3198,6 +3205,7 @@ async function executeStreamingCommand(input) {
3198
3205
  if (spawnedProcess) {
3199
3206
  await reapCompletedCredentialBearingProcessGroup(input.message.runId, spawnedProcess);
3200
3207
  }
3208
+ if (stagedEnvFiles) removePtyEnvFiles(stagedEnvFiles.paths);
3201
3209
  await releaseWorkerCommandLaunch(input.resources);
3202
3210
  activeProcesses.delete(input.message.runId);
3203
3211
  cancelledProcessRuns.delete(input.message.runId);
@@ -6072,6 +6080,7 @@ async function startWorker(options, projectRuntime = {
6072
6080
  browserFileUploads: true,
6073
6081
  execStdinV1: true,
6074
6082
  ptyEnvFilesV1: true,
6083
+ execEnvFilesV1: true,
6075
6084
  workspaceRemediationAncestorGuardV1: true,
6076
6085
  workspaceIncidentConfigDeferralV1: true,
6077
6086
  workspaceConfigResetToCanonicalV1: true,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.126",
3
+ "version": "0.0.127",
4
4
  "type": "module"
5
5
  }
@@ -421,6 +421,12 @@ type WorkerServerMessage = WorkerRecoveryServerMessage | {
421
421
  credentialId?: string;
422
422
  cwd?: string;
423
423
  env?: Record<string, string>;
424
+ envFiles?: Array<{
425
+ path: string;
426
+ content: string;
427
+ mode?: number;
428
+ }>;
429
+ accountEnvironmentWorkerId?: string;
424
430
  timeoutMs?: number;
425
431
  interactive?: boolean;
426
432
  workspaceEffect?: "none";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.126",
3
+ "version": "0.0.127",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/main.cjs",
6
6
  "module": "./dist/mjs/main.mjs",
@@ -21,7 +21,7 @@
21
21
  "r5d-worker": "dist/cjs/main.cjs"
22
22
  },
23
23
  "dependencies": {
24
- "@ricsam/r5d-api": "^0.0.126",
24
+ "@ricsam/r5d-api": "^0.0.127",
25
25
  "node-pty": "^1.1.0",
26
26
  "picomatch": "^4.0.3"
27
27
  },