20 lines
691 B
JavaScript
20 lines
691 B
JavaScript
'use strict';
|
|
|
|
module.exports = function (RED) {
|
|
function AgentConfigNode(n) {
|
|
RED.nodes.createNode(this, n);
|
|
this.cliPath = n.cliPath || 'agent';
|
|
this.workspaceDir = n.workspaceDir || '/data/agent-workspace';
|
|
this.apiEndpoint = (n.apiEndpoint || 'http://localhost:3000').replace(/\/$/, '');
|
|
this.apiKey = this.credentials.apiKey || '';
|
|
this.autoStart = n.autoStart !== false;
|
|
this.defaultArgs = n.defaultArgs || '';
|
|
this.maxConcurrent = parseInt(n.maxConcurrent) || 3;
|
|
}
|
|
|
|
RED.nodes.registerType('agent-config', AgentConfigNode, {
|
|
credentials: {
|
|
apiKey: { type: 'password' }
|
|
}
|
|
});
|
|
}; |