kimi-code/packages/transcript
Haozhe 06ebfc821e
fix(agent-core-v2): fold UserPromptSubmit hook output into the prompt message (#4081)
* fix(agent-core-v2): fold UserPromptSubmit hook output into prompt content parts

UserPromptSubmit hook messages now merge into the user prompt message as
meta-marked text content parts (contentType text/xml, source 'user prompt
submit hook') at content position 0 instead of a standalone hook_result
user message, so one prompt always yields exactly one user message and
turn pairing can no longer shift. Structured hook JSON without a message
field (e.g. {"continue":true}) no longer injects anything; plain-text
stdout still falls through. turn.prompt records, TurnStarted prompts,
fold turn openings, and steer content keys all strip hook parts; existing
wires with standalone hook_result messages keep their current behavior.

* feat(agent-core-v2): keep UserPromptSubmit hook parts in turn records and handle them across client surfaces

* feat(agent-core-v2): meta-mark bundled skill parts and replace positional slicing

Bundled skill blocks are now constructed with meta { source: 'skill
activation' }, matching the hook-part convention. Every former
content.slice(skillActivations.length) site — turn prompt text, steer
merge/echo, session and fork titles, transcript fold, TUI replay — now
annotates then filters by meta, so prompt content no longer depends on
block positions and the loop needs no hook-part knowledge. A shared
annotate step keeps legacy wires working: leading unmarked blocks (one
per bundled activation) are marked on read before filtering.

* feat(agent-core-v2): strip hook parts from the public TurnStarted prompt at construction
2026-09-29 17:24:09 +08:00
..
src fix(agent-core-v2): fold UserPromptSubmit hook output into the prompt message (#4081) 2026-09-29 17:24:09 +08:00
test fix(agent-core-v2): fold UserPromptSubmit hook output into the prompt message (#4081) 2026-09-29 17:24:09 +08:00
CHANGELOG.md ci: release packages (#3140) 2026-08-27 19:33:51 +08:00
package.json ci: release packages (#3140) 2026-08-27 19:33:51 +08:00
tsconfig.json feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
tsdown.config.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
vitest.config.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00