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
@@ -44,7 +44,7 @@ import * as os from "os";
44
44
  import { randomUUID } from "crypto";
45
45
 
46
46
  // package.json
47
- var version = "1.16.0";
47
+ var version = "1.18.0";
48
48
 
49
49
  // src/internal/constants.ts
50
50
  var LANGWATCH_SDK_VERSION = version;
@@ -182,6 +182,12 @@ var isRecord = (value) => typeof value === "object" && value !== null && !Array.
182
182
  var isString = (value) => typeof value === "string";
183
183
  var isMessageList = (value) => Array.isArray(value) && value.every((item) => isRecord(item) && isString(item.role));
184
184
  var isStringList = (value) => Array.isArray(value) && value.every(isString);
185
+ var readScope = (value) => {
186
+ if (!isRecord(value)) return { kind: "shared" };
187
+ if (value.kind === "owner") return { kind: "owner" };
188
+ if (value.kind === "host" && isString(value.hostLabel)) return { kind: "host", hostLabel: value.hostLabel };
189
+ return { kind: "shared" };
190
+ };
185
191
  var readRegistered = (frame) => {
186
192
  if (!Array.isArray(frame.agents) || !isString(frame.instanceId)) return null;
187
193
  const agents = [];
@@ -194,7 +200,8 @@ var readRegistered = (frame) => {
194
200
  environment: isString(entry.environment) ? entry.environment : "",
195
201
  id,
196
202
  url: isString(entry.url) ? entry.url : "",
197
- parameterNotes: isStringList(entry.parameterNotes) ? entry.parameterNotes : []
203
+ parameterNotes: isStringList(entry.parameterNotes) ? entry.parameterNotes : [],
204
+ scope: readScope(entry.scope)
198
205
  });
199
206
  }
200
207
  return {
@@ -1332,6 +1339,8 @@ var AgentClient = class {
1332
1339
  this.logger.info(
1333
1340
  `agent "${entry.name}" (${entry.environment}) is online${entry.url ? `: ${entry.url}` : ""}`
1334
1341
  );
1342
+ const scopeNote = scopeBanner(entry);
1343
+ if (scopeNote) this.logger.info(scopeNote);
1335
1344
  for (const note of entry.parameterNotes) this.logger.warn(`agent "${entry.name}": ${note}`);
1336
1345
  }
1337
1346
  this.armWatchdog();
@@ -1544,6 +1553,16 @@ function getSharedClient(config) {
1544
1553
  installShutdownHooks();
1545
1554
  return shared;
1546
1555
  }
1556
+ var scopeBanner = (entry) => {
1557
+ switch (entry.scope.kind) {
1558
+ case "shared":
1559
+ return null;
1560
+ case "owner":
1561
+ 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`;
1562
+ case "host":
1563
+ return `agent "${entry.name}" is scoped to this machine (${entry.scope.hostLabel}); anyone in the project can target it`;
1564
+ }
1565
+ };
1547
1566
 
1548
1567
  // src/agent/define.ts
1549
1568
  var DEFAULT_TIMEOUT_MS = 12e4;