agents_control 0.4.0 → 0.4.1

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: cce6dbc39dbec059d87d6f739af51d705b2e11e8b6c11225dd0021c37461f17f
4
- data.tar.gz: 646165dca05e1718512e7d8d065d2c76568618429999f5eb15c7e58fa9dfab93
3
+ metadata.gz: c3874da604b267aa3a3cc898e173359dc8170e1a9ed2de69558a273e8b5a58a4
4
+ data.tar.gz: 58979572d52e5be675385e063fb27a7b7d49e227a910b93994560b303b54c642
5
5
  SHA512:
6
- metadata.gz: d12b481351f8479279aa6867c2206609392d561236cd3680eed567272a496bfff8884ec0f3ebf72e50f1f9c4cac167882886c6087d9c011edda476b6e0229c3e
7
- data.tar.gz: 907ff99d3b625927e0fba4b79a7aaf4010cd3875b00e6fe5f1d6b7d8e0d2756d34d0e1598cd9af73543cfe67041de7949ee2cf8c6ca080f8ddc885fd35b5b49a
6
+ metadata.gz: eb6bf2f450eb26865fb5cba496e050aaa147688600be1e46815ed9b50050f6153aff9ab870cd0a60d9bb26f52cbef7c133afb66eb38ae4f2a6d2fd353481c2c1
7
+ data.tar.gz: f91a16af53fca99ef7485276532eebbcc4561e61434759afcf0b021dc143f3bb269c8614d8ff4b10355609f63eb1b53b658a19bd5ad62f8ffce851e1869a07ca
@@ -220,11 +220,13 @@ module AgentsControl
220
220
  say(chat_id, "Couldn't save that file: #{@api.redact(e.message)}")
221
221
  end
222
222
 
223
- # Three ways to say where it goes, in order of how explicit they
224
- # are: a caption naming a tab, a reply to something already tied
225
- # to a session, or neither — in which case the path is just
226
- # handed back, since guessing at a target for a file is how it
227
- # ends up pasted into the wrong project.
223
+ # Ways to say where it goes, in order of how explicit they are: a
224
+ # caption naming a tab, a reply to something already tied to a
225
+ # session, the rest of an album, or the session that spoke last —
226
+ # for an agent only, since a bare path typed into a shell is a
227
+ # command, not a file handed over. With none of those the path is
228
+ # just handed back: guessing further is how a file ends up pasted
229
+ # into the wrong project.
228
230
  def deliver_file(chat_id, message, path)
229
231
  caption = message["caption"].to_s.strip
230
232
  album = album_key(chat_id, message)
@@ -245,6 +247,16 @@ module AgentsControl
245
247
  return execute(chat_id, session, with_path("", path))
246
248
  end
247
249
 
250
+ if (last = @store.get(last_target_key(chat_id)))
251
+ session = session_for(chat_id, last)
252
+ return unless session
253
+
254
+ if session.agent?
255
+ execute(chat_id, session, with_path(caption, path))
256
+ return remember_album(album, session)
257
+ end
258
+ end
259
+
248
260
  say(chat_id, "Saved:\n\n`#{path}`\n\nReply to a session's message with a file to hand it " \
249
261
  "straight over, or caption it `/run N`.")
250
262
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentsControl
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agents_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sapar Kurmanov