@nifrajs/coding-agent 3.2.0 → 3.5.0

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 (49) hide show
  1. package/dist/context.js +29 -1
  2. package/dist/context.js.map +1 -1
  3. package/dist/diff.js +38 -2
  4. package/dist/diff.js.map +1 -1
  5. package/dist/host.d.ts.map +1 -1
  6. package/dist/host.js +217 -24
  7. package/dist/host.js.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/isolated.js +37 -2
  13. package/dist/isolated.js.map +1 -1
  14. package/dist/native.d.ts +17 -0
  15. package/dist/native.d.ts.map +1 -1
  16. package/dist/native.js +265 -41
  17. package/dist/native.js.map +1 -1
  18. package/dist/replay.d.ts +4 -0
  19. package/dist/replay.d.ts.map +1 -1
  20. package/dist/replay.js +189 -24
  21. package/dist/replay.js.map +1 -1
  22. package/dist/rpc.d.ts +10 -0
  23. package/dist/rpc.d.ts.map +1 -1
  24. package/dist/rpc.js +208 -29
  25. package/dist/rpc.js.map +1 -1
  26. package/dist/sessions.d.ts +14 -2
  27. package/dist/sessions.d.ts.map +1 -1
  28. package/dist/sessions.js +253 -59
  29. package/dist/sessions.js.map +1 -1
  30. package/dist/verification.d.ts +23 -0
  31. package/dist/verification.d.ts.map +1 -1
  32. package/dist/verification.js +113 -1
  33. package/dist/verification.js.map +1 -1
  34. package/dist/workflows.d.ts +1 -0
  35. package/dist/workflows.d.ts.map +1 -1
  36. package/dist/workflows.js +43 -21
  37. package/dist/workflows.js.map +1 -1
  38. package/package.json +6 -5
  39. package/src/context.ts +32 -1
  40. package/src/diff.ts +40 -2
  41. package/src/host.ts +219 -24
  42. package/src/index.ts +5 -0
  43. package/src/isolated.ts +39 -2
  44. package/src/native.ts +408 -42
  45. package/src/replay.ts +206 -25
  46. package/src/rpc.ts +261 -33
  47. package/src/sessions.ts +271 -56
  48. package/src/verification.ts +140 -1
  49. package/src/workflows.ts +37 -25
package/src/isolated.ts CHANGED
@@ -336,9 +336,46 @@ function workerError(message: WorkerMessage): Error {
336
336
 
337
337
  function filteredEnv(): Record<string, string> {
338
338
  const result: Record<string, string> = {}
339
- for (const name of ["PATH", "HOME", "LANG", "LC_ALL", "TERM"]) {
340
- const value = process.env[name]
339
+ const names = [
340
+ "PATH",
341
+ "HOME",
342
+ "LANG",
343
+ "LC_ALL",
344
+ "TERM",
345
+ ...(process.platform === "win32"
346
+ ? [
347
+ "SystemRoot",
348
+ "WINDIR",
349
+ "TEMP",
350
+ "TMP",
351
+ "USERPROFILE",
352
+ "LOCALAPPDATA",
353
+ "APPDATA",
354
+ "COMSPEC",
355
+ "PATHEXT",
356
+ "BUN_INSTALL",
357
+ "HOMEDRIVE",
358
+ "HOMEPATH",
359
+ "USERNAME",
360
+ "USERDOMAIN",
361
+ "ProgramData",
362
+ "ProgramFiles",
363
+ "ProgramFiles(x86)",
364
+ ]
365
+ : []),
366
+ ]
367
+ for (const name of names) {
368
+ const value = readEnv(name)
341
369
  if (value !== undefined) result[name] = value
342
370
  }
343
371
  return result
344
372
  }
373
+
374
+ function readEnv(name: string): string | undefined {
375
+ const exact = process.env[name]
376
+ if (exact !== undefined || process.platform !== "win32") return exact
377
+ const key = Object.keys(process.env).find(
378
+ (candidate) => candidate.toLowerCase() === name.toLowerCase(),
379
+ )
380
+ return key === undefined ? undefined : process.env[key]
381
+ }