@owney/sdk 0.7.21-beta.1 → 0.7.21-beta.2
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.cjs +7 -3
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4996,10 +4996,12 @@ var OwneySDK = class {
|
|
|
4996
4996
|
await this.applyOrgPolicyTo(agent, state, chainId);
|
|
4997
4997
|
activatedAgentIds.push(agent.id);
|
|
4998
4998
|
} catch (error) {
|
|
4999
|
+
const message = error !== null && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : typeof error === "string" ? error : "No activation error message was returned.";
|
|
4999
5000
|
failedAgents.push({
|
|
5000
5001
|
agentId: agent.id,
|
|
5001
5002
|
code: error instanceof OwneyError ? error.code : void 0,
|
|
5002
|
-
message
|
|
5003
|
+
message,
|
|
5004
|
+
...error instanceof OwneyError && error.details ? { details: error.details } : {}
|
|
5003
5005
|
});
|
|
5004
5006
|
if (firstError === null) {
|
|
5005
5007
|
firstError = error;
|
|
@@ -5012,10 +5014,12 @@ var OwneySDK = class {
|
|
|
5012
5014
|
if (activatedAgentIds.length === 0) throw firstError;
|
|
5013
5015
|
const failedAgentIds = failedAgents.map(({ agentId }) => agentId);
|
|
5014
5016
|
const activeNames = activatedAgentIds.map(this.formatAgentName).join(", ");
|
|
5015
|
-
const
|
|
5017
|
+
const failureMessages = failedAgents.map(
|
|
5018
|
+
({ agentId, message }) => `${this.formatAgentName(agentId)} activation failed: ${message}`
|
|
5019
|
+
).join(" ");
|
|
5016
5020
|
throw new OwneyError(
|
|
5017
5021
|
"AGENT_ACTIVATION_PARTIAL_FAILURE",
|
|
5018
|
-
`${activeNames} activated
|
|
5022
|
+
`${activeNames} activated. ${failureMessages}`,
|
|
5019
5023
|
{ activatedAgentIds, failedAgentIds, failures: failedAgents }
|
|
5020
5024
|
);
|
|
5021
5025
|
}
|
package/dist/index.js
CHANGED
|
@@ -4979,10 +4979,12 @@ var OwneySDK = class {
|
|
|
4979
4979
|
await this.applyOrgPolicyTo(agent, state, chainId);
|
|
4980
4980
|
activatedAgentIds.push(agent.id);
|
|
4981
4981
|
} catch (error) {
|
|
4982
|
+
const message = error !== null && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : typeof error === "string" ? error : "No activation error message was returned.";
|
|
4982
4983
|
failedAgents.push({
|
|
4983
4984
|
agentId: agent.id,
|
|
4984
4985
|
code: error instanceof OwneyError ? error.code : void 0,
|
|
4985
|
-
message
|
|
4986
|
+
message,
|
|
4987
|
+
...error instanceof OwneyError && error.details ? { details: error.details } : {}
|
|
4986
4988
|
});
|
|
4987
4989
|
if (firstError === null) {
|
|
4988
4990
|
firstError = error;
|
|
@@ -4995,10 +4997,12 @@ var OwneySDK = class {
|
|
|
4995
4997
|
if (activatedAgentIds.length === 0) throw firstError;
|
|
4996
4998
|
const failedAgentIds = failedAgents.map(({ agentId }) => agentId);
|
|
4997
4999
|
const activeNames = activatedAgentIds.map(this.formatAgentName).join(", ");
|
|
4998
|
-
const
|
|
5000
|
+
const failureMessages = failedAgents.map(
|
|
5001
|
+
({ agentId, message }) => `${this.formatAgentName(agentId)} activation failed: ${message}`
|
|
5002
|
+
).join(" ");
|
|
4999
5003
|
throw new OwneyError(
|
|
5000
5004
|
"AGENT_ACTIVATION_PARTIAL_FAILURE",
|
|
5001
|
-
`${activeNames} activated
|
|
5005
|
+
`${activeNames} activated. ${failureMessages}`,
|
|
5002
5006
|
{ activatedAgentIds, failedAgentIds, failures: failedAgents }
|
|
5003
5007
|
);
|
|
5004
5008
|
}
|