Skip to main content

HookInput

Struct HookInput 

Source
pub struct HookInput {
    pub command: String,
    pub cwd: Option<String>,
    pub cwd_declared: bool,
    pub root: Option<String>,
    pub session_id: Option<String>,
    pub permission_mode: Option<String>,
}

Fields§

§command: String§cwd: Option<String>§cwd_declared: bool

True when cwd is an absolute directory the model named in place of the folder the harness reported. That directory is where the command runs and never becomes the project root.

§root: Option<String>

The project root, when the harness supplies one (HP-19) — a *_PROJECT_DIR env var for most, workspace_roots in the payload for cursor. Absent for codex/copilot.

§session_id: Option<String>

The harness’s session/conversation id, when it supplies one (session_id for Claude/Gemini/Qwen/Droid, sessionId for grok, conversation_id for cursor). It comes from the harness’s own envelope, so the agent cannot forge it — which is what makes it usable as the anchor for recognizing the session’s scratchpad (see pathctx::session_scratchpad).

§permission_mode: Option<String>

The harness’s permission mode as its envelope names it (Grok’s permissionMode). Only a target whose gated_policy_for depends on it reads it; the rest leave it None.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.