TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shobcoder/shob/llms.txt
Use this file to discover all available pages before exploring further.
Hooks interface is the object your plugin’s server function returns. Each key is optional — include only the hooks you need. Shob merges hooks from all loaded plugins at startup, so multiple plugins can register the same hook type without conflict.
awaits them in sequence before continuing.
Lifecycle hooks
event — handle any Shob server event
event — handle any Shob server event
| Field | Type | Description |
|---|---|---|
event | Event | The emitted event object. The type discriminant identifies which event fired. |
config — modify or validate configuration on load
config — modify or validate configuration on load
input object to override any config value before the server uses it.Signature| Field | Type | Description |
|---|---|---|
input | Config | The fully-merged configuration object. Mutate it in place. |
Chat hooks
chat.message — called after a message is received
chat.message — called after a message is received
| Field | Type | Description |
|---|---|---|
sessionID | string | The session receiving the message. |
agent | string? | The agent handling the message, if known. |
model | { providerID, modelID }? | The provider and model that will respond. |
messageID | string? | The ID of the incoming message. |
variant | string? | Message variant identifier, if applicable. |
| Field | Type | Description |
|---|---|---|
message | UserMessage | The full user message object. |
parts | Part[] | The parsed message parts (text, files, etc.). |
chat.params — modify LLM parameters
chat.params — modify LLM parameters
output fields to override generation parameters such as temperature, topP, or maxOutputTokens.Signature| Field | Type | Description |
|---|---|---|
sessionID | string | The current session ID. |
agent | string | The active agent name. |
model | Model | The model being used. |
provider | ProviderContext | The provider context, including source, info, and options. |
message | UserMessage | The user message triggering this call. |
| Field | Type | Description |
|---|---|---|
temperature | number | Sampling temperature. |
topP | number | Top-P nucleus sampling parameter. |
topK | number | Top-K sampling parameter. |
maxOutputTokens | number | undefined | Maximum tokens to generate. |
options | Record<string, any> | Additional provider-specific options. |
chat.headers — inject headers sent to the LLM API
chat.headers — inject headers sent to the LLM API
| Field | Type | Description |
|---|---|---|
headers | Record<string, string> | Headers object. Set keys to add or override headers. |
Permission hooks
permission.ask — customise permission decisions
permission.ask — customise permission decisions
output.status to auto-allow, auto-deny, or keep the default “ask” behaviour.SignaturePermission)| Field | Type | Description |
|---|---|---|
id | string | Unique permission request ID. |
type | string | The type of action being requested (e.g. "file.write", "shell.run"). |
pattern | string | string[]? | File/command pattern(s) associated with the request. |
sessionID | string | The session that triggered the request. |
messageID | string | The message that triggered the request. |
callID | string? | The tool call ID, if applicable. |
title | string | A human-readable title for the permission request. |
metadata | Record<string, unknown> | Additional context specific to the permission type. |
| Field | Type | Description |
|---|---|---|
status | "ask" | "deny" | "allow" | "allow" auto-approves, "deny" rejects, "ask" shows the normal prompt. |
Environment hooks
shell.env — inject environment variables into shell sessions
shell.env — inject environment variables into shell sessions
output.env to inject additional environment variables into the command’s environment.Signature| Field | Type | Description |
|---|---|---|
cwd | string | The working directory for the shell command. |
sessionID | string? | The session the command is associated with. |
callID | string? | The tool call ID, if the command was triggered by a tool. |
| Field | Type | Description |
|---|---|---|
env | Record<string, string> | Environment variables map. Add keys to inject them. |
Tool hooks
tool.execute.before — modify tool arguments before execution
tool.execute.before — modify tool arguments before execution
output.args to change the arguments the tool receives.Signature| Field | Type | Description |
|---|---|---|
tool | string | The tool identifier being called. |
sessionID | string | The session the call belongs to. |
callID | string | The unique call ID for this invocation. |
| Field | Type | Description |
|---|---|---|
args | any | The arguments object that will be passed to the tool’s execute function. |
tool.execute.after — modify tool output after execution
tool.execute.after — modify tool output after execution
output.output or output.title to transform what the agent sees as the tool’s result.Signature| Field | Type | Description |
|---|---|---|
tool | string | The tool identifier that was called. |
sessionID | string | The session the call belongs to. |
callID | string | The unique call ID for this invocation. |
args | any | The arguments that were passed to the tool. |
| Field | Type | Description |
|---|---|---|
title | string | The display title shown in the chat UI. |
output | string | The tool output string sent back to the LLM. |
metadata | any | Additional metadata attached to the tool result. |
tool.definition — modify tool descriptions/parameters sent to LLM
tool.definition — modify tool descriptions/parameters sent to LLM
output.description or output.parameters to override how a tool is presented to the model — without changing its behaviour.Signature| Field | Type | Description |
|---|---|---|
toolID | string | The identifier of the tool whose definition is being prepared. |
| Field | Type | Description |
|---|---|---|
description | string | The tool description shown to the LLM. |
parameters | any | The JSON Schema parameters object for the tool. |
Command hooks
command.execute.before — intercept command execution
command.execute.before — intercept command execution
output.parts to short-circuit the command and return a custom response.Signature| Field | Type | Description |
|---|---|---|
command | string | The command name (without the leading /). |
sessionID | string | The session the command was sent from. |
arguments | string | The raw argument string following the command name. |
| Field | Type | Description |
|---|---|---|
parts | Part[] | If populated, these parts are used as the command’s result and normal execution is skipped. |
Provider hooks
provider — add or override provider models
provider — add or override provider models
ProviderHook to register additional models for a provider or override existing ones. The models function receives the current provider object and an auth context, and should return a map of model IDs to ModelV2 objects.Type| Field | Type | Description |
|---|---|---|
id | string | The provider ID to target (e.g. "anthropic", "openai"). |
models | function? | Async function that returns a map of additional or replacement model definitions. |
Auth hooks
auth — add authentication methods for providers
auth — add authentication methods for providers
AuthHook to register new authentication flows (API key or OAuth) for a provider. These appear in the Shob TUI’s auth setup flow.Type (abbreviated)| Field | Type | Description |
|---|---|---|
provider | string | The provider ID this auth hook targets. |
loader | function? | Async function that loads stored credentials and returns a context object. |
methods | Array | One or more auth method definitions (type "api" or "oauth"). |
Experimental hooks
experimental.chat.messages.transform — transform the full message list
experimental.chat.messages.transform — transform the full message list
output.messages to add, remove, or reorder messages.Signatureexperimental.chat.system.transform — modify the system prompt
experimental.chat.system.transform — modify the system prompt
output.system to append context, or replace the array entirely to override the default system prompt.Signatureexperimental.session.compacting — customise compaction prompt
experimental.session.compacting — customise compaction prompt
output.context to add extra context, or set output.prompt to replace the default compaction prompt entirely.Signature| Field | Type | Description |
|---|---|---|
context | string[] | Additional context strings appended to the default compaction prompt. |
prompt | string? | If set, replaces the default compaction prompt entirely. |
experimental.compaction.autocontinue — control auto-continue after compaction
experimental.compaction.autocontinue — control auto-continue after compaction
output.enabled = false to skip the automatic continuation.Signature| Field | Type | Description |
|---|---|---|
enabled | boolean | Defaults to true. Set to false to skip the synthetic “continue” turn. |
experimental.text.complete — called when a text part completes
experimental.text.complete — called when a text part completes
output.text to post-process the final text before it is stored.Signature