UNPKG

@hashgraphonline/standards-agent-kit

Version:

A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication. https://hol.org

29 lines (28 loc) 873 B
import "@hashgraphonline/standards-sdk"; import fs from "fs"; import path__default from "path"; const ENV_FILE_PATH = path__default.join(process.cwd(), ".env"); async function updateEnvFile(envFilePath, variables) { let envContent = ""; if (fs.existsSync(envFilePath)) { envContent = fs.readFileSync(envFilePath, "utf8"); } const envLines = envContent.split("\n"); const updatedLines = [...envLines]; for (const [key, value] of Object.entries(variables)) { const lineIndex = updatedLines.findIndex( (line) => line.startsWith(`${key}=`) ); if (lineIndex !== -1) { updatedLines[lineIndex] = `${key}=${value}`; } else { updatedLines.push(`${key}=${value}`); } } fs.writeFileSync(envFilePath, updatedLines.join("\n")); } export { ENV_FILE_PATH, updateEnvFile }; //# sourceMappingURL=standards-agent-kit.es47.js.map