Documentation
¶
Overview ¶
Package images owns handwritten image workflows, saving, previews, and picker state.
Index ¶
- Constants
- func ConfigureCompletion(root *cli.Command)
- func ConfigureSaving(root *cli.Command, opts SavingOptions)
- func ConfigureShellSetup(root *cli.Command, receipt func(context.Context, string) error)
- func ConsumeSavingRequest(command *cli.Command, nested apiquery.NestedQueryFormat, ...) ([]option.RequestOption, bool, error)
- func FirstRunEligible(args []string, getenv func(string) string, inputTTY, outputTTY, errorTTY bool, ...) bool
- func IsImagePickerShellSetupCommand(args []string) bool
- func ObserveMultipart(command *cli.Command, body io.Closer)
- func PrepareMultipartBody(command *cli.Command, body map[string]any) error
- func RegisterModels(root *cli.Command, opts ModelOptions)
- func RegisterPreview(root *cli.Command, opts PreviewOptions)
- func SetupShellOnFirstRun(ctx context.Context, args []string)
- func ShowSavedResponse(ctx context.Context, res []byte) (bool, error)
- func ShowSavedStream[T any](ctx context.Context, source jsonview.Iterator[T], quiet bool) (bool, error)
- type ModelOptions
- type ModelsError
- type PreviewOptions
- type RequestOptions
- type SavingError
- type SavingOptions
Constants ¶
const PreviewDetails = `` /* 359-byte string literal not displayed */
PreviewDetails is shared by preview command and onboarding help.
Variables ¶
This section is empty.
Functions ¶
func ConfigureCompletion ¶
ConfigureCompletion keeps the optional current-session hook on the existing completion command.
func ConfigureSaving ¶
func ConfigureSaving(root *cli.Command, opts SavingOptions)
ConfigureSaving decorates the generated image commands with shared saving behavior. Model discovery and terminal rendering have separate owners.
func ConfigureShellSetup ¶
ConfigureShellSetup keeps completion generation and persistent picker setup on the existing completion command, without changing the generated command definition.
func ConsumeSavingRequest ¶
func ConsumeSavingRequest(command *cli.Command, nested apiquery.NestedQueryFormat, array apiquery.ArrayQueryFormat, body requestconfig.BodyContentType, ignoreStdin bool) ([]option.RequestOption, bool, error)
ConsumeSavingRequest returns one prepared request to its generated handler.
func FirstRunEligible ¶
func FirstRunEligible(args []string, getenv func(string) string, inputTTY, outputTTY, errorTTY bool, shell string) bool
FirstRunEligible checks shell and invocation eligibility without consuming arguments.
func IsImagePickerShellSetupCommand ¶
IsImagePickerShellSetupCommand recognizes explicit local setup in the root's remaining arguments, after global flags have been parsed. Setup validates its own options before changing files. API argument values never qualify.
func ObserveMultipart ¶
ObserveMultipart retains the encoded body for cleanup if dispatch fails early.
func PrepareMultipartBody ¶
PrepareMultipartBody inspects merged scalar settings after trusted file expansion, before the existing multipart encoder takes ownership. Source images and masks remain streamed and are never decoded, buffered, or rewritten here.
func RegisterModels ¶
func RegisterModels(root *cli.Command, opts ModelOptions)
RegisterModels installs image model discovery, a CLI workflow over the existing model retrieval operation. Keep generated /models listing and its script contract untouched.
func RegisterPreview ¶
func RegisterPreview(root *cli.Command, opts PreviewOptions)
RegisterPreview installs local previews and inline preference commands.
func SetupShellOnFirstRun ¶
SetupShellOnFirstRun performs optional setup after assembly admits a background worker.
func ShowSavedResponse ¶
ShowSavedResponse handles a response selected by application routing.
Types ¶
type ModelOptions ¶
type ModelOptions struct {
RequestOptions RequestOptions
DefaultRequestOptions func(*cli.Command) []option.RequestOption
HumanOutput func(*cli.Command) bool
DiagnosticsAllowed func(context.Context) bool
ShowData func(context.Context, *cli.Command, gjson.Result, io.Writer) error
}
ModelOptions connects image model discovery to application request and output policy.
type ModelsError ¶
type ModelsError struct {
// contains filtered or unexported fields
}
ModelsError keeps discovery's local guidance identifiable without retaining API errors or rejected arguments. Only failure categories and the local help invocation contribute to its message.
func (*ModelsError) Error ¶
func (e *ModelsError) Error() string
func (*ModelsError) ReadableMessage ¶ added in v1.40.3
ReadableMessage registers recovery commands only for readable output.
type PreviewOptions ¶
type PreviewOptions struct {
Receipt func(context.Context, string) error
SuggestedReceipt func(context.Context, *cli.Command, string, []string) error
ShowError func(*cli.Command, error, io.Writer) error
}
PreviewOptions connects local previews to receipt and error presentation.
type RequestOptions ¶
type RequestOptions func(*cli.Command, apiquery.NestedQueryFormat, apiquery.ArrayQueryFormat, requestconfig.BodyContentType, bool, ...func([]byte)) ([]option.RequestOption, error)
RequestOptions prepares a generated request using assembly-owned hooks.
type SavingError ¶
type SavingError struct {
// contains filtered or unexported fields
}
A private classification carries locally authored guidance through the shared error presenter. Causes remain available to errors.Is without printing data.
func (*SavingError) Error ¶
func (e *SavingError) Error() string
func (*SavingError) PreserveOnCancel ¶
func (e *SavingError) PreserveOnCancel() bool
PreserveOnCancel retains guidance about files already saved before cancellation.
func (*SavingError) ReadableMessage ¶ added in v1.40.3
ReadableMessage registers only explicitly authored recovery commands.
func (*SavingError) Unwrap ¶
func (e *SavingError) Unwrap() error
type SavingOptions ¶
type SavingOptions struct {
RequestOptions RequestOptions
DiagnosticsAllowed func(context.Context) bool
ErrorFormat func(*cli.Command) string
}
SavingOptions supplies policy while the feature owns preparation and image lifetime.
Source Files
¶
- display_image_progress.go
- display_saved_image.go
- image_generation_settings.go
- image_loading_feedback.go
- image_models.go
- image_picker.go
- image_picker_command.go
- image_picker_completion.go
- image_picker_first_run.go
- image_picker_folder.go
- image_picker_generate.go
- image_picker_inline.go
- image_picker_mouse_shell_other.go
- image_picker_session.go
- image_picker_shell_profile.go
- image_picker_shell_setup.go
- image_picker_state.go
- image_picker_view.go
- image_picker_workspace.go
- image_picker_workspace_images.go
- image_picker_workspace_layout.go
- image_picker_workspace_mouse.go
- image_picker_workspace_native_cache.go
- image_picker_workspace_request.go
- image_picker_workspace_view.go
- image_picker_wrap.go
- image_preferences.go
- image_save_cancellation.go
- image_saving_commands.go
- image_upload_help.go
- interactive_image_preview.go
- interactive_image_preview_input.go
- options.go
- prepare_image_upload.go
- prepare_native_image_output.go
- preview_saved_image.go
- save_final_image_stream.go
- save_generated_images.go