@agent-vm/secret-management 0.0.98 → 0.0.101

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -209,11 +209,12 @@ function readErrorKilled(error) {
209
209
  function hasEnvironmentPrefix(env, prefix) {
210
210
  return Object.keys(env).some((envName) => envName.startsWith(prefix));
211
211
  }
212
- function formatOpCliAuthContext(env) {
212
+ function formatOpCliAuthContext(env, args) {
213
213
  if (env === void 0) return ["opEnvIsolation=disabled", "opAuth=ambient-process"];
214
214
  return [
215
215
  "opEnvIsolation=enabled",
216
216
  `opAuth=${env.OP_SERVICE_ACCOUNT_TOKEN === void 0 ? "missing" : "service-account-token"}`,
217
+ `opSubcommand=${args[0] ?? "unknown"}`,
217
218
  `opConfig=${env.OP_CONFIG_DIR === void 0 ? "default" : "isolated"}`,
218
219
  `opBiometricUnlock=${env.OP_BIOMETRIC_UNLOCK_ENABLED ?? "unset"}`,
219
220
  `opCache=${env.OP_CACHE ?? "unset"}`,
@@ -229,20 +230,25 @@ function formatRedactedExecErrorDetail(options) {
229
230
  const details = [
230
231
  signal === void 0 ? `exit code ${exitCode}` : `exit code ${exitCode}, signal ${signal}`,
231
232
  `elapsedMs=${String(options.elapsedMs)}`,
232
- "output=redacted"
233
+ "output=redacted",
234
+ `stdoutBytes=${String(Buffer.byteLength(options.stdout, "utf8"))}`,
235
+ `stderrBytes=${String(Buffer.byteLength(options.stderr, "utf8"))}`
233
236
  ];
234
237
  const killed = readErrorKilled(error);
235
238
  if (killed !== void 0) details.push(`killed=${String(killed)}`);
236
- if (options.command === "op") details.push(...formatOpCliAuthContext(options.env));
239
+ if (options.command === "op") details.push(...formatOpCliAuthContext(options.env, options.args));
237
240
  return details.join("; ");
238
241
  }
239
242
  function createExecFileError(options) {
240
243
  if (options.redactErrorOutput) {
241
244
  const safeDetail = formatRedactedExecErrorDetail({
245
+ args: options.args,
242
246
  command: options.command,
243
247
  elapsedMs: options.elapsedMs,
244
248
  ...options.env ? { env: options.env } : {},
245
- error: options.error
249
+ error: options.error,
250
+ stderr: options.stderr,
251
+ stdout: options.stdout
246
252
  });
247
253
  return new RedactedExecFileError(`${options.command} failed: ${safeDetail}`, safeDetail);
248
254
  }
@@ -280,12 +286,14 @@ function execFileAsync(command, args, options) {
280
286
  }, (error, stdout, stderr) => {
281
287
  if (error) {
282
288
  rejectOnce(createExecFileError({
289
+ args,
283
290
  command,
284
291
  elapsedMs: Date.now() - startedAtMs,
285
292
  env: options?.env,
286
293
  error,
287
294
  redactErrorOutput: options?.redactErrorOutput,
288
- stderr
295
+ stderr,
296
+ stdout
289
297
  }));
290
298
  return;
291
299
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-vm/secret-management",
3
- "version": "0.0.98",
3
+ "version": "0.0.101",
4
4
  "description": "Shared secret reference contracts and resolvers for agent-vm packages.",
5
5
  "homepage": "https://github.com/ShravanSunder/agent-vm#readme",
6
6
  "bugs": {