plugin_kit_ai_runtime
Généré via pydoc-markdown.
Table of Contents
- plugin_kit_ai_runtime
- JSONMap
- ClaudeHandler
- CodexHandler
- CLAUDE_STABLE_HOOKS
- CLAUDE_EXTENDED_HOOKS
- allow
- continue_
- ClaudeApp
- __init__
- on
- on_stop
- on_pre_tool_use
- on_user_prompt_submit
- run
- CodexApp
- __init__
- on_notify
- run
plugin_kit_ai_runtime
Official Python runtime helpers for plugin-kit-ai executable plugins.
JSONMap
JSON-shaped payload used by the Python runtime helpers.
ClaudeHandler
Handler signature for Claude hooks that return a JSON object or None.
CodexHandler
Handler signature for Codex events that return an exit code or None.
CLAUDE_STABLE_HOOKS
Stable Claude hook names supported by the public Python runtime lane.
CLAUDE_EXTENDED_HOOKS
Extended Claude hook names exposed by the beta Python runtime lane.
allow
def allow() -> JSONMapReturn the empty JSON object expected by Claude for an allow response.
continue_
def continue_() -> intReturn exit code 0 for Codex handlers that want normal continuation.
ClaudeApp Objects
class ClaudeApp()Minimal Claude hook app that dispatches supported hook names to handlers.
__init__
def __init__(allowed_hooks: Iterable[str], usage: str)Create a Claude runtime app.
Arguments:
allowed_hooks- Hook names that this binary accepts on argv.usage- Usage string printed when the invocation is invalid.
on
def on(hook_name: str) -> Callable[[ClaudeHandler], ClaudeHandler]Return a decorator that registers a handler for hook_name.
on_stop
def on_stop(handler: ClaudeHandler) -> ClaudeHandlerRegister a handler for the Stop hook.
on_pre_tool_use
def on_pre_tool_use(handler: ClaudeHandler) -> ClaudeHandlerRegister a handler for the PreToolUse hook.
on_user_prompt_submit
def on_user_prompt_submit(handler: ClaudeHandler) -> ClaudeHandlerRegister a handler for the UserPromptSubmit hook.
run
def run() -> intDispatch the current process invocation and return the exit code.
CodexApp Objects
class CodexApp()Minimal Codex app that dispatches the notify event to a handler.
__init__
def __init__()Create a Codex runtime app with no registered notify handler.
on_notify
def on_notify(handler: CodexHandler) -> CodexHandlerRegister a handler for the Codex notify event.
run
def run() -> intDispatch the current process invocation and return the exit code.