New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bavard/agent-config

Package Overview
Dependencies
Maintainers
1
Versions
316
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bavard/agent-config - npm Package Compare versions

Comparing version 0.0.79 to 0.0.80

2

dist/agent-config.d.ts

@@ -23,3 +23,3 @@ import { BaseAgentAction } from './actions/agent/base-action';

private graphPoliciesV2;
private activePolicyName?;
activePolicyName?: string;
constructor(projectId: string, uname: string);

@@ -26,0 +26,0 @@ get isDisabled(): boolean;

@@ -252,2 +252,5 @@ "use strict";

}
else if (config.graphPoliciesV2.has(jsonObj.activePolicyName)) {
config.setActivePolicyName(jsonObj.activePolicyName);
}
}

@@ -254,0 +257,0 @@ return config;

{
"name": "@bavard/agent-config",
"version": "0.0.79",
"version": "0.0.80",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -37,3 +37,3 @@ import { BaseAgentAction } from './actions/agent/base-action';

private activePolicyName?: string;
public activePolicyName?: string;

@@ -307,3 +307,5 @@ constructor(projectId: string, uname: string) {

config.setActivePolicyName(jsonObj.activePolicyName);
}
} else if (config.graphPoliciesV2.has(jsonObj.activePolicyName)) {
config.setActivePolicyName(jsonObj.activePolicyName);
}
}

@@ -310,0 +312,0 @@

import { assert } from 'chai';
import { EmailAction } from '../src/actions/agent/email-action';
import { AgentConfig, AgentUtteranceAction, TextOption } from '../src';
import { AgentConfig, AgentUtteranceAction, EPolicyType, TextOption } from '../src';
import { GraphPolicy } from '../src/graph-policy';

@@ -305,2 +305,23 @@ import UtteranceNode from '../src/graph-policy/nodes/utterance-node';

});
it('Default policy type', async () => {
let config = new AgentConfig('test', 'test');
assert.equal(config.getDefaultPolicyType(), EPolicyType.DEFAULT_ACTION);
const policy = await createTestGraph('V1');
const policyV2 = await createTestGraphV2('V2');
config.addGraphPolicy(policy);
config.addGraphPolicyV2(policyV2);
config.setActivePolicyName(policy.policyName);
assert.equal(config.getDefaultPolicyType(), EPolicyType.GRAPH);
config.setActivePolicyName(policyV2.name);
assert.equal(config.getDefaultPolicyType(), EPolicyType.GRAPH_V2);
config = AgentConfig.fromJsonObj(config.toJsonObj());
assert.equal(config.getDefaultPolicyType(), EPolicyType.GRAPH_V2);
});
});

@@ -32,3 +32,2 @@ import { assert } from 'chai';

actions = policy.act(new UserUtteranceAction('', 'text-intent', []));
console.log(actions);
assert.equal(actions.length, 1);

@@ -35,0 +34,0 @@ assert.equal(actions[0].nodeId, 5);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc