MCPcopy Create free account
hub / github.com/diillson/chatcli / fireUserPromptSubmitHook

Method fireUserPromptSubmitHook

cli/cli_llm.go:168–180  ·  view source on GitHub ↗

fireUserPromptSubmitHook publishes the UserPromptSubmit event when the hook manager is enabled. Best-effort: hooks run asynchronously and any failure logs internally without blocking the turn.

(ctx context.Context, in string)

Source from the content-addressed store, hash-verified

166// hook manager is enabled. Best-effort: hooks run asynchronously and any
167// failure logs internally without blocking the turn.
168func (cli *ChatCLI) fireUserPromptSubmitHook(ctx context.Context, in string) {
169 if cli.hookManager == nil {
170 return
171 }
172 wd, _ := os.Getwd()
173 cli.hookManager.FireAsync(ctx, hooks.HookEvent{
174 Type: hooks.EventUserPromptSubmit,
175 Timestamp: time.Now(),
176 UserPrompt: in,
177 SessionID: cli.currentSessionName,
178 WorkingDir: wd,
179 })
180}
181
182// compactHistoryIfNeeded runs the proxy-payload pre-flight warning and
183// triggers history compaction when the current chat history exceeds the

Calls 1

FireAsyncMethod · 0.80