Module: Textus::Contract

Defined in:
lib/textus/contract.rb,
lib/textus/contract/view.rb,
lib/textus/contract/around.rb,
lib/textus/contract/binder.rb,
lib/textus/contract/sources.rb,
lib/textus/contract/resources/cursor.rb,
lib/textus/contract/resources/build_lock.rb

Overview

Declarative, co-located interface contract for a verb. One source of truth for the agent-facing summary, the argument schema, which transports expose the verb, and how the return value is shaped for the wire. CLI/Ruby/MCP and boot project from this; the MCP catalog is fully derived from it (ADR 0039).

Defined Under Namespace

Modules: Around, Binder, DSL, Resources, Sources, View Classes: Arg, MissingArgs, Spec

Constant Summary collapse

JSON_TYPES =
{
  String => "string", Integer => "integer", Hash => "object",
  Array => "array", :boolean => "boolean"
}.freeze

Class Method Summary collapse

Class Method Details

.json_type(type) ⇒ Object



32
33
34
# File 'lib/textus/contract.rb', line 32

def self.json_type(type)
  JSON_TYPES.fetch(type) { raise ArgumentError.new("no JSON type mapping for #{type.inspect}") }
end