// runtime/engram.el — El wrapper for the engram graph store
//
// Thin wrappers over the __engram_* seed primitives defined in el_seed.c.
// Each function delegates directly to the corresponding seed — no logic here.
// The seed layer owns all storage, indexing, and graph traversal.
//
// Dependencies: runtime/string.el, runtime/json.el

// --- Node creation ---

fn engram_node(content: String, node_type: String, salience: Float) -> String {
    return __engram_node(content, node_type, salience)
}

fn engram_node_full(content: String, nt: String, sal: Float, imp: Float,
                    source: String, lang: String, ts: Int, tags: String) -> String {
    return __engram_node_full(content, nt, sal, imp, source, lang, ts, tags)
}

// --- Node retrieval ---

fn engram_get_node(id: String) -> String {
    return __engram_get_node(id)
}

fn engram_node_count() -> Int {
    return __engram_node_count()
}

// --- Node lifecycle ---

fn engram_strengthen(id: String) -> Bool {
    return __engram_strengthen(id)
}

fn engram_forget(id: String) -> Bool {
    return __engram_forget(id)
}

// --- Search and scan ---

fn engram_search(query: String, limit: Int) -> String {
    return __engram_search(query, limit)
}

fn engram_scan_nodes(limit: Int, offset: Int) -> String {
    return __engram_scan_nodes(limit, offset)
}

fn engram_scan_nodes_json(limit: Int, offset: Int) -> String {
    return __engram_scan_nodes_json(limit, offset)
}

// --- Graph edges ---

fn engram_connect(from: String, to: String, rel: String, weight: Float) -> Bool {
    return __engram_connect(from, to, rel, weight)
}

fn engram_edge_between(a: String, b: String) -> String {
    return __engram_edge_between(a, b)
}

// --- Graph traversal ---

fn engram_neighbors(id: String) -> String {
    return __engram_neighbors(id)
}

fn engram_neighbors_filtered(id: String, rel: String, min_w: Float) -> String {
    return __engram_neighbors_filtered(id, rel, min_w)
}

fn engram_activate(query: String, depth: Int) -> String {
    return __engram_activate(query, depth)
}

fn engram_activate_json(query: String, limit: Int) -> String {
    return __engram_activate_json(query, limit)
}

// --- Generation ---

fn generate(form: String) -> String {
    return __generate(form)
}
