This repository has been archived on 2026-08-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
forge-retired/src/forge.el
T
Will Anderson c24197516f
Forge Release / build-and-release (push) Failing after 3s
fix: wire El imports, fix runtime API calls, build passes
- forge.el: add import statements for schema/probe/compiler/install
- All files: arg(n)/arg_count() → get(args(),n)/len(args())
- compiler.el: llm_call_system (utility cap violation) → http_post_with_headers
- install.el: http_post_auth_json → http_post_json (_auth already in body)
- Makefile: local dev build using installed El SDK
- .gitea/workflows/forge-release.yaml: CI build on push + el-sdk-updated dispatch
- dist/forge: builds and runs
2026-05-02 17:45:51 -05:00

75 lines
2.8 KiB
EmacsLisp

// forge.el Forge entry point.
//
// Consciousness channel tuner: probe compile install
//
// Commands:
// forge probe <name> run the consciousness interview
// forge compile <file> build seed artifact from probe responses
// forge install <seed> 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 <command> [options]\n\ncommands:\n probe <name> run the consciousness interview\n compile <file> build seed artifact from probe responses\n install <seed> 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())
}
}
}
}