sessions

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sessions declares the hive session operations of the desktop's app-control MCP server.

Index

Constants

This section is empty.

Variables

View Source
var SessionList = ops.Spec[SessionListIn]{
	Name: "session.list", Owner: ops.OwnerDesktop, Effect: ops.EffectRead, Toolset: Toolset,
	Summary: "List hive sessions",
	Guidance: "List hive sessions newest first, with each one's tags and state; slug is the tmux session name an attach targets. " +
		"tags keeps only sessions that carry every tag given, compared case-insensitively, so polling with a tag such as auto finds the sessions waiting for an agent to pick them up. " +
		"state keeps only active, recycled or corrupted sessions. An empty list means no session matched, not that hive is unreachable: a failed read is an error.",
	Fields: ops.Constraints{"state": {Enum: []string{"active", "recycled", "corrupted"}}},
}
View Source
var SessionTagsUpdate = ops.Spec[SessionTagsUpdateIn]{
	Name: "session_tags.update", Owner: ops.OwnerDesktop, Effect: ops.EffectWrite, Toolset: Toolset,
	Summary: "Add and remove a session's tags",
	Guidance: "Add tags to one hive session and then remove tags from it, leaving its other tags in place, and return the session. " +
		"Use one call to swap a tag, for example remove auto and add claimed when an orchestrator picks a session up; two agents that each add a tag both keep theirs. " +
		"Tags compare case-insensitively, keep the first spelling, are at most 40 characters and cannot contain commas. " +
		"This changes the session record only: it starts, stops and attaches nothing.",
	Args: []string{"sessionId"},
}
View Source
var Toolset = ops.Toolset{Name: "sessions", MCPPath: "/mcp"}

Functions

func All

func All() []ops.Op

Types

type SessionListIn

type SessionListIn struct {
	Tags  []string `json:"tags,omitempty"  jsonschema:"Only sessions carrying every one of these tags. Tags compare case-insensitively."`
	State string   `json:"state,omitempty" jsonschema:"Only sessions in this state: active, recycled or corrupted."`
}

type SessionTagsUpdateIn

type SessionTagsUpdateIn struct {
	SessionID string   `json:"sessionId"        jsonschema:"Session id, from session_list."`
	Add       []string `json:"add,omitempty"    jsonschema:"Tags to add. A tag the session already carries is kept as it is."`
	Remove    []string `json:"remove,omitempty" jsonschema:"Tags to remove, after the adds. A tag the session does not carry is ignored."`
}

func (SessionTagsUpdateIn) Validate

func (in SessionTagsUpdateIn) Validate() error

Jump to

Keyboard shortcuts

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