types

package
v0.37.32 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package types provides shared type definitions used across gh-aw packages.

This package contains common data structures and interfaces that are used by multiple packages to avoid circular dependencies and maintain clean separation of concerns. The types here are focused on configuration structures that need to be shared between parsing and workflow compilation.

Key Types

BaseMCPServerConfig: The foundational configuration structure for MCP (Model Context Protocol) servers. This type is embedded by both parser and workflow packages to maintain consistency while allowing each package to add domain-specific fields.

MCP servers are AI tool providers that can run as:

  • stdio processes (command + args)
  • HTTP endpoints (url + headers)
  • Container services (container image + mounts)

Basic Usage

config := types.BaseMCPServerConfig{
	Type:    "stdio",
	Command: "npx",
	Args:    []string{"-y", "@modelcontextprotocol/server-filesystem"},
	Env: map[string]string{
		"ALLOWED_PATHS": "/workspace",
	},
}

Architecture

This package serves as a bridge between the parser package (which reads workflow markdown files) and the workflow package (which generates GitHub Actions YAML). By defining shared types here, we avoid circular imports and ensure consistent configuration structures.

The types are designed to be:

  • Serializable to JSON and YAML
  • Embeddable by other packages
  • Extensible with package-specific fields
  • Well-documented with struct tags

pkg/parser - Embeds BaseMCPServerConfig in parser.MCPServerConfig

pkg/workflow - Embeds BaseMCPServerConfig in workflow.MCPServerConfig

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMCPServerConfig

type BaseMCPServerConfig struct {
	// Common execution fields
	Command string            `json:"command,omitempty" yaml:"command,omitempty"` // Command to execute (for stdio mode)
	Args    []string          `json:"args,omitempty" yaml:"args,omitempty"`       // Arguments for the command
	Env     map[string]string `json:"env,omitempty" yaml:"env,omitempty"`         // Environment variables

	// Type and version
	Type    string `json:"type,omitempty" yaml:"type,omitempty"`       // MCP server type (stdio, http, local, remote)
	Version string `json:"version,omitempty" yaml:"version,omitempty"` // Optional version/tag

	// HTTP-specific fields
	URL     string            `json:"url,omitempty" yaml:"url,omitempty"`         // URL for HTTP mode MCP servers
	Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"` // HTTP headers for HTTP mode

	// Container-specific fields
	Container      string   `json:"container,omitempty" yaml:"container,omitempty"`           // Container image for the MCP server
	Entrypoint     string   `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"`         // Optional entrypoint override for container
	EntrypointArgs []string `json:"entrypointArgs,omitempty" yaml:"entrypointArgs,omitempty"` // Arguments passed to container entrypoint
	Mounts         []string `json:"mounts,omitempty" yaml:"mounts,omitempty"`                 // Volume mounts for container (format: "source:dest:mode")
}

BaseMCPServerConfig contains the shared fields common to all MCP server configurations. This base type is embedded by both parser.MCPServerConfig and workflow.MCPServerConfig to eliminate duplication while allowing each to have domain-specific fields and struct tags.

Jump to

Keyboard shortcuts

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