@opperai/agents 0.1.0 → 0.1.1

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
@@ -1085,6 +1085,20 @@ var ToolExecutionSummarySchema = z.object({
1085
1085
  */
1086
1086
  error: z.string().optional()
1087
1087
  });
1088
+
1089
+ // package.json
1090
+ var package_default = {
1091
+ version: "0.1.1"};
1092
+
1093
+ // src/utils/version.ts
1094
+ var SDK_NAME = "@opperai/agents";
1095
+ var SDK_VERSION = package_default.version;
1096
+ var SDK_PLATFORM = "ts";
1097
+ function getUserAgent() {
1098
+ return `${SDK_NAME}-${SDK_PLATFORM}/${SDK_VERSION}`;
1099
+ }
1100
+
1101
+ // src/opper/client.ts
1088
1102
  var isPlainRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1089
1103
  var isZodSchema = (value) => typeof value === "object" && value !== null && "_def" in value && typeof value.parse === "function";
1090
1104
  var readTokenCount = (usage, key) => {
@@ -1121,7 +1135,8 @@ var OpperClient = class {
1121
1135
  retryConfig;
1122
1136
  constructor(apiKey, options = {}) {
1123
1137
  this.client = new Opper({
1124
- httpBearer: apiKey ?? process.env["OPPER_HTTP_BEARER"] ?? ""
1138
+ httpBearer: apiKey ?? process.env["OPPER_HTTP_BEARER"] ?? "",
1139
+ userAgent: getUserAgent()
1125
1140
  });
1126
1141
  this.logger = options.logger ?? getDefaultLogger();
1127
1142
  this.retryConfig = {