scheduling

package
v0.64.20 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package scheduling implements the 6 MCP scheduling tools that codex uses to schedule, list, update, cancel, pause, and resume tasks. The tools forward every call to a Transport (production: loopback HTTP to the app-gateway; tests: transportFunc stub).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSchedulingTools

func NewSchedulingTools(transport ScheduleTransport) []tools.Tool

NewSchedulingTools returns the 6 nanoclaw-aligned scheduling tools. transport may be nil if only metadata (Name/Description/InputSchema) is needed.

Types

type LoopbackTransport

type LoopbackTransport struct {
	// contains filtered or unexported fields
}

LoopbackTransport implements ScheduleTransport by POSTing to the app-gateway loopback endpoint at http://127.0.0.1:<port>/internal/scheduled-tasks/<action>. All 6 actions are sent as POST (the proxy translates list → GET upstream).

func NewLoopbackTransport

func NewLoopbackTransport(base, token string) *LoopbackTransport

NewLoopbackTransport returns a ScheduleTransport that forwards to the app-gateway loopback. base should be the full prefix including the "/internal/scheduled-tasks" path segment (no trailing slash).

func (*LoopbackTransport) Call

func (t *LoopbackTransport) Call(ctx context.Context, action string, body any) (json.RawMessage, error)

Call POSTs body as JSON to baseURL/<action> with X-Loopback-Token set.

type ScheduleTransport

type ScheduleTransport interface {
	Call(ctx context.Context, action string, body any) (json.RawMessage, error)
}

ScheduleTransport is the abstraction the scheduling tools use to forward calls to the app-gateway loopback. In production it is a LoopbackTransport (HTTP POST to /internal/scheduled-tasks/<action>). In tests it can be any function via transportFunc.

Jump to

Keyboard shortcuts

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