@agent-device/proxy 0.21.30 → 0.21.31

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/process.mjs +6 -2
  2. package/package.json +3 -3
package/dist/process.mjs CHANGED
@@ -27,6 +27,8 @@ function parseBooleanLiteral(value) {
27
27
  }
28
28
  //#endregion
29
29
  //#region ../host-kit/src/internal/diagnostics.ts
30
+ /** Prefixes each diagnostic event that a `--debug` client without a log file writes to stderr. */
31
+ const DIAGNOSTIC_STDERR_PREFIX = "[agent-device][diag] ";
30
32
  const diagnosticsStorage = new AsyncLocalStorage();
31
33
  function updateDiagnosticsScope(options) {
32
34
  const scope = diagnosticsStorage.getStore();
@@ -69,7 +71,7 @@ function emitDiagnostic(event) {
69
71
  scope.liveWrittenEventCount = scope.events.length;
70
72
  }
71
73
  if (scope.traceLogPath) appendDiagnosticLine(scope, scope.traceLogPath, fileLine);
72
- if (scope.debug && !scope.logPath && !scope.traceLogPath) process.stderr.write(`[agent-device][diag] ${fileLine}`);
74
+ if (scope.debug && !scope.logPath && !scope.traceLogPath) process.stderr.write(`${DIAGNOSTIC_STDERR_PREFIX}${fileLine}`);
73
75
  } catch {}
74
76
  }
75
77
  function flushDiagnosticsToSessionFile(options = {}) {
@@ -133,6 +135,8 @@ function appendDiagnosticLine(scope, logPath, line) {
133
135
  }
134
136
  //#endregion
135
137
  //#region ../host-kit/src/internal/exec-trace.ts
138
+ /** The diagnostic phase of each host process lifecycle event. */
139
+ const EXEC_COMMAND_PHASE = "exec_command";
136
140
  function createExecTraceContext(cmd, timeoutMs, hostEnv) {
137
141
  const envTraceEnabled = parseBooleanLiteral(hostEnv?.AGENT_DEVICE_EXEC_TRACE ?? "") === true;
138
142
  const meta = getDiagnosticsMeta();
@@ -147,7 +151,7 @@ function createExecTraceContext(cmd, timeoutMs, hostEnv) {
147
151
  pid = data.pid ?? pid;
148
152
  emitDiagnostic({
149
153
  level: "debug",
150
- phase: "exec_command",
154
+ phase: EXEC_COMMAND_PHASE,
151
155
  durationMs: performance.now() - started,
152
156
  data: {
153
157
  execId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-device/proxy",
3
- "version": "0.21.30",
3
+ "version": "0.21.31",
4
4
  "type": "module",
5
5
  "description": "Transport-neutral authenticating proxy in front of an agent-device daemon.",
6
6
  "license": "MIT",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "devDependencies": {
28
28
  "@agent-device/host-kit": "0.0.0",
29
- "@agent-device/kernel": "0.0.0",
30
- "@agent-device/contracts": "0.0.0"
29
+ "@agent-device/contracts": "0.0.0",
30
+ "@agent-device/kernel": "0.0.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "tsdown --config tsdown.config.ts"