sleeptool

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sleeptool implements the Sleep tool — waits for a specified duration.

Mirrors src/tools/SleepTool. Unlike Bash(sleep N), this tool does not hold a shell process and can be called concurrently with other tools.

Index

Constants

View Source
const MaxSleepSeconds = 300

MaxSleepSeconds caps a single sleep call to prevent runaway sessions.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	DurationSeconds float64 `json:"duration_seconds"`
}

Input is the typed view of the JSON input.

type Tool

type Tool struct{}

Tool implements the Sleep tool.

func New

func New() *Tool

New returns a fresh Sleep tool.

func (*Tool) Description

func (*Tool) Description() string

func (*Tool) Execute

func (*Tool) Execute(ctx context.Context, raw json.RawMessage) (tool.Result, error)

Execute sleeps for the requested duration, respecting context cancellation.

func (*Tool) InputSchema

func (*Tool) InputSchema() json.RawMessage

func (*Tool) IsConcurrencySafe

func (*Tool) IsConcurrencySafe(json.RawMessage) bool

func (*Tool) IsReadOnly

func (*Tool) IsReadOnly(json.RawMessage) bool

func (*Tool) Name

func (*Tool) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL