Module: Textus::Contract
- Defined in:
- lib/textus/contract.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: DSL Classes: Arg, 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
18 19 20 |
# File 'lib/textus/contract.rb', line 18 def self.json_type(type) JSON_TYPES.fetch(type) { raise ArgumentError.new("no JSON type mapping for #{type.inspect}") } end |