template

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package template defines the programmatic template contract for gitrakz: a saved composition of a form, a transform pipeline, and a display layout — never a saved prompt. The LLM composes these from the building blocks; the engine runs them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldType

type FieldType string

FieldType is the input widget / value kind a form field collects.

const (
	FieldTypeString   FieldType = "string"
	FieldTypeNumber   FieldType = "number"
	FieldTypeBool     FieldType = "bool"
	FieldTypeOffHours FieldType = "offHours" // the not-working windows editor
)

type FormField

type FormField struct {
	Key      string    `json:"key"`
	Label    string    `json:"label"`
	Type     FieldType `json:"type"`
	Required bool      `json:"required"`
	Default  any       `json:"default,omitempty"`
}

FormField is one input a run collects before the transform runs (e.g. the off-hours schedule, an hourly rate, a lead-in padding).

type LayoutBlock

type LayoutBlock struct {
	Type   string          `json:"type"`
	Source string          `json:"source,omitempty"`
	Params json.RawMessage `json:"params,omitempty"`
}

LayoutBlock maps part of the transform output onto a display block: Type is the block type; Source names the State field / Row values feeding it; Params carries per-block rendering config.

type Step

type Step struct {
	Name   string          `json:"name"`
	Params json.RawMessage `json:"params,omitempty"`
}

Step is one entry in the transform pipeline: the primitive's registered name plus its raw JSON parameters (looked up in transform.Registry at run time).

type Template

type Template struct {
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description,omitempty"`
	Form        []FormField   `json:"form"`
	Transform   []Step        `json:"transform"`
	Layout      []LayoutBlock `json:"layout"`
	Exports     []string      `json:"exports"`
	Model       string        `json:"model,omitempty"`
	Builtin     bool          `json:"builtin"`
}

Template is the persisted, user- or LLM-authored composition.

Jump to

Keyboard shortcuts

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