(Experimental) This PR adds a first MVP for hooks, with SessionStart and Stop The core design is: - hooks live in a dedicated engine under codex-rs/hooks - each hook type has its own event-specific file - hook execution is synchronous and blocks normal turn progression while running - matching hooks run in parallel, then their results are aggregated into a normalized HookRunSummary On the AppServer side, hooks are exposed as operational metadata rather than transcript-native items: - new live notifications: hook/started, hook/completed - persisted/replayed hook results live on Turn.hookRuns - we intentionally did not add hook-specific ThreadItem variants Hooks messages are not persisted, they remain ephemeral. The context changes they add are (they get appended to the user's prompt)
58 lines
No EOL
1.1 KiB
JSON
58 lines
No EOL
1.1 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"NullableString": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"properties": {
|
|
"cwd": {
|
|
"type": "string"
|
|
},
|
|
"hook_event_name": {
|
|
"const": "Stop",
|
|
"type": "string"
|
|
},
|
|
"last_assistant_message": {
|
|
"$ref": "#/definitions/NullableString"
|
|
},
|
|
"model": {
|
|
"type": "string"
|
|
},
|
|
"permission_mode": {
|
|
"enum": [
|
|
"default",
|
|
"acceptEdits",
|
|
"plan",
|
|
"dontAsk",
|
|
"bypassPermissions"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"session_id": {
|
|
"type": "string"
|
|
},
|
|
"stop_hook_active": {
|
|
"type": "boolean"
|
|
},
|
|
"transcript_path": {
|
|
"$ref": "#/definitions/NullableString"
|
|
}
|
|
},
|
|
"required": [
|
|
"cwd",
|
|
"hook_event_name",
|
|
"last_assistant_message",
|
|
"model",
|
|
"permission_mode",
|
|
"session_id",
|
|
"stop_hook_active",
|
|
"transcript_path"
|
|
],
|
|
"title": "stop.command.input",
|
|
"type": "object"
|
|
} |