agents_control 0.2.0 → 0.2.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: b71d165050803893091b3bce0857cb4a9cac7875e28289e0aaebc6bf4a1aa820
4
- data.tar.gz: a301e0e972625e0eb57a79e80799e21edf2232d24ef8bbbfb74840484d1feb7e
3
+ metadata.gz: 5ca83918e01b4dc98c7b72f17da5cd31d859d863d61614f7eee74dd01e62ecb2
4
+ data.tar.gz: d50f30441533aded38f243800dda29a884fd01fda135506dee034115eeb63e7a
5
5
  SHA512:
6
- metadata.gz: b6a5dd4eb521026c1084ade954fbe7d7a8f26426e3d68d78077a3d69e71addc0c40165181eaaff963a225434a71167e0ed02f68382fe8ed4605a46f8e781bc54
7
- data.tar.gz: 7077e2aa298e86630f4c619e67a6bde0be85a2316f86c43b46dbd354353bc9404f91a0db8aa86ab9f8fcf1f0c3d6e8cee101c1b55cbf53080810f52d2ba37df1
6
+ metadata.gz: 9dd870ff93dd579dd1bbbc7cffd7e9f62d7a5d25ba79d2f69adb6018ac1ae8061614b5e1d09db5bc817d65f8f6a33fc7557b8a6a035245d640e92373bcdc598d
7
+ data.tar.gz: 71c5a463b794b2196fa3023a0a703ab6cd02da596f2b1f003ea1365db96f9a67e8d3ab3e1ddc51bdd470d76217395907565a2d53ef65dccf6fc0b411c04dee0a
data/README.md CHANGED
@@ -104,20 +104,27 @@ Bot commands:
104
104
 
105
105
  The number `N` comes from the last list shown.
106
106
 
107
- `/run` treats the command itself as the reference point: the shell
108
- echoes back whatever's typed, so it looks for that exact text on
109
- screen and shows from there — sharper than diffing screenshots, and
110
- it still works even if something else wrote to the same tab in
111
- between, since it doesn't need the screen from right before typing to
112
- relate to the screen after at all. A short reply ("y", "n" mid `git
113
- add -p`) isn't a safe anchor on its own — too likely to match
114
- something unrelated — so those fall back to a before/after diff
115
- instead, and when even that can't cleanly tell what's new, to the
116
- current screen outright: seeing the result, possibly with a little
117
- stale context around it, beats not seeing it at all. How much gets
118
- captured either way is a `/settings` option (`terminal.run_result_lines`,
119
- 200 by default) — a command whose output runs longer just gets its
120
- last N lines, same as the default gets cut by a screen that's too tall.
107
+ Against a plain tab, `/run` treats the command itself as the reference
108
+ point: the shell echoes back whatever's typed, so it looks for that
109
+ exact text on screen and shows from there — sharper than diffing
110
+ screenshots, and it still works even if something else wrote to the
111
+ same tab in between, since it doesn't need the screen from right
112
+ before typing to relate to the screen after at all. A short reply
113
+ ("y", "n" mid `git add -p`) isn't a safe anchor on its own — too
114
+ likely to match something unrelated — so those fall back to a
115
+ before/after diff instead, and when even that can't cleanly tell
116
+ what's new, to the current screen outright: seeing the result,
117
+ possibly with a little stale context around it, beats not seeing it
118
+ at all. How much gets captured either way is a `/settings` option
119
+ (`terminal.run_result_lines`, 200 by default) — a command whose output
120
+ runs longer just gets its last N lines, same as the default gets cut
121
+ by a screen that's too tall.
122
+
123
+ Against an agent, `/run` just confirms the send — an agent isn't a
124
+ shell command that finishes in a couple of seconds, so there's no
125
+ "result" to capture yet by the time it would look. Hooks already own
126
+ telling Telegram when it's actually done or needs something, the same
127
+ as replying to one of its own questions.
121
128
 
122
129
  The result stays a live target: replying to it — "y", "n", anything —
123
130
  types straight into that same pane and shows what came back, so
@@ -200,7 +200,15 @@ module AgentsControl
200
200
  if remote?(session)
201
201
  confirm_remote(chat_id, session, command)
202
202
  else
203
- execute(chat_id, session, command, show_result: true)
203
+ # An agent isn't a shell command that finishes in a
204
+ # couple of seconds — it's a real task, and hooks already
205
+ # own telling Telegram when it's actually done or needs
206
+ # something. Capturing a "result" a moment after typing
207
+ # would just catch it mid-thought and fall back to
208
+ # dumping its whole transcript, which isn't a result at
209
+ # all — same reasoning as replying to an agent's own
210
+ # question (type_into_session).
211
+ execute(chat_id, session, command, show_result: !session.agent?)
204
212
  end
205
213
  end
206
214
  end
@@ -514,7 +522,7 @@ module AgentsControl
514
522
  case payload["action"]
515
523
  when "focus" then focus_session(chat_id, session)
516
524
  when "screen" then show_screen(chat_id, session)
517
- when "run" then execute(chat_id, session, payload["text"], show_result: true)
525
+ when "run" then execute(chat_id, session, payload["text"], show_result: !session.agent?)
518
526
  when "close_confirm" then say(chat_id, "Close #{session.label}?",
519
527
  markup: @keyboards.confirm("close", session))
520
528
  when "close" then close_session(chat_id, session)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentsControl
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sapar Kurmanov