generate

package
v0.331.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator creates, validates, deploys, and runs payloads on the Flipper Zero.

func New

func (*Generator) BadUSB

func (g *Generator) BadUSB(ctx context.Context, description string, targetOS string, keyboardLayout string) (*Result, error)

func (*Generator) Deploy

func (g *Generator) Deploy(ctx context.Context, result *Result, path string) error

func (*Generator) EvilPortal

func (g *Generator) EvilPortal(ctx context.Context, description string) (*Result, error)

func (*Generator) IR

func (g *Generator) IR(ctx context.Context, description string) (*Result, error)

func (*Generator) NFC

func (g *Generator) NFC(ctx context.Context, description string) (*Result, error)

func (*Generator) SetCache added in v0.53.0

func (g *Generator) SetCache(c *semcache.Cache)

SetCache wires a semantic cache into the generator. Pass nil to disable. Subsequent generation calls (EvilPortal, BadUSB, SubGHz, IR, NFC) will check the cache before falling through to the LLM, and write successful non-refusal responses back into it.

func (*Generator) SetCacheBypass added in v0.53.0

func (g *Generator) SetCacheBypass(bypass bool)

SetCacheBypass toggles the "skip-on-read, still-write" mode. Useful for `--no-cache` CLI flags or `/regen` REPL commands: the operator wants a fresh generation but still wants the new bytes cached for future use. Pass false to resume normal cache-read behaviour.

func (*Generator) SetFallback added in v0.20.0

func (g *Generator) SetFallback(p provider.Provider)

SetFallback wires a secondary provider that's consulted when the primary returns text matching a canonical refusal pattern. Pass nil to disable. The fallback is typically a local Ollama instance for engagements where Anthropic policy refuses legitimate offensive payload synthesis.

func (*Generator) SubGHz

func (g *Generator) SubGHz(ctx context.Context, description string) (*Result, error)

type Result

type Result struct {
	Type     string `json:"type"`
	Content  string `json:"content"`
	Path     string `json:"path"`
	Deployed bool   `json:"deployed"`
	Preview  string `json:"preview"`
	// Provider names the LLM that served the request when a
	// refusal-fallback fired. Empty when the primary provider
	// generated the response (the common case).
	Provider string `json:"provider,omitempty"`
}

Result of a generation operation.

Jump to

Keyboard shortcuts

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