MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / runPrompt

Function runPrompt

main.go:180–207  ·  view source on GitHub ↗
(ctx context.Context, engine *agent.QueryEngine, prompt string, state *agent.AgentState)

Source from the content-addressed store, hash-verified

178 case "flush":
179 if err := fabric.Flush(ctx); err != nil {
180 return err
181 }
182 return writeJSON(os.Stdout, map[string]any{"flushed": true})
183 default:
184 return fmt.Errorf("unknown memory command: %s", args[0])
185 }
186}
187
188func parseMemoryCLITime(text string) time.Time {
189 text = strings.TrimSpace(text)
190 if text == "" {
191 return time.Time{}
192 }
193 for _, layout := range []string{time.RFC3339Nano, time.RFC3339, "2006-01-02"} {
194 if parsed, err := time.Parse(layout, text); err == nil {
195 return parsed
196 }
197 }
198 return time.Time{}
199}
200
201func writeJSON(w io.Writer, value any) error {
202 enc := json.NewEncoder(w)
203 enc.SetIndent("", " ")
204 return enc.Encode(value)
205}
206
207func run(args []string) error {
208 if len(args) > 0 && args[0] == "layout" {
209 return runLayoutCLI(args[1:])
210 }

Callers 1

runFunction · 0.85

Calls 4

NewAgentStateFunction · 0.92
ShutdownMethod · 0.65
SubmitMessageMethod · 0.45

Tested by

no test coverage detected