@phnx-labs/agents-cli 1.23.14 → 1.23.16
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 +22 -0
- package/dist/lib/session/active.js +7 -1
- package/dist/lib/session/db.d.ts +1 -1
- package/dist/lib/session/db.js +1 -1
- package/dist/lib/session/discover.d.ts +3 -1
- package/dist/lib/session/discover.js +14 -7
- package/dist/lib/session/remote/watch.js +2 -1
- package/dist/lib/teams/placement-probe.d.ts +9 -0
- package/dist/lib/teams/placement-probe.js +20 -15
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.16
|
|
4
|
+
|
|
5
|
+
- **Every harness's session row on `agents feed watch --json` now carries
|
|
6
|
+
`model` (PHNX-4330).** Grok, Droid, OpenCode and Cursor rows never had one,
|
|
7
|
+
and most history rows lost it. `@phnx-labs/sessions-cli` 0.8.4 reads the
|
|
8
|
+
model each transcript records (Grok `model_id`, Droid `modelId` or its
|
|
9
|
+
`settings.json`, OpenCode `modelID`, Kimi `llm.request`, Cursor's chat
|
|
10
|
+
`store.db`). History rows now fall back to the indexed `model` when the
|
|
11
|
+
timeline pass never folded the session, and the Grok, Kimi and Cursor indexers
|
|
12
|
+
fill it (a one-time reindex picks up rows already on disk). A live turn longer
|
|
13
|
+
than the 80-event state window keeps its model, carried from the
|
|
14
|
+
already-parsed prefix with no extra reads.
|
|
15
|
+
|
|
16
|
+
## 1.23.15
|
|
17
|
+
|
|
18
|
+
- **`--device auto` no longer refuses every worker when the load probe times out.** The
|
|
19
|
+
2.5 s load/memory probe could time out on every worker at once during a brief stall on
|
|
20
|
+
the launching machine, and placement then failed with `no healthy device ... (probe
|
|
21
|
+
timed out)` even though each worker had just answered the sign-in probe. A worker that
|
|
22
|
+
answers the sign-in probe now counts as reachable; only its load is reported as
|
|
23
|
+
unknown. Source: `cli/src/lib/teams/placement-probe.ts`.
|
|
24
|
+
|
|
3
25
|
## 1.23.14
|
|
4
26
|
|
|
5
27
|
- **Removed dead and duplicate commands (PHNX-4227, owner decision 2026-10-11).**
|
|
@@ -522,7 +522,13 @@ function parseTailEventsForKind(agent, sessionFile) {
|
|
|
522
522
|
catch {
|
|
523
523
|
return [];
|
|
524
524
|
}
|
|
525
|
-
|
|
525
|
+
if (events.length <= LIVE_STATE_MAX_EVENTS)
|
|
526
|
+
return events;
|
|
527
|
+
const cut = events.length - LIVE_STATE_MAX_EVENTS;
|
|
528
|
+
let modelAt = events.length - 1;
|
|
529
|
+
while (modelAt >= 0 && !(events[modelAt].type === 'init' && events[modelAt].model))
|
|
530
|
+
modelAt--;
|
|
531
|
+
return modelAt >= 0 && modelAt < cut ? [events[modelAt], ...events.slice(cut)] : events.slice(cut);
|
|
526
532
|
}
|
|
527
533
|
const LIVE_TAIL_CACHE_MAX = 512;
|
|
528
534
|
const liveTailCache = new Map();
|
package/dist/lib/session/db.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type IndexedToolCall } from '@phnx-labs/sessions-cli/reader';
|
|
|
4
4
|
import { type ToolScanResumePoint } from './tool-store.js';
|
|
5
5
|
import { type TimelineState } from '@phnx-labs/sessions-cli/reader';
|
|
6
6
|
export declare const SCHEMA_VERSION = 52;
|
|
7
|
-
export declare const CONTENT_INDEX_VERSION =
|
|
7
|
+
export declare const CONTENT_INDEX_VERSION = 7;
|
|
8
8
|
export declare const INSIGHTS_EXTRACTOR_VERSION = 7;
|
|
9
9
|
export declare const SESSION_TOPIC_EXTRACTOR_VERSION = 2;
|
|
10
10
|
export declare const SESSION_PHENOTYPE_EXTRACTOR_VERSION = 1;
|
package/dist/lib/session/db.js
CHANGED
|
@@ -19,7 +19,7 @@ import { emptyTimelineState, TIMELINE_EXTRACTOR_VERSION } from '@phnx-labs/sessi
|
|
|
19
19
|
const SESSIONS_DIR = getSessionsDir();
|
|
20
20
|
const DB_PATH = getSessionsDbPath();
|
|
21
21
|
export const SCHEMA_VERSION = 52;
|
|
22
|
-
export const CONTENT_INDEX_VERSION =
|
|
22
|
+
export const CONTENT_INDEX_VERSION = 7;
|
|
23
23
|
const RESOURCE_INDEX_VERSION = 2;
|
|
24
24
|
function canonicalLedgerKey(filePath) {
|
|
25
25
|
if (!filePath)
|
|
@@ -376,17 +376,19 @@ export declare function readKimiMeta(filePath: string, priorRow?: {
|
|
|
376
376
|
parserState?: string;
|
|
377
377
|
} | null;
|
|
378
378
|
export interface KimiParserState {
|
|
379
|
-
v:
|
|
379
|
+
v: 3;
|
|
380
380
|
offset: number;
|
|
381
381
|
messageCount: number;
|
|
382
382
|
tokenCount: number;
|
|
383
383
|
outputTokens: number;
|
|
384
384
|
firstUserMessage?: string;
|
|
385
|
+
model?: string;
|
|
385
386
|
}
|
|
386
387
|
export declare function parseKimiWireMetricsIncremental(sessionDir: string, prior: KimiParserState | null): {
|
|
387
388
|
messageCount: number;
|
|
388
389
|
tokenCount: number;
|
|
389
390
|
outputTokens: number;
|
|
391
|
+
model?: string;
|
|
390
392
|
newState: KimiParserState;
|
|
391
393
|
};
|
|
392
394
|
export declare function readGrokMeta(filePath: string, currentVersion?: string): {
|
|
@@ -3364,6 +3364,7 @@ export function readCursorMeta(filePath, currentVersion) {
|
|
|
3364
3364
|
label: title,
|
|
3365
3365
|
messageCount: events.filter((event) => event.type === 'message').length,
|
|
3366
3366
|
todos: extractTodoProgressFromEvents(events),
|
|
3367
|
+
model: events.filter((event) => event.type === 'init' && event.model).pop()?.model,
|
|
3367
3368
|
};
|
|
3368
3369
|
return { meta, content: userTexts.join('\n'), assistantContent: assistantTexts.join('\n'), events };
|
|
3369
3370
|
}
|
|
@@ -3460,7 +3461,7 @@ export function readKimiMeta(filePath, priorRow) {
|
|
|
3460
3461
|
}
|
|
3461
3462
|
}
|
|
3462
3463
|
const prior = parsePriorKimiState(priorRow);
|
|
3463
|
-
const { messageCount, tokenCount, outputTokens, newState } = parseKimiWireMetricsIncremental(sessionDir, prior);
|
|
3464
|
+
const { messageCount, tokenCount, outputTokens, model, newState } = parseKimiWireMetricsIncremental(sessionDir, prior);
|
|
3464
3465
|
const meta = {
|
|
3465
3466
|
id: sessionId,
|
|
3466
3467
|
shortId,
|
|
@@ -3473,6 +3474,7 @@ export function readKimiMeta(filePath, priorRow) {
|
|
|
3473
3474
|
messageCount,
|
|
3474
3475
|
tokenCount: tokenCount > 0 ? tokenCount : undefined,
|
|
3475
3476
|
outputTokens: outputTokens > 0 ? outputTokens : undefined,
|
|
3477
|
+
model,
|
|
3476
3478
|
};
|
|
3477
3479
|
return { meta, content: lastPrompt || '', parserState: JSON.stringify(newState) };
|
|
3478
3480
|
}
|
|
@@ -3488,7 +3490,10 @@ function kimiWireUserText(event) {
|
|
|
3488
3490
|
return cleanFirstUserMessage(raw);
|
|
3489
3491
|
}
|
|
3490
3492
|
function applyKimiWireEvent(acc, event) {
|
|
3491
|
-
if (event.type === '
|
|
3493
|
+
if (event.type === 'llm.request' && typeof (event.modelAlias || event.model) === 'string') {
|
|
3494
|
+
acc.model = event.modelAlias || event.model;
|
|
3495
|
+
}
|
|
3496
|
+
else if (event.type === 'context.append_message') {
|
|
3492
3497
|
acc.messageCount++;
|
|
3493
3498
|
if (!acc.firstUserMessage)
|
|
3494
3499
|
acc.firstUserMessage = kimiWireUserText(event);
|
|
@@ -3503,13 +3508,13 @@ export function parseKimiWireMetricsIncremental(sessionDir, prior) {
|
|
|
3503
3508
|
const wirePath = path.join(sessionDir, 'agents', 'main', 'wire.jsonl');
|
|
3504
3509
|
const stat = safeStatSync(wirePath);
|
|
3505
3510
|
if (!stat) {
|
|
3506
|
-
return { messageCount: 0, tokenCount: 0, outputTokens: 0, newState: { v:
|
|
3511
|
+
return { messageCount: 0, tokenCount: 0, outputTokens: 0, newState: { v: 3, offset: 0, messageCount: 0, tokenCount: 0, outputTokens: 0 } };
|
|
3507
3512
|
}
|
|
3508
3513
|
const canIncrement = prior !== null && stat.size > prior.offset;
|
|
3509
3514
|
const fromOffset = canIncrement ? prior.offset : 0;
|
|
3510
3515
|
const acc = canIncrement
|
|
3511
|
-
? { messageCount: prior.messageCount, tokenCount: prior.tokenCount, outputTokens: prior.outputTokens, firstUserMessage: prior.firstUserMessage }
|
|
3512
|
-
: { messageCount: 0, tokenCount: 0, outputTokens: 0, firstUserMessage: undefined };
|
|
3516
|
+
? { messageCount: prior.messageCount, tokenCount: prior.tokenCount, outputTokens: prior.outputTokens, firstUserMessage: prior.firstUserMessage, model: prior.model }
|
|
3517
|
+
: { messageCount: 0, tokenCount: 0, outputTokens: 0, firstUserMessage: undefined, model: undefined };
|
|
3513
3518
|
let consumedBytes = 0;
|
|
3514
3519
|
let fd;
|
|
3515
3520
|
try {
|
|
@@ -3554,7 +3559,8 @@ export function parseKimiWireMetricsIncremental(sessionDir, prior) {
|
|
|
3554
3559
|
messageCount: acc.messageCount,
|
|
3555
3560
|
tokenCount: acc.tokenCount,
|
|
3556
3561
|
outputTokens: acc.outputTokens,
|
|
3557
|
-
|
|
3562
|
+
model: acc.model,
|
|
3563
|
+
newState: { v: 3, offset: fromOffset + consumedBytes, messageCount: acc.messageCount, tokenCount: acc.tokenCount, outputTokens: acc.outputTokens, firstUserMessage: acc.firstUserMessage, model: acc.model },
|
|
3558
3564
|
};
|
|
3559
3565
|
}
|
|
3560
3566
|
function parsePriorKimiState(row) {
|
|
@@ -3562,7 +3568,7 @@ function parsePriorKimiState(row) {
|
|
|
3562
3568
|
return null;
|
|
3563
3569
|
try {
|
|
3564
3570
|
const parsed = JSON.parse(row.parserState);
|
|
3565
|
-
if (parsed?.v !==
|
|
3571
|
+
if (parsed?.v !== 3 || typeof parsed.offset !== 'number')
|
|
3566
3572
|
return null;
|
|
3567
3573
|
return parsed;
|
|
3568
3574
|
}
|
|
@@ -3740,6 +3746,7 @@ export function readGrokMeta(filePath, currentVersion) {
|
|
|
3740
3746
|
topic,
|
|
3741
3747
|
firstUserMessage: readGrokFirstUserMessage(sessionDir),
|
|
3742
3748
|
messageCount,
|
|
3749
|
+
model: typeof summary?.current_model_id === 'string' && summary.current_model_id ? summary.current_model_id : undefined,
|
|
3743
3750
|
};
|
|
3744
3751
|
return { meta, content: topic || '' };
|
|
3745
3752
|
}
|
|
@@ -74,6 +74,7 @@ export function toPreviousSessionWatchRow(scope, session, accounts = listNativeA
|
|
|
74
74
|
}
|
|
75
75
|
: readSessionSummaryAny(session.id);
|
|
76
76
|
const folded = readSessionTimelineAny(session.id);
|
|
77
|
+
const model = folded?.model ?? session.model;
|
|
77
78
|
const title = previousRowTitle(session, folded?.request?.headline);
|
|
78
79
|
return {
|
|
79
80
|
context: 'recent',
|
|
@@ -107,7 +108,7 @@ export function toPreviousSessionWatchRow(scope, session, accounts = listNativeA
|
|
|
107
108
|
...(folded?.request ? { request: folded.request } : {}),
|
|
108
109
|
...(folded?.timeline ? { timeline: folded.timeline } : {}),
|
|
109
110
|
...(folded?.files ? { files: folded.files } : {}),
|
|
110
|
-
...(
|
|
111
|
+
...(model ? { model } : {}),
|
|
111
112
|
...(folded?.failures ? { failures: folded.failures } : {}),
|
|
112
113
|
...(folded?.activityHistogram ? { activityHistogram: folded.activityHistogram } : {}),
|
|
113
114
|
...(folded?.userTurns ? { userTurns: folded.userTurns } : {}),
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { type DeviceStats } from '../devices/health.js';
|
|
1
2
|
import { type AgentType } from './agents.js';
|
|
2
3
|
import type { DevicePlacementSignal } from './scheduler.js';
|
|
3
4
|
export declare const READY_PROBE_TIMEOUT_MS = 8000;
|
|
4
5
|
export declare const SIGNAL_TTL_MS = 15000;
|
|
5
6
|
export declare function clearPlacementSignalCache(): void;
|
|
7
|
+
interface ReadinessInfo {
|
|
8
|
+
answered: boolean;
|
|
9
|
+
installed: boolean | undefined;
|
|
10
|
+
signedIn: boolean | undefined;
|
|
11
|
+
pickerEligible: boolean | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function mergePlacementSignal(stats: DeviceStats | undefined, readiness: ReadinessInfo | undefined): DevicePlacementSignal;
|
|
6
14
|
export declare function probePoolSignals(pool: string[], agent?: AgentType, opts?: {
|
|
7
15
|
force?: boolean;
|
|
8
16
|
now?: number;
|
|
9
17
|
}): Promise<Map<string, DevicePlacementSignal>>;
|
|
18
|
+
export {};
|
|
@@ -18,7 +18,7 @@ export function clearPlacementSignalCache() {
|
|
|
18
18
|
cache.clear();
|
|
19
19
|
}
|
|
20
20
|
function probeRemoteReadiness(device, agent, usagePayload) {
|
|
21
|
-
const unknown = { installed: undefined, signedIn: undefined, pickerEligible: undefined };
|
|
21
|
+
const unknown = { answered: false, installed: undefined, signedIn: undefined, pickerEligible: undefined };
|
|
22
22
|
let args;
|
|
23
23
|
let env;
|
|
24
24
|
try {
|
|
@@ -60,17 +60,30 @@ function probeRemoteReadiness(device, agent, usagePayload) {
|
|
|
60
60
|
if (!probe.reachable)
|
|
61
61
|
return finish(unknown);
|
|
62
62
|
if (!probe.version)
|
|
63
|
-
return finish({ installed: false, signedIn: false, pickerEligible: false });
|
|
63
|
+
return finish({ answered: true, installed: false, signedIn: false, pickerEligible: false });
|
|
64
64
|
const installed = viewHasAgent(probe.view, agent);
|
|
65
65
|
const eligibility = installed
|
|
66
66
|
? viewAgentAccountEligibility(probe.view, agent)
|
|
67
67
|
: { signedIn: false, pickerEligible: false };
|
|
68
|
-
finish({ installed, ...eligibility });
|
|
68
|
+
finish({ answered: true, installed, ...eligibility });
|
|
69
69
|
});
|
|
70
70
|
child.stdin.on('error', () => { });
|
|
71
71
|
child.stdin.end(usagePayload);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
+
export function mergePlacementSignal(stats, readiness) {
|
|
75
|
+
const reachable = readiness?.answered === true ? true : stats?.reachable;
|
|
76
|
+
return {
|
|
77
|
+
reachable,
|
|
78
|
+
timedOut: reachable === true ? undefined : stats?.timedOut,
|
|
79
|
+
headroom: stats ? headroom(stats) : undefined,
|
|
80
|
+
loadPercent: stats?.loadPercent,
|
|
81
|
+
memPercent: stats?.memPercent,
|
|
82
|
+
installed: readiness?.installed,
|
|
83
|
+
signedIn: readiness?.signedIn,
|
|
84
|
+
pickerEligible: readiness?.pickerEligible,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
74
87
|
export async function probePoolSignals(pool, agent, opts = {}) {
|
|
75
88
|
const now = opts.now ?? Date.now();
|
|
76
89
|
const key = cacheKey(pool, agent);
|
|
@@ -98,13 +111,14 @@ export async function probePoolSignals(pool, agent, opts = {}) {
|
|
|
98
111
|
if (isSelf) {
|
|
99
112
|
const inst = checkCliAvailable(agent)[0];
|
|
100
113
|
if (!inst)
|
|
101
|
-
return [d.name, { installed: false, signedIn: false, pickerEligible: false }];
|
|
114
|
+
return [d.name, { answered: true, installed: false, signedIn: false, pickerEligible: false }];
|
|
102
115
|
const candidates = await collectRunCandidates(agent).catch(() => null);
|
|
103
116
|
if (!candidates) {
|
|
104
|
-
return [d.name, { installed: true, signedIn: undefined, pickerEligible: undefined }];
|
|
117
|
+
return [d.name, { answered: true, installed: true, signedIn: undefined, pickerEligible: undefined }];
|
|
105
118
|
}
|
|
106
119
|
const readiness = candidates.map((candidate) => readinessFromCandidate(candidate));
|
|
107
120
|
return [d.name, {
|
|
121
|
+
answered: true,
|
|
108
122
|
installed: true,
|
|
109
123
|
signedIn: readiness.some((candidate) => candidate.ready),
|
|
110
124
|
pickerEligible: readiness.some((candidate) => candidate.ready || isSignInRecoverable(candidate)),
|
|
@@ -120,16 +134,7 @@ export async function probePoolSignals(pool, agent, opts = {}) {
|
|
|
120
134
|
const inst = d ? installed.get(d.name) : undefined;
|
|
121
135
|
if (!s && !inst)
|
|
122
136
|
continue;
|
|
123
|
-
signals.set(name,
|
|
124
|
-
reachable: s?.reachable,
|
|
125
|
-
timedOut: s?.timedOut,
|
|
126
|
-
headroom: s ? headroom(s) : undefined,
|
|
127
|
-
loadPercent: s?.loadPercent,
|
|
128
|
-
memPercent: s?.memPercent,
|
|
129
|
-
installed: inst?.installed,
|
|
130
|
-
signedIn: inst?.signedIn,
|
|
131
|
-
pickerEligible: inst?.pickerEligible,
|
|
132
|
-
});
|
|
137
|
+
signals.set(name, mergePlacementSignal(s, inst));
|
|
133
138
|
}
|
|
134
139
|
cache.set(key, { at: now, signals });
|
|
135
140
|
return signals;
|
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.16",
|
|
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",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@fontsource/inter": "^5.3.0",
|
|
89
89
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
90
90
|
"@inquirer/prompts": "8.5.2",
|
|
91
|
-
"@phnx-labs/sessions-cli": "0.8.
|
|
91
|
+
"@phnx-labs/sessions-cli": "0.8.4",
|
|
92
92
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
93
93
|
"@types/proper-lockfile": "4.1.4",
|
|
94
94
|
"@zed-industries/agent-client-protocol": "0.4.5",
|