panteao-client 1.1.36 → 1.1.38
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 +4 -4
- data/lib/panteao_client.rb +17 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 554c5f4543faad57850e23df55c1959508fbee48034f67c62b0a85c08f3dafd7
|
|
4
|
+
data.tar.gz: df0c5a7fbe0a79dbe1afaae7249ff0894d410c3969add3867ee07c0ff25e9012
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a72d4a503090b7192f74d74c29b87d522d754f6dc837b33fab0d32162996deff4c08c2b50aa9ee35a044fc574b686e0545d3748c05be4ecfabc16c40d64dc553
|
|
7
|
+
data.tar.gz: 8304ee6d896c9c2f686aebacd4e02c5e2e4f5a24994707dce7687fdb1f6f08cacac005ff3ab1fec8d76aeeb7497d15bfe5a1892ebecdb42bfeb79f35dc3a84b3
|
data/lib/panteao_client.rb
CHANGED
|
@@ -9,7 +9,7 @@ require 'open3'
|
|
|
9
9
|
require 'stringio'
|
|
10
10
|
|
|
11
11
|
module Panteao
|
|
12
|
-
VERSION = '1.1.
|
|
12
|
+
VERSION = '1.1.38'
|
|
13
13
|
|
|
14
14
|
class BdiClient
|
|
15
15
|
|
|
@@ -116,6 +116,7 @@ module Panteao
|
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
@handlers = {}
|
|
119
|
+
@any_action_handler = nil
|
|
119
120
|
@running = true
|
|
120
121
|
@thread = Thread.new { listen }
|
|
121
122
|
end
|
|
@@ -130,6 +131,10 @@ module Panteao
|
|
|
130
131
|
@socket.write(payload)
|
|
131
132
|
end
|
|
132
133
|
|
|
134
|
+
def on_any_action(&block)
|
|
135
|
+
@any_action_handler = block
|
|
136
|
+
end
|
|
137
|
+
|
|
133
138
|
def register_action(action_name, &block)
|
|
134
139
|
@handlers[action_name] = block
|
|
135
140
|
end
|
|
@@ -155,12 +160,16 @@ module Panteao
|
|
|
155
160
|
if msg['type'] == 'action'
|
|
156
161
|
raw_action = msg['action']
|
|
157
162
|
action_id = msg['id']
|
|
163
|
+
agent_name = msg['agent'] || ""
|
|
158
164
|
name, args = parse_action(raw_action)
|
|
159
165
|
|
|
166
|
+
respond = proc { |success| send_action_result(action_id, success) }
|
|
167
|
+
|
|
160
168
|
handler = @handlers[name]
|
|
161
169
|
if handler
|
|
162
|
-
|
|
163
|
-
|
|
170
|
+
handler.call(agent_name, args, respond)
|
|
171
|
+
elsif @any_action_handler
|
|
172
|
+
@any_action_handler.call(agent_name, name, args, respond)
|
|
164
173
|
else
|
|
165
174
|
send_action_result(action_id, true)
|
|
166
175
|
end
|
|
@@ -232,3 +241,8 @@ module Panteao
|
|
|
232
241
|
end
|
|
233
242
|
end
|
|
234
243
|
end
|
|
244
|
+
|
|
245
|
+
module Panteao
|
|
246
|
+
Panteao = PanteaoClient::BdiClient
|
|
247
|
+
Panteão = PanteaoClient::BdiClient
|
|
248
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: panteao-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.38
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Panteao Authors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|