UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

26 lines 832 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AgentsPersistenceVolatile = void 0; const DonobuAgentType_1 = require("../models/DonobuAgentType"); /** * An agents "persistence" implementation that manages state using an * in-memory map. */ class AgentsPersistenceVolatile { constructor(data = new Map()) { this.data = data; } async set(agent, gptConfigName) { this.data.set(agent, gptConfigName); } async get(agent) { return this.data.get(agent) ?? null; } async getAll() { return new Map(DonobuAgentType_1.DonobuAgent.map((agent) => { return [agent, this.data.get(agent) ?? null]; })); } } exports.AgentsPersistenceVolatile = AgentsPersistenceVolatile; //# sourceMappingURL=AgentsPersistenceVolatile.js.map