declarationadaptertooling

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package declarationadaptertooling defines the versioned JSON report emitted by explicit declaration-adapter authoring commands. It reports validated semantic data only and does not expose compiler AST, typed IR, or backend hooks.

Index

Constants

View Source
const (
	TestPhaseAdapterCheck = "adapter_check"
	TestPhaseBuild        = "build"
	TestPhaseNativeCheck  = "native_check"

	TestStatusPassed = "passed"
	TestStatusFailed = "failed"
	TestStatusNotRun = "not_run"
)
View Source
const ProtocolVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	Mode                       string `json:"mode"`
	Path                       string `json:"path"`
	Valid                      bool   `json:"valid"`
	DeclarationProtocolVersion int    `json:"declarationProtocolVersion,omitempty"`
	Modules                    int    `json:"modules"`
	Exports                    int    `json:"exports"`
	SupportingRecords          int    `json:"supportingRecords"`
	RuntimePath                string `json:"runtimePath,omitempty"`
	RuntimeProtocolVersion     int    `json:"runtimeProtocolVersion,omitempty"`
	RuntimeBindings            int    `json:"runtimeBindings"`
}

type BuildOptions

type BuildOptions struct {
	CompilerVersion string
	Package         *Package
	Adapters        []Adapter
	Diagnostics     []diagnostic.Diagnostic
}

type Package

type Package struct {
	Name         string `json:"name"`
	Version      string `json:"version"`
	ManifestPath string `json:"manifestPath"`
}

type Report

type Report struct {
	ProtocolVersion int                         `json:"protocolVersion"`
	CompilerVersion string                      `json:"compilerVersion"`
	Package         *Package                    `json:"package,omitempty"`
	Adapters        []Adapter                   `json:"adapters"`
	Diagnostics     []diagnostic.JSONDiagnostic `json:"diagnostics"`
	Summary         Summary                     `json:"summary"`
}

func Build

func Build(options BuildOptions) Report

type Summary

type Summary struct {
	Adapters          int `json:"adapters"`
	ValidAdapters     int `json:"validAdapters"`
	Modules           int `json:"modules"`
	Exports           int `json:"exports"`
	SupportingRecords int `json:"supportingRecords"`
	RuntimeBindings   int `json:"runtimeBindings"`
	Errors            int `json:"errors"`
	Warnings          int `json:"warnings"`
}

type Test

type Test struct {
	Mode       string      `json:"mode"`
	ConfigPath string      `json:"configPath"`
	Command    []string    `json:"command"`
	Passed     bool        `json:"passed"`
	Phases     []TestPhase `json:"phases"`
}

type TestBuildOptions

type TestBuildOptions struct {
	CompilerVersion string
	Package         *Package
	Tests           []Test
	Diagnostics     []diagnostic.Diagnostic
}

type TestPhase

type TestPhase struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

type TestReport

type TestReport struct {
	ProtocolVersion int                         `json:"protocolVersion"`
	CompilerVersion string                      `json:"compilerVersion"`
	Package         *Package                    `json:"package,omitempty"`
	Tests           []Test                      `json:"tests"`
	Diagnostics     []diagnostic.JSONDiagnostic `json:"diagnostics"`
	Summary         TestSummary                 `json:"summary"`
}

TestReport is the versioned machine-readable result of an explicitly invoked adapter conformance run. It contains stable phase states while native tool output remains on the command's diagnostic stream.

func BuildTest

func BuildTest(options TestBuildOptions) TestReport

type TestSummary

type TestSummary struct {
	Tests       int `json:"tests"`
	PassedTests int `json:"passedTests"`
	FailedTests int `json:"failedTests"`
	Errors      int `json:"errors"`
	Warnings    int `json:"warnings"`
}

Jump to

Keyboard shortcuts

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