dslparse

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyConfigLine

func ApplyConfigLine(cfg *Config, line string)

ApplyConfigLine parses one @config: directive into cfg.

Types

type Config

type Config struct {
	Silent map[string]bool
	Strict bool
}

Config carries @config: directives collected during parse.

func ParseManifest

func ParseManifest(content string) (map[string]Modifiers, Config)

ParseManifest parses a full .nflow manifest. Returns a map from action name to its modifiers, plus the accumulated @config: state.

type Modifiers

type Modifiers struct {
	// ─── identity ───────────────────────────────────────────────────
	CustomName  string
	Description string
	ReqType     string
	ResType     string
	Method      string
	Path        string

	// ─── transports ─────────────────────────────────────────────────
	Transports []TransportBinding

	// ─── resilience ─────────────────────────────────────────────────
	Timeout          time.Duration
	RetryMax         int
	RetryPredicate   string
	BackoffStrategy  string
	BackoffBase      time.Duration
	BackoffMax       time.Duration
	BreakerFailures  int
	BreakerCooldown  time.Duration
	Priority         string
	ConcurrencyLimit int32
	RateLimit        string
	RateLimitRPS     float64
	RateLimitBurst   int

	// ─── cache / dedup ──────────────────────────────────────────────
	CacheTTL          time.Duration
	CacheKey          string
	Idempotent        bool
	IdempotencyHeader string

	// ─── security ───────────────────────────────────────────────────
	RequiresAuth  bool
	Roles         []string
	Permissions   []string
	Features      []string
	Tags          []string
	Scope         string
	SuccessStatus int
	BudgetMicros  int64
	Audit         bool

	// ─── HITL ───────────────────────────────────────────────────────
	HITLPrompt   string
	HITLOptions  []string
	HITLTriggers []string

	// ─── deprecation ────────────────────────────────────────────────
	Deprecated      bool
	DeprecatedSince string
	DeprecatedUse   string

	// ─── meta ───────────────────────────────────────────────────────
	Debug    bool
	Validate bool

	// ─── transports (extras) ────────────────────────────────────────
	SSEChannel string
	CLIAliases []string
	CLIDesc    string
	A2ADesc    string
	A2AExample []string

	// ─── effects / gates ────────────────────────────────────────────
	Effect   string // read_only | side_effect | high_risk
	Gate     string // condition for approval
	ReadOnly bool

	// ─── domain: LLM ────────────────────────────────────────────────
	Provider string
	Model    string
	Typed    string
	Schema   string
	System   string
	Tools    []string
	MaxTurns int

	// ─── domain: sandbox ────────────────────────────────────────────
	Image  string
	Skills []string

	HookNames []string
}

Modifiers is the full parse output for a single action line in a .nflow manifest. Analyzer consumes every field; the runtime overlay uses a subset.

type ParsedLine

type ParsedLine struct {
	RawName     string
	HeadAtom    string
	IsComposite bool
	Modifiers   Modifiers
}

ParsedLine is the per-line parse result.

func ParseLine

func ParseLine(line string) (ParsedLine, bool)

ParseLine parses a single .nflow line. Returns the raw atom name, the head atom (for composites), whether the line is a pipeline, and the parsed modifiers.

type TransportBinding

type TransportBinding struct {
	Kind       string            `json:"kind"`
	Protocol   string            `json:"protocol,omitempty"`
	Target     string            `json:"target"`
	Method     string            `json:"method,omitempty"`
	Path       string            `json:"path,omitempty"`
	Subject    string            `json:"subject,omitempty"`
	QueueGroup string            `json:"queue_group,omitempty"`
	Aliases    []string          `json:"aliases,omitempty"`
	Interval   time.Duration     `json:"interval,omitempty"`
	Schedule   string            `json:"schedule,omitempty"`
	Stream     bool              `json:"stream,omitempty"`
	Raw        bool              `json:"raw,omitempty"`
	Meta       map[string]string `json:"meta,omitempty"`
}

TransportBinding mirrors the kernel-agnostic shape of a routing entry.

Jump to

Keyboard shortcuts

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