Documentation
¶
Overview ¶
Package executor runs godemode-style "code mode": the agent submits one Go program that drives the memory registry via the injected `gitmem` package, and the whole batch executes locally in a single round trip.
The interpreted program looks like:
package main
import "gitmem"
func main() {
v, err := gitmem.Call("memGet", map[string]interface{}{"key": "user.name"})
if err != nil { gitmem.Return(map[string]interface{}{"error": err.Error()}); return }
gitmem.Return(v)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor interprets code-mode programs against a tool registry.
func (*Executor) Execute ¶
Execute validates, interprets, and runs src, returning its result. The interpreter is created per run so the injected gitmem.Call closes over this request's context and result holder.
TODO(scaffold): pool interpreters (rebinding symbols per run) for lower per-call latency once the surface is stable.
type Result ¶
type Result struct {
Return interface{} `json:"return,omitempty"` // value passed to gitmem.Return
Stdout string `json:"stdout,omitempty"` // captured fmt output
Duration time.Duration `json:"-"`
}
Result is the outcome of one code-mode run.