@agentfield/sdk 0.1.137-rc.2 → 0.1.137-rc.4

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/index.js CHANGED
@@ -201,7 +201,13 @@ function resolveIdleMs(idleSeconds) {
201
201
  function runCli(cmd, options) {
202
202
  return new Promise((resolve3, reject) => {
203
203
  const [bin, ...args] = cmd;
204
- const env = { ...process.env, ...options?.env };
204
+ const parsedParentDepth = Number.parseInt(process.env.AGENTFIELD_HARNESS_DEPTH ?? "", 10);
205
+ const parentDepth = Number.isFinite(parsedParentDepth) && parsedParentDepth >= 0 ? parsedParentDepth : 0;
206
+ const env = {
207
+ ...process.env,
208
+ AGENTFIELD_HARNESS_DEPTH: String(parentDepth + 1),
209
+ ...options?.env
210
+ };
205
211
  applyOpenRouterAttributionEnv(env);
206
212
  const hasInput = options?.inputText !== void 0;
207
213
  const proc = spawn(bin, args, {