@phnx-labs/agents-cli 1.23.6 → 1.23.8

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.8
4
+
5
+ - **AGI Menu config keys for the Linear tab, Sessions kinds and ticket grouping (PHNX-4326).** `tabOrder`/`hiddenTabs` accept `linear`; new `menubar.menu.showBrowserSessions` and `showComputerSessions` (default `true`) and `menubar.menu.ticketGroup` (default `none`; reads `milestone` while the superseded `groupTicketsByMilestone` is on). Source: `cli/src/lib/device-config.ts`, `cli/src/lib/menubar/snapshot.ts`.
6
+
7
+ ## 1.23.7
8
+
9
+ - **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`.
10
+
11
+ - **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`.
12
+
3
13
  ## 1.23.6
4
14
 
5
15
  - **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`.
@@ -1,7 +1,7 @@
1
1
  import type { AgentId } from './types.js';
2
2
  import { type ModelTier } from './model-tiers.js';
3
3
  export type ConfigScope = 'run' | 'interactive' | 'auto' | 'browser' | 'project' | 'device' | 'summarizer' | 'updates' | 'menubar';
4
- export declare const MENUBAR_MENU_PROPERTIES: readonly ["defaultProject", "workingRowsShown", "showPreviews", "projectPriorityFilter", "hideCompletedMilestones", "bannerWhenNeedsYou", "includeOtherDeviceRequests", "groupBy", "thenBy", "projectScope", "projectSort", "ticketSort", "showPullRequests", "sessionUpdates", "deviceSort", "headlessAgent", "headlessFallbackAgent", "headlessPlacement", "pinnedProjects", "tabOrder", "hiddenTabs", "groupTicketsByMilestone", "prGroupOpen", "prGroupMerged", "homeGoals", "githubHidden", "githubDrafts", "githubBots"];
4
+ export declare const MENUBAR_MENU_PROPERTIES: readonly ["defaultProject", "workingRowsShown", "showPreviews", "projectPriorityFilter", "hideCompletedMilestones", "bannerWhenNeedsYou", "includeOtherDeviceRequests", "groupBy", "thenBy", "projectScope", "projectSort", "ticketSort", "showPullRequests", "sessionUpdates", "showBrowserSessions", "showComputerSessions", "deviceSort", "headlessAgent", "headlessFallbackAgent", "headlessPlacement", "pinnedProjects", "tabOrder", "hiddenTabs", "groupTicketsByMilestone", "ticketGroup", "prGroupOpen", "prGroupMerged", "homeGoals", "githubHidden", "githubDrafts", "githubBots"];
5
5
  export declare const MENUBAR_STATUSBAR_PROPERTIES: readonly ["goalCountdown"];
6
6
  export type MenubarSection = 'menu' | 'statusbar';
7
7
  export declare const MENUBAR_CONFIG_KEYS: readonly string[];
@@ -16,6 +16,8 @@ export const MENUBAR_MENU_PROPERTIES = [
16
16
  'ticketSort',
17
17
  'showPullRequests',
18
18
  'sessionUpdates',
19
+ 'showBrowserSessions',
20
+ 'showComputerSessions',
19
21
  'deviceSort',
20
22
  'headlessAgent',
21
23
  'headlessFallbackAgent',
@@ -24,6 +26,7 @@ export const MENUBAR_MENU_PROPERTIES = [
24
26
  'tabOrder',
25
27
  'hiddenTabs',
26
28
  'groupTicketsByMilestone',
29
+ 'ticketGroup',
27
30
  'prGroupOpen',
28
31
  'prGroupMerged',
29
32
  'homeGoals',
@@ -29,7 +29,7 @@ interface ConfigTarget {
29
29
  }
30
30
  declare const DEVICE_ROLES: readonly ["worker", "personal", "desktop"];
31
31
  declare const AUTO_POOL_MODES: readonly ["workers", "all"];
32
- export declare const MENUBAR_TABS: readonly ["home", "goals", "secrets", "projects", "github", "sessions", "inbox"];
32
+ export declare const MENUBAR_TABS: readonly ["home", "goals", "secrets", "projects", "linear", "github", "sessions", "inbox"];
33
33
  export declare const MENUBAR_HOME_GOALS: readonly ["company", "week", "myWeek", "myDay"];
34
34
  export declare function resolveMenubarTabOrder(stored: readonly string[]): string[];
35
35
  export declare const CONFIG_KEYS: readonly ConfigKeySpec[];
@@ -14,8 +14,8 @@ const SSH_AUTH_METHODS = ['key', 'password'];
14
14
  const DEVICE_ROLES = ['worker', 'personal', 'desktop'];
15
15
  const AUTO_POOL_MODES = ['workers', 'all'];
16
16
  const DEVICE_FORM_FACTORS = ['laptop', 'desktop', 'server', 'unknown'];
17
- export const MENUBAR_TABS = ['home', 'goals', 'secrets', 'projects', 'github', 'sessions', 'inbox'];
18
- const MENUBAR_TABS_ADDED_LATER = ['goals', 'secrets', 'github'];
17
+ export const MENUBAR_TABS = ['home', 'goals', 'secrets', 'projects', 'linear', 'github', 'sessions', 'inbox'];
18
+ const MENUBAR_TABS_ADDED_LATER = ['goals', 'secrets', 'linear', 'github'];
19
19
  export const MENUBAR_HOME_GOALS = ['company', 'week', 'myWeek', 'myDay'];
20
20
  export function resolveMenubarTabOrder(stored) {
21
21
  const known = MENUBAR_TABS;
@@ -474,6 +474,24 @@ export const CONFIG_KEYS = [
474
474
  description: 'AGI Menu: show the session-updates section on Home. Off leaves Home to requests and progress ' +
475
475
  'only; the full list stays on the Sessions tab either way.',
476
476
  },
477
+ {
478
+ name: 'menubar.menu.showBrowserSessions',
479
+ yamlKey: 'menubarMenuShowBrowserSessions',
480
+ scope: 'user',
481
+ type: 'bool',
482
+ defaultValue: true,
483
+ description: 'AGI Menu: list browser tasks on the Sessions tab (its Browser filter). Off removes them; with ' +
484
+ 'showComputerSessions also off, Sessions lists agents only.',
485
+ },
486
+ {
487
+ name: 'menubar.menu.showComputerSessions',
488
+ yamlKey: 'menubarMenuShowComputerSessions',
489
+ scope: 'user',
490
+ type: 'bool',
491
+ defaultValue: true,
492
+ description: 'AGI Menu: list computer runs on the Sessions tab (its Computer filter). Off removes them; with ' +
493
+ 'showBrowserSessions also off, Sessions lists agents only.',
494
+ },
477
495
  {
478
496
  name: 'menubar.menu.deviceSort',
479
497
  yamlKey: 'menubarMenuDeviceSort',
@@ -550,7 +568,7 @@ export const CONFIG_KEYS = [
550
568
  type: 'string-list',
551
569
  defaultValue: [...MENUBAR_TABS],
552
570
  description: `AGI Menu: the order of the tab bar — every one of ${MENUBAR_TABS.join(', ')} exactly once. ` +
553
- 'Settings is always last and is not listed. An order saved before Goals, Secrets or GitHub existed may omit them; ' +
571
+ 'Settings is always last and is not listed. An order saved before Goals, Secrets, Linear or GitHub existed may omit them; ' +
554
572
  'they read back appended. Hiding a tab is menubar.menu.hiddenTabs, not this key.',
555
573
  validate: (v) => {
556
574
  const tabs = v;
@@ -632,7 +650,17 @@ export const CONFIG_KEYS = [
632
650
  scope: 'user',
633
651
  type: 'bool',
634
652
  defaultValue: false,
635
- description: 'AGI Menu: group a project\'s tickets under milestone headers. Off = one flat list ordered by ticketSort.',
653
+ description: 'AGI Menu: superseded by menubar.menu.ticketGroup (an unset ticketGroup reads as milestone while this is true). Kept for menus older than ticketGroup.',
654
+ },
655
+ {
656
+ name: 'menubar.menu.ticketGroup',
657
+ yamlKey: 'menubarMenuTicketGroup',
658
+ scope: 'user',
659
+ type: 'string',
660
+ defaultValue: 'none',
661
+ description: 'AGI Menu: how the Projects and Linear tabs group each project\'s tickets — none, status, assignee, ' +
662
+ 'delegate, milestone, or priority. Replaces groupTicketsByMilestone for menus that know it.',
663
+ validate: oneOf('menubar.menu.ticketGroup', ['none', 'status', 'assignee', 'delegate', 'milestone', 'priority']),
636
664
  },
637
665
  {
638
666
  name: 'menubar.menu.prGroupOpen',
@@ -56,7 +56,11 @@ function effectiveMenuPreferences() {
56
56
  const out = [];
57
57
  for (const name of MENUBAR_CONFIG_KEYS) {
58
58
  const entry = getConfigValue(name);
59
- const value = entry.value !== undefined ? entry.value : entry.spec.defaultValue;
59
+ let value = entry.value !== undefined ? entry.value : entry.spec.defaultValue;
60
+ if (name === 'menubar.menu.ticketGroup' && entry.value === undefined
61
+ && getConfigValue('menubar.menu.groupTicketsByMilestone').value === true) {
62
+ value = 'milestone';
63
+ }
60
64
  if (value === undefined)
61
65
  continue;
62
66
  out.push([name, value]);
@@ -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 context = host && UI_HOSTS.has(host) ? 'terminal' : 'headless';
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: procByPid.get(pid)?.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);
@@ -52,6 +52,7 @@ export interface SessionWatchRow extends Omit<ActiveSession, 'viewingIn' | 'cont
52
52
  terminalId?: string;
53
53
  launchId?: string;
54
54
  viewingIn: string | null;
55
+ workspaceDir?: string;
55
56
  provenance?: ActiveSession['provenance'];
56
57
  }[];
57
58
  branch?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.23.6",
3
+ "version": "1.23.8",
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",