Module: DatagroutConduit::Onramp

Defined in:
lib/datagrout_conduit/onramp.rb

Overview

Autonomous agent self-registration (onramp) for DataGrout.

The onramp flow lets a machine intelligence register itself with DG without a human in the loop, using only plain HTTP JSON — no MCP client required.

Flow

  1. POST to /onramp with agent identity metadata (no auth).

  2. DG returns a short-lived session_token (5 minutes).

  3. POST to /onramp/complete with Authorization: Bearer <session_token>.

  4. DG issues provisional client_id + client_secret (restricted scopes).

Example

opts = DatagroutConduit::Onramp::OnrampOptions.new(
  gateway: "https://app.datagrout.ai",
  agent_name: "my-research-agent",
  agent_type: "claude-sonnet-4-6"
)
client = DatagroutConduit::Client.bootstrap_onramp(opts: opts, url: nil)

Defined Under Namespace

Classes: OnrampCredentials, OnrampError, OnrampOptions

Class Method Summary collapse

Class Method Details

.register_and_exchange(opts) ⇒ Array(OnrampCredentials, String)

Perform the full onramp handshake and OAuth token exchange.

Parameters:

Returns:



71
72
73
74
75
# File 'lib/datagrout_conduit/onramp.rb', line 71

def self.register_and_exchange(opts)
  creds = register(opts)
  token = exchange_token(creds)
  [creds, token]
end

.register_only(opts) ⇒ OnrampCredentials

Perform the onramp handshake and return provisional OAuth credentials.

Low-level entry point. Most callers should use Client.bootstrap_onramp instead.

Parameters:

Returns:



63
64
65
# File 'lib/datagrout_conduit/onramp.rb', line 63

def self.register_only(opts)
  register(opts)
end