@phnx-labs/agents-cli 1.23.6 → 1.23.7
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.7
|
|
4
|
+
|
|
5
|
+
- **A tab watching a session names the workspace its editor window has open.** Each `observerTerminals` entry in `agents feed watch --json` now carries the tab's `workspaceDir`, so AGI EXT can group sessions by the window that holds their tab and label it `agents` or `agents-cli` instead of "Window 2". An entry that comes only from a session's origin terminal has no tab row and still carries none. Source: `cli/src/lib/session/projection.ts`.
|
|
6
|
+
|
|
7
|
+
- **A session opened over ssh reads as a terminal session, not headless.** An interactive session reached through `ssh -tt` (how AGI EXT opens a remote session in an editor tab) runs under sshd with a real pty but no known terminal app, so `sessions --active` labelled it `headless` and the extension filed it under Background. A process with a controlling tty is now `terminal` (with `presence: attached`); detached runs such as daemon jobs and teams stay `headless`. Answering such a session's open question no longer runs `--resume` beside the live process (which would start a second writer on its transcript); with no tmux or iTerm rail to type into, the answer is refused with the recovery hint. Source: `cli/src/lib/session/active.ts`, `cli/src/lib/answer-router.ts`.
|
|
8
|
+
|
|
3
9
|
## 1.23.6
|
|
4
10
|
|
|
5
11
|
- **Live sessions no longer drop out of `sessions --active` (roster liveness).** A resumed session was dropped from the roster on every cached rescan because the PID-reuse check compared the live process against when the session was born, so fleet workers flipped between listing their sessions and listing none. The check now uses the process's own start time. A peer answering a fleet sweep scans fresh rather than serving its snapshot, and agent-named helper processes with no session or launch record (embedded app-servers, daemons) are no longer listed as sessions. Source: `cli/src/lib/session/active.ts`, `cli/src/commands/ps-roster.ts`.
|
|
@@ -18,7 +18,7 @@ export declare function processTableLiveReadCountForTest(): number;
|
|
|
18
18
|
export declare function unattributedFullRescanCountForTest(): number;
|
|
19
19
|
export declare function attributedSetLostPids(prev: Set<number>, next: Set<number>): boolean;
|
|
20
20
|
export declare function filterCachedUnattributed(sessions: ActiveSession[], attributed: Set<number>, alive: (pid: number, processStartedAtMs?: number) => boolean, ppidMap?: Map<number, number>): ActiveSession[];
|
|
21
|
-
type ActiveContext = 'terminal' | 'teams' | 'cloud' | 'headless';
|
|
21
|
+
export type ActiveContext = 'terminal' | 'teams' | 'cloud' | 'headless';
|
|
22
22
|
export type BackfillMeta = Pick<SessionMeta, 'version' | 'account' | 'accountId' | 'accountKey' | 'timestamp' | 'label' | 'firstUserMessage' | 'lastUserMessage' | 'generatedTitle' | 'ticketId' | 'prUrl' | 'prNumber' | 'origin' | 'routineName' | 'harness' | 'tokenCount' | 'durationMs' | 'subAgentCount' | 'lastActivity'>;
|
|
23
23
|
export declare function backfillActiveRowsFromMeta(sessions: ActiveSession[], metaById: Map<string, BackfillMeta>): void;
|
|
24
24
|
export declare function sessionAccountLabel(kind: string, session: Pick<SessionMeta, 'accountId' | 'accountKey' | 'account'>, accounts?: import("../account-registry.js").NativeAccount[]): string | undefined;
|
|
@@ -212,6 +212,7 @@ interface ProcRow {
|
|
|
212
212
|
export declare function parseWin32ProcessCsv(out: string): ProcRow[];
|
|
213
213
|
export declare function resolveCwds(pids: number[], probe?: (pid: number) => Promise<string | undefined>): Promise<(string | undefined)[]>;
|
|
214
214
|
export declare function hostFromPid(pid: number): Promise<string | undefined>;
|
|
215
|
+
export declare function unattributedContext(host: string | undefined, tty: string | undefined): ActiveContext;
|
|
215
216
|
export interface AgentCandidate {
|
|
216
217
|
pid: number;
|
|
217
218
|
kind: string;
|
|
@@ -968,6 +968,9 @@ const UI_HOSTS = new Set([
|
|
|
968
968
|
'iterm', 'terminal', 'warp', 'alacritty', 'kitty', 'hyper', 'wezterm', 'ghostty',
|
|
969
969
|
'tmux', 'screen',
|
|
970
970
|
]);
|
|
971
|
+
export function unattributedContext(host, tty) {
|
|
972
|
+
return tty || (host && UI_HOSTS.has(host)) ? 'terminal' : 'headless';
|
|
973
|
+
}
|
|
971
974
|
export function readAncestorSessionEntry(pid, ppidMap, kind, readEntry = readPidSessionEntry) {
|
|
972
975
|
let cur = ppidMap.get(pid);
|
|
973
976
|
const seen = new Set();
|
|
@@ -1101,7 +1104,8 @@ async function listUnattributedActiveLive(attributed) {
|
|
|
1101
1104
|
const sessionFile = findSessionFileForKind(kind, cwd, exactId);
|
|
1102
1105
|
const topic = sessionFile ? quickExtractTopic(sessionFile) : undefined;
|
|
1103
1106
|
const host = detectHost(pid, procByPid);
|
|
1104
|
-
const
|
|
1107
|
+
const tty = procByPid.get(pid)?.tty;
|
|
1108
|
+
const context = unattributedContext(host, tty);
|
|
1105
1109
|
const { state, tokPerSec } = computeLiveSignals(kind, sessionFile, cwd, true);
|
|
1106
1110
|
const { birthtimeMs, mtimeMs } = sessionFileTimes(sessionFile);
|
|
1107
1111
|
const resolvedId = exactId ?? sessionIdFromFile(kind, sessionFile);
|
|
@@ -1112,7 +1116,7 @@ async function listUnattributedActiveLive(attributed) {
|
|
|
1112
1116
|
kind,
|
|
1113
1117
|
harness: entry?.harness,
|
|
1114
1118
|
host,
|
|
1115
|
-
tty
|
|
1119
|
+
tty,
|
|
1116
1120
|
pid,
|
|
1117
1121
|
cwd,
|
|
1118
1122
|
sessionId: resolvedId,
|
|
@@ -63,7 +63,7 @@ export class SessionProjection {
|
|
|
63
63
|
continue;
|
|
64
64
|
selected.set(`${candidate.scope}\0${chosen.rowKey}`, rowKey);
|
|
65
65
|
const observerTerminals = observations.filter(item => !item.row.previous && (item.row.terminalId || item.row.viewingIn || item.row.provenance?.reply))
|
|
66
|
-
.map(({ scope: device, row }) => ({ device, terminalId: row.terminalId, launchId: row.launchId, viewingIn: row.viewingIn, provenance: row.provenance }));
|
|
66
|
+
.map(({ scope: device, row }) => ({ device, terminalId: row.terminalId, launchId: row.launchId, viewingIn: row.viewingIn, provenance: row.provenance, ...(row.workspaceDir ? { workspaceDir: row.workspaceDir } : {}) }));
|
|
67
67
|
const origin = chosen.originTerminal;
|
|
68
68
|
if (!chosen.previous && origin && normalizeHost(origin.device) !== owner) {
|
|
69
69
|
const device = normalizeHost(origin.device);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.7",
|
|
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",
|