@2501-ai/cli
Version:
[](https://www.npmjs.com/package/@2501-ai/cli) [](https://www.2501.ai/research/full-humaneval-benchmark) [); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.agentsCommand = void 0;
const terminal_kit_1 = require("terminal-kit");
const conf_1 = require("../utils/conf");
const workspace_1 = require("../helpers/workspace");
function agentsCommand(options) {
return __awaiter(this, void 0, void 0, function* () {
const workspaceUrl = (0, workspace_1.resolveWorkspacePath)({ workspace: options.workspace });
if (options.flush) {
yield (0, conf_1.flushAgents)(workspaceUrl, options.all);
(0, terminal_kit_1.terminal)('All agents have been flushed from the configuration.\n');
return;
}
let agents;
if (options.all) {
agents = (0, conf_1.listAgents)();
}
else {
agents = (0, conf_1.listAgentsFromWorkspace)(workspaceUrl);
}
if (agents.length > 0) {
terminal_kit_1.terminal.table([
['Name', 'ID', 'Configuration', 'Workspace'],
...agents.map((agent) => [
agent.name.substring(0, 10),
agent.id,
agent.configuration,
agent.workspace,
]),
], {
hasBorder: true,
contentHasMarkup: true,
borderChars: 'lightRounded',
borderAttr: { color: 'blue' },
textAttr: { bgColor: 'default' },
firstRowTextAttr: { bgColor: 'blue' },
width: 80,
fit: true,
});
}
else {
(0, terminal_kit_1.terminal)('No agents found.\n');
}
});
}
exports.agentsCommand = agentsCommand;