taskname

package
v2.37.10 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 16 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAPIKey        = xerrors.New("no api key provided")
	ErrNoNameGenerated = xerrors.New("no task name generated")
)

Functions

This section is empty.

Types

type TaskName added in v2.29.0

type TaskName struct {
	Name        string `json:"task_name"`
	DisplayName string `json:"display_name"`
}

func Generate

func Generate(ctx context.Context, logger slog.Logger, prompt string) TaskName

Generate creates a task name and display name from a user prompt. It attempts multiple strategies in order of preference:

  1. Use Claude (Anthropic) to generate semantic names from the prompt if an API key is available
  2. Sanitize the prompt directly into a valid task name
  3. Generate a random name as a final fallback

A suffix is always appended to task names to reduce collision risk. This function always succeeds and returns a valid TaskName.

Jump to

Keyboard shortcuts

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