cmd

package
v1.16.16 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

File: cmd/agent.go

File: cmd/capabilities.go

File: cmd/editor.go

File: cmd/model.go

File: cmd/plugin.go

File: cmd/root.go

File: cmd/search.go

File: cmd/skill.go

File: cmd/update.go Implements the `gllm update` subcommand and a background update-check goroutine.

File: cmd/root.go (add this function)

File: cmd/version.go

Index

Constants

View Source
const (
	EmbeddingToolsDescription = `` /* 499-byte string literal not displayed */

)
View Source
const (
	MaxRecursionsDescription = `` /* 356-byte string literal not displayed */

)

Variables

View Source
var KnownPlugins = []struct {
	ID    string
	Label string
	Desc  string
}{
	{
		ID:    service.PluginVSCodeCompanion,
		Label: service.PluginVSCodeCompanionTitle,
		Desc:  service.PluginVSCodeCompanionDesc,
	},
}

KnownPlugins enumerates all available global plugins.

Functions

func BatchAttachments added in v1.13.10

func BatchAttachments(attachments []string) (files []*service.FileData)

BatchAttachments processes multiple attachments concurrently and adds the resulting FileData objects to the provided files slice. It uses a WaitGroup to manage goroutines and a channel to collect results safely.

func CheckModelName added in v1.13.2

func CheckModelName(name string) error

func EnsureActiveAgent added in v1.13.10

func EnsureActiveAgent() (*data.AgentConfig, error)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GenerateSessionName added in v1.14.24

func GenerateSessionName() string

func GetAllTools added in v1.15.6

func GetAllTools(agent *data.AgentConfig) string

func GetContextSession added in v1.16.16

func GetContextSession(cmd *cobra.Command) string

GetContextSession returns the session name from the context

func GetEffectModel added in v1.13.2

func GetEffectModel() (model *data.Model)

func GetEffectSearchEngineName added in v1.9.8

func GetEffectSearchEngineName() string

func IsDefaultSessionName added in v1.16.16

func IsDefaultSessionName(name string) bool

IsDefaultSessionName returns true when the session name is the auto-generated timestamp form produced by GenerateSessionName() in repl.go: "session-YYYY-MM-DD_HH-MM-SS".

func IsSearchEnabled added in v1.9.8

func IsSearchEnabled() bool

func ListAllTools added in v1.9.12

func ListAllTools(cmd *cobra.Command)

func NewContextWithSession added in v1.16.16

func NewContextWithSession(sessionName string) context.Context

NewContextWithSession returns a new context with the session name set

func ProcessAttachment added in v1.13.10

func ProcessAttachment(path string) *service.FileData

Processes a single attachment (file or stdin marker)

func RemoveFirst

func RemoveFirst(s string, prefix string) string

func RunAgent added in v1.13.10

func RunAgent(prompt string, guideline string, files []*service.FileData, sessionName string, outputFile string, inputState *data.SharedState) error

RunAgent executes the agent with the given parameters, handling all setup and compatibility checks.

func RunInitWizard added in v1.12.16

func RunInitWizard(cmd *cobra.Command) error

RunInitWizard runs the interactive setup Exported so it can be called from root.go

func StartBackgroundUpdateCheck added in v1.14.24

func StartBackgroundUpdateCheck()

StartBackgroundUpdateCheck launches a single goroutine that checks for updates if 24 hours have elapsed since the last check. The result is stored in pendingUpdateVersion for non-intrusive display.

func StartLoadMCPServer added in v1.15.4

func StartLoadMCPServer(agent *data.AgentConfig)

StartLoadMCPServer launches background MCP preloading (non-blocking).

func StartsWith

func StartsWith(s string, prefix string) bool

func UpdateVersion added in v1.16.10

func UpdateVersion(latestVersion string)

updateVersion returns a non-intrusive update notification.

func UpdateWarn added in v1.16.10

func UpdateWarn(warn string)

UpdateWarnBanner sends a warning banner to the UI The chatinput must be there to receive the banner message Otherwise the banner will be lost Use for background goroutine warning

func ValidateMaxRecursions added in v1.13.2

func ValidateMaxRecursions(s string) error

func ValidateSeed added in v1.13.2

func ValidateSeed(s string) error

func ValidateTemperature added in v1.13.2

func ValidateTemperature(s string) error

Temperature: Typically in the range [0, 2] (inclusive).

  • 0 : Deterministic output (greedy decoding; always picks the highest- probability token).
  • 1 : Balanced output (default).
  • 2 : Highly random/diverse output.

func ValidateTopP added in v1.13.2

func ValidateTopP(s string) error

Top_p (nucleus sampling): In the range [0, 1] (inclusive).

  • 0 : Effectively selects only the single highest-probability token (similar to greedy; very rare in practice, as cumulative prob mass never reaches exactly 0).
  • 1 : No filtering—samples from the full probability distribution (equivalent to no top_p effect).

Types

type ChatRequest added in v1.16.16

type ChatRequest struct {
	Messages []Message `json:"messages"`
	Model    string    `json:"model,omitempty"`
	Stream   bool      `json:"stream,omitempty"`
	Session  string    `json:"session,omitempty"` // custom parameter for GLLM specific sessions
}

Minimal OpenAI-like request struct

type InteractRequest added in v1.16.16

type InteractRequest struct {
	ID        string `json:"id"`                  // UUID matching the SSE interaction request event
	Kind      string `json:"kind"`                // "tool_confirm" | "ask_user"
	Approve   string `json:"approve,omitempty"`   // For tool_confirm ("once", "always", "cancel")
	Answer    string `json:"answer,omitempty"`    // For ask_user
	Cancelled bool   `json:"cancelled,omitempty"` // For ask_user: user dismissed the dialog
}

InteractRequest is the body of POST /v1/interact used by the frontend to resolve a pending interaction (tool confirm, ask-user, etc.).

type Message added in v1.2.0

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ReplInfo added in v1.14.24

type ReplInfo struct {
	Files       []*service.FileData
	QuitFlag    bool     // for cmd /quit or /exit
	EditorInput string   // for /e editor edit
	Guideline   string   // for underlying guideline (e.g. skill activation)
	History     []string // for input history
	// contains filtered or unexported fields
}

type TextBuilder added in v1.13.6

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

func (*TextBuilder) String added in v1.13.6

func (tb *TextBuilder) String() string

Jump to

Keyboard shortcuts

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