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 +4 -4
- data/README.md +21 -14
- data/lib/agents_control/channels/telegram/router.rb +10 -2
- data/lib/agents_control/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ca83918e01b4dc98c7b72f17da5cd31d859d863d61614f7eee74dd01e62ecb2
|
|
4
|
+
data.tar.gz: d50f30441533aded38f243800dda29a884fd01fda135506dee034115eeb63e7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
108
|
-
echoes back whatever's typed, so it looks for that
|
|
109
|
-
screen and shows from there — sharper than diffing
|
|
110
|
-
it still works even if something else wrote to the
|
|
111
|
-
between, since it doesn't need the screen from right
|
|
112
|
-
relate to the screen after at all. A short reply
|
|
113
|
-
add -p`) isn't a safe anchor on its own — too
|
|
114
|
-
something unrelated — so those fall back to a
|
|
115
|
-
instead, and when even that can't cleanly tell
|
|
116
|
-
current screen outright: seeing the result,
|
|
117
|
-
stale context around it, beats not seeing it
|
|
118
|
-
captured either way is a `/settings` option
|
|
119
|
-
200 by default) — a command whose output
|
|
120
|
-
last N lines, same as the default gets cut
|
|
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
|
-
|
|
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:
|
|
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)
|