toolargs

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package toolargs parses the arguments of the two read-side internal tools, search_context and retrieve (spec §13.1, §16). Every dialect codec hands over the arguments JSON of its own call shape, and the parsing rules are the same for all of them: fences, braces around the value, double-encoded strings and the alternate field names that models produce.

Index

Constants

View Source
const (
	ScopeSession = "session" // this conversation only (the default)
	ScopeProject = "project" // every conversation of the project
)

Scopes of search_context.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retrieve

type Retrieve struct {
	Ref     string // message ref, for example m00042
	BlockID string // block id, for example b12
	Range   string // optional message range, for example m00340..m00412
}

Retrieve is a normalized retrieve call. Exactly one of Ref and BlockID is set.

func ParseRetrieve

func ParseRetrieve(input []byte) (Retrieve, error)

ParseRetrieve parses the arguments of a retrieve call. Refs may be strings or numbers. Giving both a ref and a block id is an error.

type Search struct {
	Query string
	Limit int    // 0 when the model gave none
	Scope string // ScopeSession or ScopeProject
}

Search is a normalized search_context call.

func ParseSearch

func ParseSearch(input []byte) (Search, error)

ParseSearch parses the arguments of a search_context call.

Jump to

Keyboard shortcuts

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