Class: RosettAi::Mcp::Resources::ProvenanceResource
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Resources::ProvenanceResource
- Defined in:
- lib/rosett_ai/mcp/resources/provenance_resource.rb
Overview
MCP resource provider for AI provenance log.
Exposes the full provenance log as an MCP resource.
Constant Summary collapse
- URI_PREFIX =
'rosett-ai://provenance/'- PROVENANCE_FILE =
'.ai-provenance.yml'
Instance Method Summary collapse
-
#list ⇒ Array<Hash>
Lists available provenance resources.
-
#read(_name = 'log') ⇒ Hash?
Reads the provenance log.
Instance Method Details
#list ⇒ Array<Hash>
Lists available provenance resources.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rosett_ai/mcp/resources/provenance_resource.rb', line 22 def list path = RosettAi.root.join(PROVENANCE_FILE) return [] unless path.exist? [{ uri: "#{URI_PREFIX}log", name: 'provenance-log', description: 'Full AI provenance log', mime_type: 'application/x-yaml' }] end |
#read(_name = 'log') ⇒ Hash?
Reads the provenance log.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rosett_ai/mcp/resources/provenance_resource.rb', line 38 def read(_name = 'log') path = RosettAi.root.join(PROVENANCE_FILE) return nil unless path.exist? { uri: "#{URI_PREFIX}log", content: File.read(path), mime_type: 'application/x-yaml' } end |