
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
indigoframework_agent_client
Advanced tools
Interact with your Indigo agent from your ruby code.
code :: https://github.com/stratumn/agent-client-ruby
Add this line to your agent's Gemfile:
gem 'indigoframework_agent_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install indigoframework_agent_client
agent = AgentClient::Agent.load('http://localhost:3000')
raise 'No process detected in Agent' if agent.list_processes.empty?
process = agent.get('process_name')
segment = process.create_map('My message map')
segment = segment.add_message('Hello, World', 'POTUS')
puts segment.meta
puts segment.state
Returns an instance of AgentClient::Agent containing several processes
agent = AgentClient::Agent.load('http://localhost:3000')
puts agent.list_processes()
Creates a new map in the agent.
agent = AgentClient::Agent.load('http://localhost:3000')
process = agent.get('process_name')
segment = process.create_map([], 'My message map')
Returns an existing segment.
agent = AgentClient::Agent.load('http://localhost:3000')
process = agent.get('process_name')
segment = process.get_segment('aee5427')
puts segment.link_hash
Returns existing segments.
Available options are:
offset: offset of first returned segmentslimit: limit number of returned segmentsmapIds: return segments with one of the specified map IDsprevLinkHash: return segments with specified previous link hashtags: return segments that contains all the tags (array)agent = AgentClient::Agent.load('http://localhost:3000')
process = agent.get('process_name')
segments = process.find_segments(tags: ['tag1', 'tag2'])
segments = process.find_segments(limit: 10)
Returns segment from a given raw object.
segment = AgentClient::Segment.from(raw_segment)
puts segment.process
puts segment.link_hash
Returns the previous segment of a segment (its parent).
agent = AgentClient::Agent.load('http://localhost:3000')
process = agent.get('process_name')
segment = process.get_segment('aee5427')
previous = segment.previous
Loads a full segment. Can be useful when you only have the meta data of links.
agent = AgentClient::Agent.load('http://localhost:3000')
process = agent.get('process_name')
segments = process.find_segments
segments.map { |segment| segment.load }
Executes a transition function and returns the new segment.
agent = AgentClient::Agent.load('http://localhost:3000')
process = agent.get('process_name')
segment = process.get_segment('aee5427')
new_segment = segment.addMessage([], 'Hello, World!')
# underscore version is also available
new_segment = segment.add_message([], 'Hello, World!')
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Tests are run against a mock agent whose results are recorded by vcr. Should you need to regenerate the cassettes or add new tests, the mock agent can be launched on port 3333.
$ cd spec/agent
$ npm install
$ node index.js
FAQs
Unknown package
We found that indigoframework_agent_client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.