ShellApprovalStorage#

Build extensions, choose hooks, and manage request-scoped state. See the guide.

class zett_agent.extensions.shell_approval.ShellApprovalStorage(*args, **kwargs)[source]#

Persistence boundary for session policy and remembered commands.

async get_session_mode(session_id)[source]#

Return the persisted approval policy for one session.

Parameters:

session_id (str)

Return type:

ShellApprovalMode

async set_session_mode(session_id, mode)[source]#

Persist the approval policy for one session.

Parameters:
Return type:

None

async clear_session_mode(session_id)[source]#

Remove the persisted approval policy for one session.

Parameters:

session_id (str)

Return type:

None

async is_allowed(session_id, command)[source]#

Return whether one session permits execution of one exact command.

Parameters:
  • session_id (str)

  • command (str)

Return type:

bool

async allow_command(command)[source]#

Persist one command in the allowlist.

Parameters:

command (str)

Return type:

None