from slyme.node import node, Auto, sequential, expression
from slyme.context import Context, Ref


@node
def node1(
    ctx: Context,
    /,
    *,
    value: Ref[str],
):
    return ctx.set(value, "hello world!")


@node
def node2(
    ctx: Context,
    /,
    *,
    value: Auto[str] = "i'm here",
):
    print(value)
    return ctx


@expression
def expression(
    ctx: Context,
    /,
    *,
    value: Auto[str],
):
    return value * 3


scope = {
    "value": Ref("hello.value")
}


root = sequential(nodes=[
    node1(scope),
    node2(scope, value=expression(scope)),
])
breakpoint()
root_exec = root.prepare()
breakpoint()
root_exec(Context())
import transformers
