@phnx-labs/agents-cli 1.20.36 → 1.20.37
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.
- package/dist/commands/sessions-sync.d.ts +3 -0
- package/dist/commands/sessions-sync.js +44 -4
- package/dist/commands/sessions.d.ts +7 -0
- package/dist/commands/sessions.js +147 -35
- package/dist/lib/daemon.js +4 -2
- package/dist/lib/devices/resolve-target.d.ts +24 -0
- package/dist/lib/devices/resolve-target.js +80 -0
- package/dist/lib/session/active.d.ts +19 -0
- package/dist/lib/session/active.js +10 -4
- package/dist/lib/session/db.d.ts +2 -1
- package/dist/lib/session/db.js +41 -5
- package/dist/lib/session/discover.d.ts +2 -0
- package/dist/lib/session/discover.js +16 -1
- package/dist/lib/session/ghostty-tabs.d.ts +33 -0
- package/dist/lib/session/ghostty-tabs.js +126 -0
- package/dist/lib/session/relative-time.js +6 -2
- package/dist/lib/session/remote-active.js +4 -14
- package/dist/lib/session/remote-list.js +4 -12
- package/dist/lib/session/remote.js +4 -2
- package/dist/lib/session/sync/config.d.ts +13 -0
- package/dist/lib/session/sync/config.js +56 -0
- package/dist/lib/session/types.d.ts +6 -0
- package/dist/lib/sync-umbrella.js +4 -4
- package/dist/lib/tmux/session.d.ts +10 -0
- package/dist/lib/tmux/session.js +31 -0
- package/package.json +1 -1
package/dist/lib/tmux/session.js
CHANGED
|
@@ -156,6 +156,37 @@ export async function killAll(socket) {
|
|
|
156
156
|
catch { /* may not exist */ }
|
|
157
157
|
return count;
|
|
158
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Map every pane id (`%N`) on a socket to its `session:window.pane` attach
|
|
161
|
+
* target, in one batched `tmux list-panes -a` call. `%116 -> main:2.0` is a
|
|
162
|
+
* valid `tmux attach -t main:2` / `tmux select-window -t main:2` target — a
|
|
163
|
+
* human jump target, unlike the bare `%pane` send-keys id. Because it walks
|
|
164
|
+
* every pane (not just one-per-session), it also surfaces multiple agents that
|
|
165
|
+
* share a session across windows. Best-effort: returns an empty map on any
|
|
166
|
+
* failure (tmux gone, foreign socket) so callers fall back to the raw pane id.
|
|
167
|
+
*/
|
|
168
|
+
export async function mapPanesToTargets(socket) {
|
|
169
|
+
const out = new Map();
|
|
170
|
+
let res;
|
|
171
|
+
try {
|
|
172
|
+
res = await runTmux({
|
|
173
|
+
socket,
|
|
174
|
+
args: ['list-panes', '-a', '-F', '#{pane_id} #{session_name}:#{window_index}.#{pane_index}'],
|
|
175
|
+
throwOnError: false,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
if (res.code !== 0)
|
|
182
|
+
return out;
|
|
183
|
+
for (const line of res.stdout.split('\n')) {
|
|
184
|
+
const sp = line.indexOf(' ');
|
|
185
|
+
if (sp > 0)
|
|
186
|
+
out.set(line.slice(0, sp), line.slice(sp + 1).trim());
|
|
187
|
+
}
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
159
190
|
/**
|
|
160
191
|
* List live sessions on the socket. Reconciles meta JSONs against tmux's view:
|
|
161
192
|
* - tmux session with no meta → returned without `meta` (external session)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.37",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|