langsmith 0.8.11 → 0.9.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 (42) hide show
  1. package/dist/_openapi_client/resources/issues.d.ts +6 -0
  2. package/dist/_openapi_client/resources/online-evaluators.cjs +2 -2
  3. package/dist/_openapi_client/resources/online-evaluators.d.ts +7 -2
  4. package/dist/_openapi_client/resources/online-evaluators.js +2 -2
  5. package/dist/_openapi_client/resources/public/runs.d.ts +1 -1
  6. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +2 -0
  7. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +25 -0
  8. package/dist/_openapi_client/resources/sandboxes/boxes.js +2 -0
  9. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +7 -2
  10. package/dist/_openapi_client/resources/sandboxes/sandboxes.js +1 -1
  11. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +12 -2
  12. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +25 -3
  13. package/dist/_openapi_client/resources/sandboxes/snapshots.js +12 -2
  14. package/dist/_openapi_client/resources/threads.cjs +1 -1
  15. package/dist/_openapi_client/resources/threads.d.ts +26 -1
  16. package/dist/_openapi_client/resources/threads.js +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/run_trees.cjs +19 -2
  21. package/dist/run_trees.d.ts +12 -0
  22. package/dist/run_trees.js +19 -2
  23. package/dist/sandbox/client.cjs +55 -7
  24. package/dist/sandbox/client.d.ts +27 -1
  25. package/dist/sandbox/client.js +55 -7
  26. package/dist/sandbox/errors.cjs +17 -6
  27. package/dist/sandbox/errors.d.ts +12 -5
  28. package/dist/sandbox/errors.js +15 -5
  29. package/dist/sandbox/index.cjs +2 -1
  30. package/dist/sandbox/index.d.ts +2 -2
  31. package/dist/sandbox/index.js +1 -1
  32. package/dist/sandbox/sandbox.cjs +27 -1
  33. package/dist/sandbox/sandbox.d.ts +25 -1
  34. package/dist/sandbox/sandbox.js +28 -2
  35. package/dist/sandbox/types.d.ts +35 -0
  36. package/dist/sandbox/ws_execute.cjs +7 -3
  37. package/dist/sandbox/ws_execute.js +8 -4
  38. package/dist/utils/env.cjs +18 -7
  39. package/dist/utils/env.js +18 -7
  40. package/dist/wrappers/openai_agents.cjs +2 -1
  41. package/dist/wrappers/openai_agents.js +2 -1
  42. package/package.json +1 -1
package/dist/utils/env.js CHANGED
@@ -58,6 +58,22 @@ export function getRuntimeEnvironment() {
58
58
  }
59
59
  return runtimeEnvironment;
60
60
  }
61
+ // Substrings marking a variable as secret-bearing or personal; matched
62
+ // case-insensitively against the variable name.
63
+ const EXCLUDED_SUBSTRINGS = [
64
+ "key",
65
+ "secret",
66
+ "token",
67
+ "password",
68
+ "passwd",
69
+ "pwd",
70
+ "credential",
71
+ "email",
72
+ ];
73
+ function isSensitiveEnvVarName(key) {
74
+ const lowered = key.toLowerCase();
75
+ return EXCLUDED_SUBSTRINGS.some((sub) => lowered.includes(sub));
76
+ }
61
77
  /**
62
78
  * Retrieves the LangSmith-specific metadata from the current runtime environment.
63
79
  *
@@ -83,9 +99,7 @@ export function getLangSmithEnvVarsMetadata() {
83
99
  for (const [key, value] of Object.entries(allEnvVars)) {
84
100
  if (typeof value === "string" &&
85
101
  !excluded.includes(key) &&
86
- !key.toLowerCase().includes("key") &&
87
- !key.toLowerCase().includes("secret") &&
88
- !key.toLowerCase().includes("token")) {
102
+ !isSensitiveEnvVarName(key)) {
89
103
  if (key === "LANGCHAIN_REVISION_ID") {
90
104
  envVars["revision_id"] = value;
91
105
  }
@@ -113,10 +127,7 @@ export function getLangSmithEnvironmentVariables() {
113
127
  for (const [key, value] of Object.entries(process.env)) {
114
128
  if ((key.startsWith("LANGCHAIN_") || key.startsWith("LANGSMITH_")) &&
115
129
  value != null) {
116
- if ((key.toLowerCase().includes("key") ||
117
- key.toLowerCase().includes("secret") ||
118
- key.toLowerCase().includes("token")) &&
119
- typeof value === "string") {
130
+ if (isSensitiveEnvVarName(key) && typeof value === "string") {
120
131
  envVars[key] =
121
132
  value.slice(0, 2) +
122
133
  "*".repeat(value.length - 4) +
@@ -717,6 +717,7 @@ class OpenAIAgentsTracingProcessor {
717
717
  // available at start.
718
718
  if (spanData.type === "generation" ||
719
719
  spanData.type === "response" ||
720
+ spanData.type === "agent" ||
720
721
  spanData.type === "function" ||
721
722
  spanData.type === "handoff") {
722
723
  this._unpostedSpans.add(span.spanId);
@@ -818,7 +819,7 @@ class OpenAIAgentsTracingProcessor {
818
819
  await run.postRun();
819
820
  }
820
821
  else {
821
- await run.patchRun(span.spanData.type === "agent" ? undefined : { excludeInputs: true });
822
+ await run.patchRun({ excludeInputs: true });
822
823
  }
823
824
  }
824
825
  catch (e) {
@@ -714,6 +714,7 @@ export class OpenAIAgentsTracingProcessor {
714
714
  // available at start.
715
715
  if (spanData.type === "generation" ||
716
716
  spanData.type === "response" ||
717
+ spanData.type === "agent" ||
717
718
  spanData.type === "function" ||
718
719
  spanData.type === "handoff") {
719
720
  this._unpostedSpans.add(span.spanId);
@@ -815,7 +816,7 @@ export class OpenAIAgentsTracingProcessor {
815
816
  await run.postRun();
816
817
  }
817
818
  else {
818
- await run.patchRun(span.spanData.type === "agent" ? undefined : { excludeInputs: true });
819
+ await run.patchRun({ excludeInputs: true });
819
820
  }
820
821
  }
821
822
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.8.11",
3
+ "version": "0.9.0",
4
4
  "description": "Client library to connect to the LangSmith Observability and Evaluation Platform.",
5
5
  "packageManager": "pnpm@10.33.0",
6
6
  "files": [