Class: Broadcast::Resources::Discovery
- Defined in:
- lib/broadcast/resources/discovery.rb
Overview
Introspection endpoints. Primarily built for AI agents and CLIs that need to discover what a token can do before acting, but equally useful for health checks and for failing fast on a misconfigured deploy.
Instance Method Summary collapse
-
#prime ⇒ Object
Full capability manifest: platform version, token permissions, channel status, the endpoint list the token can reach, rate limit, and usage tips.
-
#skill ⇒ Object
Plain-text agent skill manifest (Markdown with YAML front matter), including the safety rules agents are expected to follow.
-
#status ⇒ Object
Channel sender config, subscriber counts, and per-feature transmission readiness.
-
#whoami ⇒ Object
Identity of the current token: label, type (channel_scoped or admin_cross_channel), per-resource permissions, and the resolved channel.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Broadcast::Resources::Base
Instance Method Details
#prime ⇒ Object
Full capability manifest: platform version, token permissions, channel status, the endpoint list the token can reach, rate limit, and usage tips.
24 25 26 |
# File 'lib/broadcast/resources/discovery.rb', line 24 def prime get('/api/v1/prime') end |
#skill ⇒ Object
Plain-text agent skill manifest (Markdown with YAML front matter), including the safety rules agents are expected to follow. Returns a String, not a Hash — this endpoint serves text/plain.
31 32 33 |
# File 'lib/broadcast/resources/discovery.rb', line 31 def skill @client.request(:get, '/api/v1/skill', nil, raw: true) end |
#status ⇒ Object
Channel sender config, subscriber counts, and per-feature transmission
readiness. Worth calling before a send — readiness.broadcasts == false
means the channel has no usable email server or sender identity.
18 19 20 |
# File 'lib/broadcast/resources/discovery.rb', line 18 def status get('/api/v1/status') end |
#whoami ⇒ Object
Identity of the current token: label, type (channel_scoped or admin_cross_channel), per-resource permissions, and the resolved channel.
11 12 13 |
# File 'lib/broadcast/resources/discovery.rb', line 11 def whoami get('/api/v1/whoami') end |