Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Version is the @coder plugin version. Version = "2.0.0" // DefaultMaxBytes is the default byte limit for file reads. DefaultMaxBytes = 200_000 // DefaultMaxEntries is the default entry limit for tree listings. DefaultMaxEntries = 2_000 )
Variables ¶
This section is empty.
Functions ¶
func GetMetadataJSON ¶
func GetMetadataJSON() string
GetMetadataJSON returns the metadata as a JSON string.
Types ¶
type Engine ¶
type Engine struct {
Out io.Writer // primary output (replaces os.Stdout)
Err io.Writer // error/debug output (replaces os.Stderr)
}
Engine is the core execution engine for @coder commands. It is stdlib-only and writes all output to the provided io.Writer instances.
type FlagDefinition ¶
type FlagDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Default string `json:"default,omitempty"`
Required bool `json:"required,omitempty"`
}
FlagDefinition describes a subcommand flag.
type Metadata ¶
type Metadata struct {
Name string `json:"name"`
Description string `json:"description"`
Usage string `json:"usage"`
Version string `json:"version"`
}
Metadata holds @coder plugin identification.
type PluginSchema ¶
type PluginSchema struct {
Name string `json:"name"`
Description string `json:"description"`
ArgsFormat string `json:"args_format"`
Subcommands []SubcommandDefinition `json:"subcommands"`
}
PluginSchema is the full plugin schema for LLM context.
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter implements io.Writer and calls onOutput per complete line. Partial lines are buffered until a newline arrives or Flush() is called.
func NewStreamWriter ¶
func NewStreamWriter(onOutput func(string)) *StreamWriter
NewStreamWriter creates a StreamWriter that calls onOutput for each line.
func (*StreamWriter) Flush ¶
func (sw *StreamWriter) Flush()
Flush emits any remaining buffered content as a final line.
type SubcommandDefinition ¶
type SubcommandDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Flags []FlagDefinition `json:"flags"`
Examples []string `json:"examples,omitempty"`
}
SubcommandDefinition describes a plugin subcommand.
Click to show internal directories.
Click to hide internal directories.