mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 10:46:06 +10:00
Initial commit
moved from private version control
This commit is contained in:
27
scripts/nodes/library/system/info.js
Normal file
27
scripts/nodes/library/system/info.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { createNodeModule } from "../../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Prints cartridge diagnostics to the console.
|
||||
*/
|
||||
export const infoNode = createNodeModule(
|
||||
{
|
||||
id: "system_info",
|
||||
title: "Cartridge Info",
|
||||
category: "System",
|
||||
description:
|
||||
"Print information about the cartridge including size and token counts.",
|
||||
searchTags: ["info", "memory", "stats", "system"],
|
||||
inputs: [{ id: "exec_in", name: "Exec", direction: "input", kind: "exec" }],
|
||||
outputs: [
|
||||
{ id: "exec_out", name: "Exec", direction: "output", kind: "exec" },
|
||||
],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
emitExec: ({ indent, indentLevel, emitNextExec }) => {
|
||||
const lines = [`${indent(indentLevel)}info()`];
|
||||
lines.push(...emitNextExec("exec_out"));
|
||||
return lines;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user