INNER CODE UNIT · JavaScript
setBlockOutput
figranium/figranium · src/agent/figranite/index.js:93
const setBlockOutput = (value) => {
lastBlockOutput = value;
runtimeVars['block.output'] = value;
};
const resolveTemplate = (input) => {
if (typeof input !== 'string' || !input.includes('{$')) return input;
return input.replace(/\{\$([\w.]+)\}/g, (_match, name) => {
if (name === 'now') return new Date().toISOString();
const value = runtimeVars[name];
if (value === undefined || value === null) return '';
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
return String(value);
}
try {
return JSON.stringify(value);
} catch {
return String(value);