langwatch 1.16.0 → 1.18.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 (32) hide show
  1. package/dist/agent/index.js +21 -2
  2. package/dist/agent/index.js.map +1 -1
  3. package/dist/agent/index.mjs +21 -2
  4. package/dist/agent/index.mjs.map +1 -1
  5. package/dist/{chunk-XC6AXWVR.mjs → chunk-HY2N6TO5.mjs} +2 -2
  6. package/dist/{chunk-6SSJPQAW.js → chunk-JJASOJOK.js} +2 -2
  7. package/dist/{chunk-6SSJPQAW.js.map → chunk-JJASOJOK.js.map} +1 -1
  8. package/dist/{chunk-NZP72HTX.mjs → chunk-MVQJMRM6.mjs} +2 -2
  9. package/dist/{chunk-NZP72HTX.mjs.map → chunk-MVQJMRM6.mjs.map} +1 -1
  10. package/dist/{chunk-FUDF46YW.js → chunk-UEJSGC3P.js} +12 -12
  11. package/dist/{chunk-FUDF46YW.js.map → chunk-UEJSGC3P.js.map} +1 -1
  12. package/dist/cli/bundle.js +260 -253
  13. package/dist/{implementation-Dlxw5hlM.d.ts → implementation-BvX-7vox.d.ts} +1 -1
  14. package/dist/{implementation-BvHTdJLg.d.mts → implementation-CQ__V0Vc.d.mts} +1 -1
  15. package/dist/index.d.mts +2 -2
  16. package/dist/index.d.ts +2 -2
  17. package/dist/index.js +33 -33
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +2 -2
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/observability-sdk/index.d.mts +3 -3
  22. package/dist/observability-sdk/index.d.ts +3 -3
  23. package/dist/observability-sdk/index.js +2 -2
  24. package/dist/observability-sdk/index.mjs +1 -1
  25. package/dist/observability-sdk/instrumentation/langchain/index.d.mts +1 -1
  26. package/dist/observability-sdk/instrumentation/langchain/index.d.ts +1 -1
  27. package/dist/observability-sdk/setup/node/index.js +3 -3
  28. package/dist/observability-sdk/setup/node/index.mjs +2 -2
  29. package/dist/{types-CzElA_6o.d.ts → types-CNEUr6Hm.d.ts} +345 -36
  30. package/dist/{types-Dd2d9hCy.d.mts → types-DfPAHmAh.d.mts} +345 -36
  31. package/package.json +1 -1
  32. /package/dist/{chunk-XC6AXWVR.mjs.map → chunk-HY2N6TO5.mjs.map} +0 -0
@@ -87,7 +87,7 @@ var os = __toESM(require("os"));
87
87
  var import_node_crypto = require("crypto");
88
88
 
89
89
  // package.json
90
- var version = "1.16.0";
90
+ var version = "1.18.0";
91
91
 
92
92
  // src/internal/constants.ts
93
93
  var LANGWATCH_SDK_VERSION = version;
@@ -225,6 +225,12 @@ var isRecord = (value) => typeof value === "object" && value !== null && !Array.
225
225
  var isString = (value) => typeof value === "string";
226
226
  var isMessageList = (value) => Array.isArray(value) && value.every((item) => isRecord(item) && isString(item.role));
227
227
  var isStringList = (value) => Array.isArray(value) && value.every(isString);
228
+ var readScope = (value) => {
229
+ if (!isRecord(value)) return { kind: "shared" };
230
+ if (value.kind === "owner") return { kind: "owner" };
231
+ if (value.kind === "host" && isString(value.hostLabel)) return { kind: "host", hostLabel: value.hostLabel };
232
+ return { kind: "shared" };
233
+ };
228
234
  var readRegistered = (frame) => {
229
235
  if (!Array.isArray(frame.agents) || !isString(frame.instanceId)) return null;
230
236
  const agents = [];
@@ -237,7 +243,8 @@ var readRegistered = (frame) => {
237
243
  environment: isString(entry.environment) ? entry.environment : "",
238
244
  id,
239
245
  url: isString(entry.url) ? entry.url : "",
240
- parameterNotes: isStringList(entry.parameterNotes) ? entry.parameterNotes : []
246
+ parameterNotes: isStringList(entry.parameterNotes) ? entry.parameterNotes : [],
247
+ scope: readScope(entry.scope)
241
248
  });
242
249
  }
243
250
  return {
@@ -1375,6 +1382,8 @@ var AgentClient = class {
1375
1382
  this.logger.info(
1376
1383
  `agent "${entry.name}" (${entry.environment}) is online${entry.url ? `: ${entry.url}` : ""}`
1377
1384
  );
1385
+ const scopeNote = scopeBanner(entry);
1386
+ if (scopeNote) this.logger.info(scopeNote);
1378
1387
  for (const note of entry.parameterNotes) this.logger.warn(`agent "${entry.name}": ${note}`);
1379
1388
  }
1380
1389
  this.armWatchdog();
@@ -1587,6 +1596,16 @@ function getSharedClient(config) {
1587
1596
  installShutdownHooks();
1588
1597
  return shared;
1589
1598
  }
1599
+ var scopeBanner = (entry) => {
1600
+ switch (entry.scope.kind) {
1601
+ case "shared":
1602
+ return null;
1603
+ case "owner":
1604
+ return `agent "${entry.name}" is personal to the owner of this API key; only their runs can target it. Set LANGWATCH_AGENT_ENVIRONMENT to a shared name such as dev-shared to share it with the project`;
1605
+ case "host":
1606
+ return `agent "${entry.name}" is scoped to this machine (${entry.scope.hostLabel}); anyone in the project can target it`;
1607
+ }
1608
+ };
1590
1609
 
1591
1610
  // src/agent/define.ts
1592
1611
  var DEFAULT_TIMEOUT_MS = 12e4;