legionio 1.4.87 → 1.4.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9ecd48fa743747aea34dee8175be57e1280ca6f6b65b84687ec315506694263
4
- data.tar.gz: 5301e5709b614c062d71ef04ef27fc582490dd7b7ce83e8f3fe4d6a3509801d2
3
+ metadata.gz: a0e24f00e2cca3ad2abf2c9850d6fdcfff16f53e386e5484177cc34eb13baec2
4
+ data.tar.gz: 847c48e1f2abee8f28318dfadba07ea47cf17dc0eb977178ad4257b83c44f500
5
5
  SHA512:
6
- metadata.gz: 2032e446fc6e104e56db67b9afb116b3587d56da1414bddc42e23c4f3562901825f36fad0fcf74014f48f3c3f0a6438de0ecc4cf0ca38601d3ef088baf534f7b
7
- data.tar.gz: a609212ab03b9ff708f7f805f8d312c6b0e724d939bbdc52d5abde40127f525c1c2a47fed10ad2289010c2643a393c68ea9c6155ed2cda72b2f0f8f754bdb16b
6
+ metadata.gz: '04911ee14831c99ed5a4422f17becbe580bc0cef64c275c209167b562f7898ef6e2828728f2483cf9182393b22bec4b424e63f701e2059c5408f1881b888cfd1'
7
+ data.tar.gz: 5f80462431a5041dae4498597faac067ca5f00165a4899817f14c2212f8f296b55615ee9b5c38b602991a077e9d962515d12ba43a193e87190fd50bad7f6fae6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Legion Changelog
2
2
 
3
+ ## [1.4.89] - 2026-03-20
4
+
5
+ ### Added
6
+ - ACP provider routes: `GET /.well-known/agent.json`, `POST /api/acp/tasks`, `GET /api/acp/tasks/:id`, `DELETE /api/acp/tasks/:id` (501 stub)
7
+ - `Legion::API::Routes::Acp` module for bidirectional ACP interoperability
8
+ - `build_agent_card`, `discover_capabilities`, `find_task`, `translate_status` API helpers for ACP support
9
+
10
+ ## [1.4.88] - 2026-03-20
11
+
12
+ ### Added
13
+ - ACP provider spec: 25 tests covering agent card discovery, task submission, task status, task cancellation stub, and status translation
14
+ - Refactored ACP helpers into `Legion::API::Helpers::Acp` module for testability
15
+
3
16
  ## [1.4.87] - 2026-03-20
4
17
 
5
18
  ### Added
@@ -2,9 +2,66 @@
2
2
 
3
3
  module Legion
4
4
  class API < Sinatra::Base
5
+ module Helpers
6
+ module Acp
7
+ def build_agent_card
8
+ name = begin
9
+ Legion::Settings[:client][:name]
10
+ rescue StandardError
11
+ 'legion'
12
+ end
13
+ port = begin
14
+ settings.port || 4567
15
+ rescue StandardError
16
+ 4567
17
+ end
18
+ {
19
+ name: name,
20
+ description: 'LegionIO digital worker',
21
+ url: "http://#{request.host}:#{port}/api/acp",
22
+ version: '2.0',
23
+ protocol: 'acp/1.0',
24
+ capabilities: discover_capabilities,
25
+ authentication: { schemes: ['bearer'] },
26
+ defaultInputModes: ['text/plain', 'application/json'],
27
+ defaultOutputModes: ['text/plain', 'application/json']
28
+ }
29
+ end
30
+
31
+ def discover_capabilities
32
+ if defined?(Legion::Extensions::Mesh::Helpers::Registry)
33
+ Legion::Extensions::Mesh::Helpers::Registry.new.capabilities.keys.map(&:to_s)
34
+ else
35
+ []
36
+ end
37
+ rescue StandardError
38
+ []
39
+ end
40
+
41
+ def find_task(id)
42
+ return nil unless defined?(Legion::Data)
43
+
44
+ Legion::Data::Model::Task[id.to_i]&.values
45
+ rescue StandardError
46
+ nil
47
+ end
48
+
49
+ def translate_status(status)
50
+ case status&.to_s
51
+ when /completed/ then 'completed'
52
+ when /exception|failed/ then 'failed'
53
+ when /queued|scheduled/ then 'queued'
54
+ else 'in_progress'
55
+ end
56
+ end
57
+ end
58
+ end
59
+
5
60
  module Routes
6
61
  module Acp
7
62
  def self.registered(app)
63
+ app.helpers Legion::API::Helpers::Acp
64
+
8
65
  app.get '/.well-known/agent.json' do
9
66
  card = build_agent_card
10
67
  content_type :json
@@ -44,58 +101,5 @@ module Legion
44
101
  end
45
102
  end
46
103
  end
47
-
48
- helpers do
49
- def build_agent_card
50
- name = begin
51
- Legion::Settings[:client][:name]
52
- rescue StandardError
53
- 'legion'
54
- end
55
- port = begin
56
- settings.port || 4567
57
- rescue StandardError
58
- 4567
59
- end
60
- {
61
- name: name,
62
- description: 'LegionIO digital worker',
63
- url: "http://#{request.host}:#{port}/api/acp",
64
- version: '2.0',
65
- protocol: 'acp/1.0',
66
- capabilities: discover_capabilities,
67
- authentication: { schemes: ['bearer'] },
68
- defaultInputModes: ['text/plain', 'application/json'],
69
- defaultOutputModes: ['text/plain', 'application/json']
70
- }
71
- end
72
-
73
- def discover_capabilities
74
- if defined?(Legion::Extensions::Mesh::Helpers::Registry)
75
- Legion::Extensions::Mesh::Helpers::Registry.new.capabilities.keys.map(&:to_s)
76
- else
77
- []
78
- end
79
- rescue StandardError
80
- []
81
- end
82
-
83
- def find_task(id)
84
- return nil unless defined?(Legion::Data)
85
-
86
- Legion::Data::Model::Task[id.to_i]&.values
87
- rescue StandardError
88
- nil
89
- end
90
-
91
- def translate_status(status)
92
- case status&.to_s
93
- when /completed/ then 'completed'
94
- when /exception|failed/ then 'failed'
95
- when /queued|scheduled/ then 'queued'
96
- else 'in_progress'
97
- end
98
- end
99
- end
100
104
  end
101
105
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.4.87'
4
+ VERSION = '1.4.89'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.87
4
+ version: 1.4.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity