Standard capability types for AI agent tools — the lib.d.ts for Effectors.

Type System

@effectorhq/types provides a standard library of capability types — reusable type definitions for the inputs, outputs, and contexts that AI agent tools commonly work with. 40 types across three roles, grounded in real-world usage from 13,000+ analyzed tools.

Why Types for Agent Capabilities

TypeScript proved that adding types to an untyped ecosystem transforms it. Before TypeScript, JavaScript developers composed modules by convention and prayer. After TypeScript, composition became verifiable.

AI agent capabilities are in the pre-TypeScript era right now:

What we have todayWhat types enable
Chain two tools, pray they workType-check composition before execution
Search tools by keywordDiscover capabilities by interface type
Read the README to understand a toolMachine-readable interface contracts
Manually test every combinationAutomated compatibility verification
"It works on my runtime"Cross-runtime interface portability

With effector types, compatibility is checked statically:

# Tool A: produces ReviewReport
[effector.interface]
output = "ReviewReport"

# Tool B: accepts ReviewReport
[effector.interface]
input = "ReviewReport"

The composition checker knows these connect. It also knows that SecurityReport (a structural subtype of ReviewReport) would work too.

The Three Categories

Input Types (15 types)

What your capability accepts. Every input type defines required and optional fields:

TypeCategoryDescription
StringprimitivePlain text input
FilePathprimitiveA filesystem path
URLprimitiveA URL string
JSONprimitiveJSON data with optional schema
RepositoryRefreferenceA repo reference (owner + repo)
CodeDiffcodeA code diff between two states
CodeSnippetcodeSource code with language metadata
IssueRefreferenceA reference to an issue/ticket
PullRequestRefreferenceA reference to a pull request
CommitRefreferenceA reference to a specific commit
TextDocumentdocumentA text document in any format
DataTabledataTabular data (headers + rows)
ImageRefmediaAn image with metadata
PatchSetcodeA set of code patches
StructuredDatadataStructured data with optional schema

Output Types (14 types)

What your capability produces:

TypeCategoryDescription
MarkdownprimitiveMarkdown-formatted text (most common)
JSONprimitiveJSON data output
StringprimitivePlain text output
ReviewReportanalysisCode review with findings
SecurityReportanalysisSecurity scan report (subtype of ReviewReport)
NotificationcommunicationA notification message
SlackMessagecommunicationSlack-specific notification
DiscordMessagecommunicationDiscord-specific notification
OperationStatusstatusGeneric operation result
TestResultstatusTest run results
DeploymentStatusstatusDeployment status
LintReportanalysisStatic analysis report
SummaryanalysisContent summary
TranslatedTextanalysisTranslated text output

Context Types (13 types)

Runtime environment your capability needs:

TypeCategoryDescription
GitHubCredentialscredentialsGitHub token
GenericAPIKeycredentialsGeneric API key
DockertoolsDocker environment
KubernetestoolsK8s cluster context
AWSCredentialscredentialsAWS credentials
SlackCredentialscredentialsSlack workspace token
RepositoryconfigSource code repository
CodingStandardsconfigStyle guide / linter config
ShellEnvironmenttoolsShell / process environment
UserPreferencesconfigUser preferences
ConversationHistoryagentChat history
PromptContextagentTemplate variable bindings
APICredentialscredentialsOpaque API credentials

Structural Subtyping

Types use structural subtyping (like TypeScript, not like Java). Two types are compatible if their shapes match — no explicit inheritance required.

ReviewReport:    { findings, severity, summary }
SecurityReport:  { vulnerabilities, risk, summary, findings, severity, ... }

→ SecurityReport is a structural subtype of ReviewReport
→ Any Effector expecting ReviewReport will accept SecurityReport

This means the ecosystem is open to extension without coordination. You define a new type that structurally matches an existing one, and it automatically composes with everything that existing type composes with.

Known subtype relations:

  • SecurityReport → subtype of ReviewReport
  • SlackMessage → subtype of Notification
  • DiscordMessage → subtype of Notification

Compatibility Rules

1. Exact match           → precision 1.0
2. Alias resolution      → precision 0.95  (PlainText → String)
3. Subtype relation      → precision 0.9   (SecurityReport → ReviewReport)
4. Wildcard matching     → precision 0.8   (*Report matches ReviewReport)
5. Structural subtyping  → precision varies
6. Otherwise             → incompatible

Fields

Every type defines required and optional fields. For example, PullRequestRef:

  • Required: number
  • Optional: repo, provider, title, headBranch, baseBranch, url

Fields are the structural contract. When two types connect, the type checker verifies field compatibility.

Frequency

Every type includes a frequency score (0.0 to 1.0) derived from analysis of 13,000+ real-world AI tools. This grounds the type catalog in actual usage patterns:

  • Discovery — sort search results by relevance
  • Scaffolding — suggest likely types when creating new capabilities
  • Ecosystem analysis — understand what the community builds

Relationship to Existing Standards

StandardWhat it typesWhat effector-types adds
JSON SchemaParameter shapesSemantic capability types (not just data shapes)
MCP Tool SchemaTool parametersComposition semantics (chains-after, parallel-with)
OpenAPIHTTP endpoint contractsAI-specific types (context, cost, nondeterminism)
WIT (WASM)Code module interfacesAgent capability interfaces (not just function signatures)

Using Types

In effector.toml

[effector.interface]
input = "CodeDiff"
output = "ReviewReport"
context = ["Repository", "GitHubCredentials"]

Checking Types

# Validate types against the catalog
npx @effectorhq/core check-types .

# List all available types
npx @effectorhq/core types

Composition

# Check if two capabilities compose
npx @effectorhq/compose check ./capability-a ./capability-b

Browse the Full Catalog

See every type with its fields, aliases, and relationships in the Type Catalog.