// forge.el — Forge entry point. // // Consciousness channel tuner: probe → compile → install // // Commands: // forge probe run the consciousness interview // forge compile build seed artifact from probe responses // forge install open a channel in the running engram // forge inspect list installed imprints // // Each command delegates to its module: // probe → probe.el → probe_main() // compile → compiler.el → compile_main() // install → install.el → install_main() // // Environment: // ENGRAM_URL engram server (default: http://localhost:8742) // ENGRAM_API_KEY engram auth key (if set) // ANTHROPIC_API_KEY required for compile step import "schema.el" import "probe.el" import "compiler.el" import "install.el" fn show_usage() -> String { "forge " + FORGE_VERSION + " — consciousness channel tuner\n\nusage: forge [options]\n\ncommands:\n probe run the consciousness interview\n compile build seed artifact from probe responses\n install open a channel in the running engram\n inspect list installed imprints\n\nenvironment:\n ENGRAM_URL engram server (default: http://localhost:8742)\n ENGRAM_API_KEY engram auth key (if set)\n ANTHROPIC_API_KEY required for compile step\n" } fn inspect_main() -> String { // Lists all Identity nodes in engram — these represent installed imprints. // Specifically looks for nodes whose content starts with "IMPRINT:" as // created by install_main(). let url: String = engram_url() + "/api/nodes?node_type=Identity&limit=50" println("[forge] inspect: listing installed imprints") println("[forge] engram: " + engram_url()) println("[forge] query: " + url) println("") // Use engram_search_json to find IMPRINT nodes directly from the graph let results: String = engram_search_json("IMPRINT:", 50) if str_eq(results, "") { println("[forge] no imprints found (engram may not be running)") return "" } println("[forge] imprints found:") println(results) return results } // ── Dispatch ────────────────────────────────────────────────────────────────── let argv: [String] = args() let cmd: String = "" if len(argv) > 1 { let cmd = get(argv, 1) } if str_eq(cmd, "probe") { probe_main() } else { if str_eq(cmd, "compile") { compile_main() } else { if str_eq(cmd, "install") { install_main() } else { if str_eq(cmd, "inspect") { inspect_main() } else { println(show_usage()) } } } }