Files
ai-memory/hooks/kimi-code/user-prompt-submit.ps1
Lucas Oliveira 6f9c894020 hooks(kimi): briefing once per session in the script path + docs
Mirror the native gate in hooks/kimi-code/user-prompt-submit.sh/.ps1:
the first user prompt of a session fetches /handoff with the [briefing]
params, later prompts fetch it without (handoff fetch itself stays —
cheap and self-limiting). _lib.sh gains ai_memory_parse_toml_flag (bare
or quoted values, parity with hook_capture.rs), ai_memory_briefing_qs
and ai_memory_briefed_file without touching ai_memory_marker_qs (other
agents unchanged); the PowerShell lib gains the equivalents behind a
-BriefingOncePerSession switch. State: <data dir>/briefed/<safe-key>
marked only after the GET completes, success or error (fail-open).

docs/marker-file.md and CHANGELOG note that for Kimi Code the brief is
delivered on the first prompt of the session (kimi discards
SessionStart hook stdout) and that re-briefing after /clear is not
supported in v1.
2026-07-22 21:03:45 -03:00

10 lines
558 B
PowerShell

# Kimi Code injects UserPromptSubmit hook stdout as a user message
# (origin hook_result) before the turn, so the pending handoff is
# fetched here. Empty stdout injects nothing. The compiled project
# brief ([briefing] inject_on_session_start) rides the FIRST prompt of
# the session only — kimi discards SessionStart hook stdout, so this
# is the once-per-session parity with Claude's SessionStart brief.
. "$PSScriptRoot\..\lib\ai-memory-hook.ps1"
Invoke-AiMemoryHook -Event "user-prompt" -Agent "kimi-code" -FetchHandoff -BriefingOncePerSession
exit 0