@phnx-labs/agents-cli 1.23.0 → 1.23.2
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 +42 -0
- package/README.md +2 -0
- package/dist/commands/cloud-transcripts.js +1 -2
- package/dist/commands/daemon.js +70 -11
- package/dist/commands/exec.js +1 -1
- package/dist/commands/feed.js +1 -2
- package/dist/commands/focus.js +4 -1
- package/dist/commands/go.js +3 -2
- package/dist/commands/logs.js +1 -1
- package/dist/commands/menubar.js +28 -3
- package/dist/commands/ps-roster.d.ts +0 -11
- package/dist/commands/ps-roster.js +3 -116
- package/dist/commands/ps.d.ts +10 -0
- package/dist/commands/ps.js +182 -1
- package/dist/commands/resume.js +1 -1
- package/dist/commands/sessions-browser.d.ts +0 -1
- package/dist/commands/sessions-browser.js +6 -23
- package/dist/commands/sessions-export.js +1 -1
- package/dist/commands/sessions-migrate.js +1 -1
- package/dist/commands/sessions-picker.d.ts +6 -32
- package/dist/commands/sessions-picker.js +81 -8
- package/dist/commands/sessions-render.js +1 -1
- package/dist/commands/sessions-resume.js +2 -2
- package/dist/commands/sessions-share.js +1 -1
- package/dist/commands/sessions-trace.js +1 -1
- package/dist/commands/sessions.d.ts +2 -165
- package/dist/commands/sessions.js +16 -1216
- package/dist/lib/daemon/account-state-daemon-service.d.ts +2 -2
- package/dist/lib/daemon/account-state-daemon-service.js +2 -2
- package/dist/lib/daemon/attention-notify-service.js +8 -4
- package/dist/lib/daemon/daemon.d.ts +5 -1
- package/dist/lib/daemon/daemon.js +53 -6
- package/dist/lib/daemon/diagnostics.d.ts +70 -0
- package/dist/lib/daemon/diagnostics.js +185 -0
- package/dist/lib/daemon/service.d.ts +1 -1
- package/dist/lib/daemon/session-state-service.d.ts +1 -1
- package/dist/lib/daemon/session-state-service.js +2 -2
- package/dist/lib/daemon/supervisor.d.ts +8 -0
- package/dist/lib/daemon/supervisor.js +47 -6
- package/dist/lib/daemon-services.d.ts +3 -0
- package/dist/lib/daemon-services.js +36 -0
- package/dist/lib/daemon-ticks.d.ts +3 -1
- package/dist/lib/daemon-ticks.js +18 -12
- package/dist/lib/feed/tool-activity.js +10 -3
- package/dist/lib/feed/watch.js +8 -5
- package/dist/lib/helper-versions.js +1 -1
- package/dist/lib/menubar/install-menubar.d.ts +19 -1
- package/dist/lib/menubar/install-menubar.js +81 -12
- package/dist/lib/session/active.js +18 -14
- package/dist/lib/session/pid-registry.js +9 -6
- package/dist/lib/session/presentation.d.ts +107 -1
- package/dist/lib/session/presentation.js +543 -4
- package/dist/lib/session/remote/remote-list.d.ts +3 -0
- package/dist/lib/session/remote/remote-list.js +13 -0
- package/dist/lib/session/resume-command.d.ts +9 -0
- package/dist/lib/session/resume-command.js +107 -0
- package/dist/lib/session/selection.d.ts +102 -0
- package/dist/lib/session/selection.js +443 -0
- package/package.json +1 -1
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import { type Command } from 'commander';
|
|
2
2
|
import { type ProjectDef } from '../lib/projects.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SessionMeta } from '@phnx-labs/sessions-cli/reader';
|
|
4
4
|
import { type ActiveSession } from '../lib/session/active.js';
|
|
5
5
|
export { activeSessionProjectKey, backfillActiveRowsFromIndex, backfillActiveRowsFromMeta, isRunningLiveSession, serializeActiveSessionsForJson, serializeSessionsJson, type BackfillMeta } from '../lib/session/active.js';
|
|
6
|
-
import { loadLocalActiveSessions } from '../lib/session/session-cache.js';
|
|
7
|
-
import { gatherRemoteList, runOnPeer } from '../lib/session/remote-list.js';
|
|
8
6
|
import { type RunMeta } from '../lib/scheduling/routines.js';
|
|
9
|
-
import { type PickedSession, type SessionPreviewDigest } from './sessions-picker.js';
|
|
10
7
|
import { type TranscriptRenderOptions } from '../lib/session/presentation.js';
|
|
11
8
|
export { buildFilterOptions, renderSession, renderSessionLog, renderSessionLogJson, resolveViewMode, type TranscriptRenderOptions, } from '../lib/session/presentation.js';
|
|
12
|
-
|
|
13
|
-
agent?: string;
|
|
14
|
-
version?: string;
|
|
15
|
-
sessionVersion?: string;
|
|
16
|
-
project?: string;
|
|
17
|
-
all?: boolean;
|
|
18
|
-
teams?: boolean;
|
|
19
|
-
inTeam?: string;
|
|
20
|
-
routine?: boolean | string;
|
|
21
|
-
since?: string;
|
|
22
|
-
until?: string;
|
|
23
|
-
}
|
|
9
|
+
import { type FleetResolveDeps, type LiveMetadataDeps, type SessionFilterOptions, type SessionSearchScope } from '../lib/session/selection.js';
|
|
24
10
|
interface SessionsOptions extends SessionFilterOptions, TranscriptRenderOptions {
|
|
25
11
|
unmanaged?: boolean;
|
|
26
12
|
query?: string[];
|
|
@@ -64,11 +50,6 @@ interface SessionsOptions extends SessionFilterOptions, TranscriptRenderOptions
|
|
|
64
50
|
skill?: string;
|
|
65
51
|
plugin?: string;
|
|
66
52
|
}
|
|
67
|
-
type InstalledVersionsForAgent = (agent: SessionAgentId) => string[];
|
|
68
|
-
export declare function parseInstalledAgentVersionQuery(query: string | undefined, installedVersions?: InstalledVersionsForAgent): string | undefined;
|
|
69
|
-
export declare function ticketLabel(s: Pick<SessionMeta, 'ticketId' | 'prNumber'>): string;
|
|
70
|
-
export declare function linkTicketCell(s: Pick<SessionMeta, 'ticketId' | 'prNumber' | 'prUrl'>, label: string): string;
|
|
71
|
-
export declare function linkCwdCell(s: Pick<SessionMeta, 'cwd' | '_remote'>, label: string): string;
|
|
72
53
|
interface SessionPickerJsonRow extends SessionMeta {
|
|
73
54
|
state: ActiveSession['status'] | 'inactive';
|
|
74
55
|
resumable: boolean;
|
|
@@ -84,8 +65,6 @@ interface SessionPickerJsonRow extends SessionMeta {
|
|
|
84
65
|
} | null;
|
|
85
66
|
}
|
|
86
67
|
export declare function serializeSessionPickerRows(sessions: SessionMeta[], liveSessions: ActiveSession[], self?: string): SessionPickerJsonRow[];
|
|
87
|
-
export declare function mergeLocalFirst(sessions: SessionMeta[], localMachine: string): SessionMeta[];
|
|
88
|
-
export declare function serializeResolvedSessionsJson(sessions: SessionMeta[]): string;
|
|
89
68
|
export declare function hasNoBrowserDisqualifyingFlags(options: SessionsOptions, query: string | undefined): boolean;
|
|
90
69
|
export interface RoutineRunGroup {
|
|
91
70
|
runId: string;
|
|
@@ -119,39 +98,6 @@ export declare function printRoutineDrilldown(drill: RoutineDrilldown, liveIndex
|
|
|
119
98
|
hiddenCount?: number;
|
|
120
99
|
hiddenUnmanaged?: number;
|
|
121
100
|
}): void;
|
|
122
|
-
export interface SessionDetailMessage {
|
|
123
|
-
role: 'user' | 'assistant';
|
|
124
|
-
text: string;
|
|
125
|
-
at: string | null;
|
|
126
|
-
}
|
|
127
|
-
export declare function buildSessionDetailBlock(session: SessionMeta, digest: SessionPreviewDigest | undefined, events: SessionEvent[], sourceStamp?: {
|
|
128
|
-
fileMtimeMs: number;
|
|
129
|
-
fileSize: number;
|
|
130
|
-
}): {
|
|
131
|
-
request: unknown;
|
|
132
|
-
timeline: unknown;
|
|
133
|
-
files: unknown;
|
|
134
|
-
messages: SessionDetailMessage[];
|
|
135
|
-
sourceRevision: string | null;
|
|
136
|
-
partial: boolean;
|
|
137
|
-
reason: string | null;
|
|
138
|
-
};
|
|
139
|
-
export declare function renderSessionPreview(query: string, scope: {
|
|
140
|
-
agent?: string;
|
|
141
|
-
project?: string;
|
|
142
|
-
local?: boolean;
|
|
143
|
-
hosts?: string[];
|
|
144
|
-
json?: boolean;
|
|
145
|
-
refresh?: boolean;
|
|
146
|
-
revision?: string;
|
|
147
|
-
}): Promise<void>;
|
|
148
|
-
export declare function formatLiveStatusHeadline(live: ActiveSession | undefined, bookmarked?: boolean): string;
|
|
149
|
-
export declare function matchesTeam(session: SessionMeta, team: string): boolean;
|
|
150
|
-
export declare function teamBadge(session: SessionMeta): {
|
|
151
|
-
plain: string;
|
|
152
|
-
width: number;
|
|
153
|
-
};
|
|
154
|
-
export declare function flatSessionRow(session: SessionMeta, live?: ActiveSession, showTicket?: boolean, cols?: PickerColumns, bookmarked?: boolean): string;
|
|
155
101
|
export declare function maybeLiveIndex(options: SessionsOptions): Promise<Map<string, ActiveSession> | undefined>;
|
|
156
102
|
export declare function overviewProjectKey(s: Pick<SessionMeta, 'project' | 'cwd'>, defs?: ProjectDef[]): string;
|
|
157
103
|
interface OverviewGroup {
|
|
@@ -165,117 +111,8 @@ export declare function buildOverviewGroups(pool: SessionMeta[], perProjectCap:
|
|
|
165
111
|
groups: OverviewGroup[];
|
|
166
112
|
projectCount: number;
|
|
167
113
|
};
|
|
168
|
-
export declare function printSessionTable(sessions: SessionMeta[], hiddenCount?: number, tree?: boolean, liveIndex?: Map<string, ActiveSession>): void;
|
|
169
|
-
export interface SshOriginTag {
|
|
170
|
-
device?: string;
|
|
171
|
-
}
|
|
172
|
-
export interface PickerColumns {
|
|
173
|
-
showMachine?: boolean;
|
|
174
|
-
machineLabel?: (m: string) => string;
|
|
175
|
-
machineWidth?: number;
|
|
176
|
-
showModel?: boolean;
|
|
177
|
-
modelWidth?: number;
|
|
178
|
-
showTicket?: boolean;
|
|
179
|
-
showHost?: boolean;
|
|
180
|
-
showBookmark?: boolean;
|
|
181
|
-
showStatus?: boolean;
|
|
182
|
-
gutter?: number;
|
|
183
|
-
}
|
|
184
|
-
export declare function machineLabeler(machines: string[]): (m: string) => string;
|
|
185
|
-
export declare function pickerColumnsFor(sessions: SessionMeta[]): PickerColumns;
|
|
186
|
-
export declare function liveHostLabel(a: ActiveSession | undefined): string;
|
|
187
|
-
export declare function formatPickerLabel(s: SessionMeta, query: string, cols?: PickerColumns, ssh?: SshOriginTag, host?: string, bookmarked?: boolean, live?: ActiveSession): string;
|
|
188
|
-
export declare function formatPickerTip(sessions: SessionMeta[]): string;
|
|
189
|
-
export declare function pickSessionInteractive(sessions: SessionMeta[], message?: string, initialSearch?: string, hiddenCount?: number, enterHint?: string, scope?: SessionSearchScope): Promise<PickedSession | null>;
|
|
190
|
-
export declare const LIVE_ROW_PREFIX = "live:";
|
|
191
|
-
export declare function handlePickedSession(picked: PickedSession): Promise<void>;
|
|
192
|
-
export declare function resumeSessionInPlace(session: SessionMeta): Promise<void>;
|
|
193
|
-
export declare function buildSessionRecoveryCommand(session: Pick<SessionMeta, 'id'>, portable?: boolean): string[];
|
|
194
|
-
export declare function resumeSpawnInvocation(cmd: string[], platform?: NodeJS.Platform): {
|
|
195
|
-
command: string;
|
|
196
|
-
args: string[];
|
|
197
|
-
shell: boolean;
|
|
198
|
-
};
|
|
199
|
-
export declare function buildResumeCommand(session: SessionMeta): string[] | null;
|
|
200
|
-
interface AgentFilter {
|
|
201
|
-
agent?: SessionAgentId;
|
|
202
|
-
version?: string;
|
|
203
|
-
}
|
|
204
|
-
export declare function resolveSessionAgentName(name: string): SessionAgentId | null;
|
|
205
|
-
export declare function parseAgentFilter(agentName?: string): AgentFilter;
|
|
206
|
-
type SessionSearchScope = {
|
|
207
|
-
agent?: string;
|
|
208
|
-
project?: string;
|
|
209
|
-
routine?: boolean | string;
|
|
210
|
-
};
|
|
211
|
-
interface SessionQueryResolution {
|
|
212
|
-
matches: SessionMeta[];
|
|
213
|
-
byId: boolean;
|
|
214
|
-
completeId: boolean;
|
|
215
|
-
}
|
|
216
|
-
export declare function resolveSessionQuery(pool: SessionMeta[], query: string, options?: {
|
|
217
|
-
indexFallback?: boolean;
|
|
218
|
-
scope?: SessionSearchScope;
|
|
219
|
-
}): SessionQueryResolution;
|
|
220
114
|
export declare function fleetNotFoundMessage(query: string, deviceCount: number, unreachable: string[]): string[];
|
|
221
|
-
export declare function filterSessionsByQuery(sessions: SessionMeta[], query: string | undefined, scope?: SessionSearchScope): SessionMeta[];
|
|
222
|
-
export declare function applyScopeFilters(sessions: SessionMeta[], scope: SessionSearchScope): SessionMeta[];
|
|
223
115
|
export declare function artifactLookupScope(agent?: string, project?: string, routine?: boolean | string): SessionSearchScope;
|
|
224
|
-
interface FleetResolveDeps {
|
|
225
|
-
gatherRemoteList: typeof gatherRemoteList;
|
|
226
|
-
runOnPeer: typeof runOnPeer;
|
|
227
|
-
}
|
|
228
|
-
interface FleetHit {
|
|
229
|
-
machine: string;
|
|
230
|
-
session: SessionMeta;
|
|
231
|
-
}
|
|
232
|
-
interface FleetSessionCandidate {
|
|
233
|
-
id: string;
|
|
234
|
-
hits: FleetHit[];
|
|
235
|
-
}
|
|
236
|
-
type MetadataResolveOutcome = {
|
|
237
|
-
kind: 'resolved';
|
|
238
|
-
session: SessionMeta;
|
|
239
|
-
} | {
|
|
240
|
-
kind: 'not-found';
|
|
241
|
-
} | {
|
|
242
|
-
kind: 'ambiguous';
|
|
243
|
-
candidates: FleetSessionCandidate[];
|
|
244
|
-
} | {
|
|
245
|
-
kind: 'partial';
|
|
246
|
-
failedPeers: string[];
|
|
247
|
-
};
|
|
248
|
-
export declare function isDefinitiveMatch(session: SessionMeta, selector: string): boolean;
|
|
249
|
-
export declare function selectorAllowsEarlyExit(selector: string): boolean;
|
|
250
|
-
export declare function fleetCandidatesByQuery(rows: SessionMeta[], query: string, trustResolvedRows?: boolean): FleetSessionCandidate[];
|
|
251
|
-
export declare function metadataResolveForwardedArgs(selector: string, scope: Pick<SessionFilterOptions, 'agent' | 'project'>): string[];
|
|
252
|
-
export declare function isUniqueEnoughSelector(selector: string): boolean;
|
|
253
|
-
export declare function metadataResolveOutcome(localMatches: SessionMeta[], remote: {
|
|
254
|
-
sessions: SessionMeta[];
|
|
255
|
-
unreachable: string[];
|
|
256
|
-
}, selector: string): MetadataResolveOutcome;
|
|
257
|
-
export declare function isLocallyDefinitiveMatch(session: SessionMeta, self: string): boolean;
|
|
258
|
-
export declare function preferOwnerAttribution(localMatches: SessionMeta[], remoteSessions: SessionMeta[], self: string): SessionMeta[];
|
|
259
|
-
type LiveMetadataDeps = {
|
|
260
|
-
loadActive?: typeof loadLocalActiveSessions;
|
|
261
|
-
loadFleetActive?: () => ActiveSession[];
|
|
262
|
-
};
|
|
263
|
-
export declare function computeLocalMetadataMatches(selector: string, scope: {
|
|
264
|
-
agent?: string;
|
|
265
|
-
project?: string;
|
|
266
|
-
local?: boolean;
|
|
267
|
-
hosts?: string[];
|
|
268
|
-
}, deps?: LiveMetadataDeps): Promise<SessionMeta[]>;
|
|
269
|
-
export declare function liveMetadataMatches(selector: string, scope: {
|
|
270
|
-
agent?: string;
|
|
271
|
-
project?: string;
|
|
272
|
-
}, self: string, deps?: LiveMetadataDeps): Promise<SessionMeta[]>;
|
|
273
|
-
export declare function resolveSessionMetadataValue(selector: string, scope?: {
|
|
274
|
-
agent?: string;
|
|
275
|
-
project?: string;
|
|
276
|
-
local?: boolean;
|
|
277
|
-
hosts?: string[];
|
|
278
|
-
}, deps?: Pick<FleetResolveDeps, 'gatherRemoteList'> & LiveMetadataDeps): Promise<MetadataResolveOutcome>;
|
|
279
116
|
export declare function resolveSessionMetadata(selector: string, scope: {
|
|
280
117
|
agent?: string;
|
|
281
118
|
project?: string;
|