@voltagent/core 0.1.74 → 0.1.75
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.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +27 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4390,6 +4390,10 @@ declare class VoltOpsClient implements VoltOpsClient$1 {
|
|
|
4390
4390
|
* Check if observability is enabled and configured
|
|
4391
4391
|
*/
|
|
4392
4392
|
isObservabilityEnabled(): boolean;
|
|
4393
|
+
/**
|
|
4394
|
+
* Check if the client has valid API keys
|
|
4395
|
+
*/
|
|
4396
|
+
hasValidKeys(): boolean;
|
|
4393
4397
|
/**
|
|
4394
4398
|
* Check if prompt management is enabled and configured
|
|
4395
4399
|
*/
|
|
@@ -4408,10 +4412,6 @@ declare class VoltOpsClient implements VoltOpsClient$1 {
|
|
|
4408
4412
|
* Priority: Agent VoltOpsClient > Global VoltOpsClient > Fallback instructions
|
|
4409
4413
|
*/
|
|
4410
4414
|
static createPromptHelperWithFallback(agentId: string, agentName: string, fallbackInstructions: string, agentVoltOpsClient?: VoltOpsClient): PromptHelper;
|
|
4411
|
-
/**
|
|
4412
|
-
* Validate API keys and provide helpful error messages
|
|
4413
|
-
*/
|
|
4414
|
-
private validateApiKeys;
|
|
4415
4415
|
/**
|
|
4416
4416
|
* Cleanup resources when client is no longer needed
|
|
4417
4417
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -4390,6 +4390,10 @@ declare class VoltOpsClient implements VoltOpsClient$1 {
|
|
|
4390
4390
|
* Check if observability is enabled and configured
|
|
4391
4391
|
*/
|
|
4392
4392
|
isObservabilityEnabled(): boolean;
|
|
4393
|
+
/**
|
|
4394
|
+
* Check if the client has valid API keys
|
|
4395
|
+
*/
|
|
4396
|
+
hasValidKeys(): boolean;
|
|
4393
4397
|
/**
|
|
4394
4398
|
* Check if prompt management is enabled and configured
|
|
4395
4399
|
*/
|
|
@@ -4408,10 +4412,6 @@ declare class VoltOpsClient implements VoltOpsClient$1 {
|
|
|
4408
4412
|
* Priority: Agent VoltOpsClient > Global VoltOpsClient > Fallback instructions
|
|
4409
4413
|
*/
|
|
4410
4414
|
static createPromptHelperWithFallback(agentId: string, agentName: string, fallbackInstructions: string, agentVoltOpsClient?: VoltOpsClient): PromptHelper;
|
|
4411
|
-
/**
|
|
4412
|
-
* Validate API keys and provide helpful error messages
|
|
4413
|
-
*/
|
|
4414
|
-
private validateApiKeys;
|
|
4415
4415
|
/**
|
|
4416
4416
|
* Cleanup resources when client is no longer needed
|
|
4417
4417
|
*/
|
package/dist/index.js
CHANGED
|
@@ -10647,24 +10647,26 @@ var VoltOpsClient = class {
|
|
|
10647
10647
|
}
|
|
10648
10648
|
};
|
|
10649
10649
|
this.logger = new LoggerProxy({ component: "voltops-client" });
|
|
10650
|
-
this.
|
|
10651
|
-
if (
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10650
|
+
const hasValidKeys = this.options.publicKey && this.options.publicKey.trim() !== "" && this.options.publicKey.startsWith("pk_") && this.options.secretKey && this.options.secretKey.trim() !== "" && this.options.secretKey.startsWith("sk_");
|
|
10651
|
+
if (hasValidKeys) {
|
|
10652
|
+
if (this.options.observability !== false) {
|
|
10653
|
+
try {
|
|
10654
|
+
this.observability = new VoltAgentExporter({
|
|
10655
|
+
baseUrl: this.options.baseUrl,
|
|
10656
|
+
publicKey: this.options.publicKey || "",
|
|
10657
|
+
secretKey: this.options.secretKey || "",
|
|
10658
|
+
fetch: this.options.fetch
|
|
10659
|
+
});
|
|
10660
|
+
} catch (error) {
|
|
10661
|
+
this.logger.error("Failed to initialize observability exporter", { error });
|
|
10662
|
+
}
|
|
10661
10663
|
}
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10664
|
+
if (this.options.prompts !== false) {
|
|
10665
|
+
try {
|
|
10666
|
+
this.prompts = new VoltOpsPromptManagerImpl(this.options);
|
|
10667
|
+
} catch (error) {
|
|
10668
|
+
this.logger.error("Failed to initialize prompt manager", { error });
|
|
10669
|
+
}
|
|
10668
10670
|
}
|
|
10669
10671
|
}
|
|
10670
10672
|
this.logger.debug(
|
|
@@ -10719,6 +10721,12 @@ var VoltOpsClient = class {
|
|
|
10719
10721
|
isObservabilityEnabled() {
|
|
10720
10722
|
return this.observability !== void 0;
|
|
10721
10723
|
}
|
|
10724
|
+
/**
|
|
10725
|
+
* Check if the client has valid API keys
|
|
10726
|
+
*/
|
|
10727
|
+
hasValidKeys() {
|
|
10728
|
+
return !!(this.options.publicKey && this.options.publicKey.trim() !== "" && this.options.publicKey.startsWith("pk_") && this.options.secretKey && this.options.secretKey.trim() !== "" && this.options.secretKey.startsWith("sk_"));
|
|
10729
|
+
}
|
|
10722
10730
|
/**
|
|
10723
10731
|
* Check if prompt management is enabled and configured
|
|
10724
10732
|
*/
|
|
@@ -10796,48 +10804,6 @@ var VoltOpsClient = class {
|
|
|
10796
10804
|
}, "getPrompt")
|
|
10797
10805
|
};
|
|
10798
10806
|
}
|
|
10799
|
-
/**
|
|
10800
|
-
* Validate API keys and provide helpful error messages
|
|
10801
|
-
*/
|
|
10802
|
-
validateApiKeys(options) {
|
|
10803
|
-
const { publicKey, secretKey } = options;
|
|
10804
|
-
if (!publicKey || publicKey.trim() === "") {
|
|
10805
|
-
this.logger.warn(`
|
|
10806
|
-
\u26A0\uFE0F VoltOps Warning: Missing publicKey
|
|
10807
|
-
|
|
10808
|
-
VoltOps features will be disabled. To enable:
|
|
10809
|
-
|
|
10810
|
-
1. Get your API keys: https://console.voltagent.dev/settings/projects
|
|
10811
|
-
2. Add to environment:
|
|
10812
|
-
VOLTOPS_PUBLIC_KEY=pk_your_public_key_here
|
|
10813
|
-
|
|
10814
|
-
3. Initialize VoltOpsClient:
|
|
10815
|
-
const voltOpsClient = new VoltOpsClient({
|
|
10816
|
-
publicKey: process.env.VOLTOPS_PUBLIC_KEY!,
|
|
10817
|
-
secretKey: process.env.VOLTOPS_SECRET_KEY!
|
|
10818
|
-
});
|
|
10819
|
-
`);
|
|
10820
|
-
return;
|
|
10821
|
-
}
|
|
10822
|
-
if (!secretKey || secretKey.trim() === "") {
|
|
10823
|
-
this.logger.warn(`
|
|
10824
|
-
\u26A0\uFE0F VoltOps Warning: Missing secretKey
|
|
10825
|
-
|
|
10826
|
-
VoltOps features will be disabled. To enable:
|
|
10827
|
-
|
|
10828
|
-
1. Get your API keys: https://console.voltagent.dev/settings/projects
|
|
10829
|
-
2. Add to environment:
|
|
10830
|
-
VOLTOPS_SECRET_KEY=sk_your_secret_key_here
|
|
10831
|
-
`);
|
|
10832
|
-
return;
|
|
10833
|
-
}
|
|
10834
|
-
if (!publicKey.startsWith("pk_")) {
|
|
10835
|
-
this.logger.warn("\u26A0\uFE0F VoltOps Warning: publicKey should start with 'pk_'");
|
|
10836
|
-
}
|
|
10837
|
-
if (!secretKey.startsWith("sk_")) {
|
|
10838
|
-
this.logger.warn("\u26A0\uFE0F VoltOps Warning: secretKey should start with 'sk_'");
|
|
10839
|
-
}
|
|
10840
|
-
}
|
|
10841
10807
|
/**
|
|
10842
10808
|
* Cleanup resources when client is no longer needed
|
|
10843
10809
|
*/
|
|
@@ -18004,11 +17970,11 @@ app.post("/setup-observability", async (c) => {
|
|
|
18004
17970
|
let secretKeyUpdated = false;
|
|
18005
17971
|
const updatedLines = lines.map((line) => {
|
|
18006
17972
|
const trimmedLine = line.trim();
|
|
18007
|
-
if (trimmedLine.startsWith("# VOLTAGENT_PUBLIC_KEY=")) {
|
|
17973
|
+
if (trimmedLine.startsWith("VOLTAGENT_PUBLIC_KEY=") || trimmedLine.startsWith("# VOLTAGENT_PUBLIC_KEY=") || trimmedLine.startsWith("#VOLTAGENT_PUBLIC_KEY=")) {
|
|
18008
17974
|
publicKeyUpdated = true;
|
|
18009
17975
|
return `VOLTAGENT_PUBLIC_KEY=${publicKey}`;
|
|
18010
17976
|
}
|
|
18011
|
-
if (trimmedLine.startsWith("# VOLTAGENT_SECRET_KEY=")) {
|
|
17977
|
+
if (trimmedLine.startsWith("VOLTAGENT_SECRET_KEY=") || trimmedLine.startsWith("# VOLTAGENT_SECRET_KEY=") || trimmedLine.startsWith("#VOLTAGENT_SECRET_KEY=")) {
|
|
18012
17978
|
secretKeyUpdated = true;
|
|
18013
17979
|
return `VOLTAGENT_SECRET_KEY=${secretKey}`;
|
|
18014
17980
|
}
|