@phnx-labs/agents-cli 1.23.34 → 1.23.35

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,8 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.35
4
+
5
+ - **A row's PR is one the session created, and its Made list shows rendered pages.** A
6
+ `grep 'gh pr create'` whose output held a pull URL made that URL the session's `pr`
7
+ (a plan's `acme/widget/pull/12` example became a PR chip). A create now counts only
8
+ when the command itself runs `gh pr create` (sessions-cli 0.8.10), and schema v54
9
+ re-parses every session that has a PR so a wrong one clears. A live row's artifacts
10
+ now come from every file the session wrote under an agent output folder (created or
11
+ edited, `~/.local/share/agents/artifacts/` included), each shown as its rendered page
12
+ when one sits beside it: `plan.md` and `pr-reviewer.md` read as `plan.html` and
13
+ `pr-reviewer.html`. Source: `cli/src/lib/session/session-cache.ts`, `cli/src/lib/session/db.ts`.
14
+
3
15
  ## 1.23.34
4
16
 
5
- - **A session row says whether its last turn was done, and a finished turn posts a banner.** Live rows on `agents ps --json`, `agents ps watch --json` and `agents feed watch --json` (remote rows too) carry `doneVerdict: { state: 'done'|'open'|'unchecked', gaps, at }` from the Stop hook's verdict in `~/.agents/.cache/state/sessions/<pid>.json`, only when that record belongs to the row's live process. Off by default, an interactive session going from running to idle after at least 2 minutes of work can post one AGI Menu `done` banner: "✓ Done", "Not done" or "Finished" with the row's title, the verdict's gaps in words when it is open or else the first sentence of the agent's last line, and a tap opens the session. One banner per turn; three or more finishes that land together post one summary banner. The `menubar.menu.notifyLow` schedule governs it: its default `["sidebar"]` posts none, and `agents config set menubar.menu.notifyLow '["0m"]'` turns it on (low-urgency asks follow the same key). Source: cli/src/lib/session/hook-sessions.ts, cli/src/lib/session/active.ts, cli/src/lib/daemon/finished-banners.ts, cli/src/lib/daemon/attention-notify-service.ts
17
+ - **A session row says whether its last turn was done; a finished-turn banner is available, off by default.** Live rows on `agents ps --json`, `agents ps watch --json` and `agents feed watch --json` (remote rows too) carry `doneVerdict: { state: 'done'|'open'|'unchecked', gaps, at }` from the Stop hook's verdict in `~/.agents/.cache/state/sessions/<pid>.json`, only when that record belongs to the row's live process. Off by default, an interactive session going from running to idle after at least 2 minutes of work can post one AGI Menu `done` banner: "✓ Done", "Not done" or "Finished" with the row's title, the verdict's gaps in words when it is open or else the first sentence of the agent's last line, and a tap opens the session. One banner per turn; three or more finishes that land together post one summary banner. The `menubar.menu.notifyLow` schedule governs it: its default `["sidebar"]` posts none, and `agents config set menubar.menu.notifyLow '["0m"]'` turns it on (low-urgency asks follow the same key). Source: cli/src/lib/session/hook-sessions.ts, cli/src/lib/session/active.ts, cli/src/lib/daemon/finished-banners.ts, cli/src/lib/daemon/attention-notify-service.ts
6
18
 
7
19
  ## 1.23.33
8
20
 
@@ -5,7 +5,7 @@ import type { TouchedPr, TouchedTicket } from './touched.js';
5
5
  import { type IndexedToolCall } from '@phnx-labs/sessions-cli/reader';
6
6
  import { type ToolScanResumePoint } from './tool-store.js';
7
7
  import { type TimelineState } from '@phnx-labs/sessions-cli/reader';
8
- export declare const SCHEMA_VERSION = 53;
8
+ export declare const SCHEMA_VERSION = 54;
9
9
  export declare const CONTENT_INDEX_VERSION = 8;
10
10
  export declare const INSIGHTS_EXTRACTOR_VERSION = 7;
11
11
  export declare const SESSION_SUMMARY_EXTRACTOR_VERSION = 1;
@@ -18,7 +18,7 @@ import { firstUserMessageFromEvents, lastUserMessageFromEvents } from '@phnx-lab
18
18
  import { emptyTimelineState, TIMELINE_EXTRACTOR_VERSION } from '@phnx-labs/sessions-cli/reader';
19
19
  const SESSIONS_DIR = getSessionsDir();
20
20
  const DB_PATH = getSessionsDbPath();
21
- export const SCHEMA_VERSION = 53;
21
+ export const SCHEMA_VERSION = 54;
22
22
  export const CONTENT_INDEX_VERSION = 8;
23
23
  const RESOURCE_INDEX_VERSION = 2;
24
24
  function canonicalLedgerKey(filePath) {
@@ -1036,11 +1036,16 @@ function migrateSchema(db, fromVersion) {
1036
1036
  const cols = db.prepare(`PRAGMA table_info(sessions)`).all();
1037
1037
  if (!cols.some(c => c.name === 'pr_urls'))
1038
1038
  db.exec(`ALTER TABLE sessions ADD COLUMN pr_urls TEXT`);
1039
- const withPr = db.prepare(`SELECT file_path FROM sessions WHERE pr_url IS NOT NULL AND file_path IS NOT NULL`).all();
1040
- const dropLedger = db.prepare(`DELETE FROM scan_ledger WHERE file_path = ?`);
1041
- for (const { file_path } of withPr)
1042
- dropLedger.run(canonicalLedgerKey(file_path));
1043
1039
  }
1040
+ if (fromVersion < 54)
1041
+ reparseSessionsWithPr(db);
1042
+ }
1043
+ function reparseSessionsWithPr(db) {
1044
+ const withPr = db.prepare(`SELECT file_path FROM sessions WHERE pr_url IS NOT NULL AND file_path IS NOT NULL AND mirror_synced_at IS NULL`).all();
1045
+ const dropLedger = db.prepare(`DELETE FROM scan_ledger WHERE file_path = ?`);
1046
+ for (const { file_path } of withPr)
1047
+ dropLedger.run(canonicalLedgerKey(file_path));
1048
+ db.exec(`UPDATE sessions SET pr_url = NULL, pr_urls = NULL, pr_number = NULL WHERE mirror_synced_at IS NOT NULL AND pr_url IS NOT NULL`);
1044
1049
  }
1045
1050
  function backfillClaudeAccounts(db, scope = 'all') {
1046
1051
  const where = scope === 'all'
@@ -67,7 +67,7 @@ export declare function stripLiveStatusKeys<T extends Record<string, unknown>>(f
67
67
  export declare function assertNoLiveStatusFields(fields: Record<string, unknown>): boolean;
68
68
  export declare function updateImmutableMemos(sessions: ReadonlyArray<ActiveSession>, nowMs?: number): void;
69
69
  export declare function resolveStreamSummaryState(current: import('@phnx-labs/sessions-cli/reader').SummaryState | undefined, nowMs?: number): import('@phnx-labs/sessions-cli/reader').SummaryState;
70
- export declare function withCreatedArtifacts(s: ActiveSession): ActiveSession;
70
+ export declare function withProducedArtifacts(s: ActiveSession): ActiveSession;
71
71
  export declare function mergeSessionTimeline(s: ActiveSession): ActiveSession;
72
72
  export declare function applyImmutableMemo(s: ActiveSession): ActiveSession;
73
73
  interface LoadLocalActiveSessionsOptions {
@@ -4,7 +4,7 @@ import * as path from 'path';
4
4
  import { createMemoryCache } from '../memory-cache.js';
5
5
  import { getCacheDir } from '../state.js';
6
6
  import { artifactKind, backfillActiveRowsFromIndex, foldRecap, sessionProcessIsLocal } from './active.js';
7
- import { extractArtifacts, mergeArtifacts } from '@phnx-labs/sessions-cli/reader';
7
+ import { extractArtifacts, mergeArtifacts, reviewedArtifacts } from '@phnx-labs/sessions-cli/reader';
8
8
  import { enrichGlanceFiles } from './glance-files.js';
9
9
  import { enrichLiveWork } from './pending-work.js';
10
10
  import { readSessionSummaryAny, readSessionTimelineAny } from './db.js';
@@ -72,6 +72,7 @@ export const LIVE_STATUS_KEYS = [
72
72
  'rateLimited',
73
73
  'plan',
74
74
  ];
75
+ const IMMUTABLE_MEMO_VERSION = 2;
75
76
  export const ACTIVE_SESSIONS_READER_IDLE_WINDOW_MS = 45_000;
76
77
  let snapshotPathOverride = null;
77
78
  let immutablePathOverride = null;
@@ -238,13 +239,13 @@ export function transcriptMtimeMs(s) {
238
239
  function readImmutableFile() {
239
240
  try {
240
241
  const parsed = JSON.parse(fs.readFileSync(immutablePath(), 'utf-8'));
241
- if (parsed && parsed.version === 1 && parsed.entries && typeof parsed.entries === 'object') {
242
+ if (parsed && parsed.version === IMMUTABLE_MEMO_VERSION && parsed.entries && typeof parsed.entries === 'object') {
242
243
  return parsed;
243
244
  }
244
245
  }
245
246
  catch {
246
247
  }
247
- return { version: 1, entries: {} };
248
+ return { version: IMMUTABLE_MEMO_VERSION, entries: {} };
248
249
  }
249
250
  export function readImmutableMemo(sessionId, mtimeMs) {
250
251
  if (!sessionId || !Number.isFinite(mtimeMs))
@@ -326,11 +327,12 @@ export function resolveStreamSummaryState(current, nowMs = Date.now()) {
326
327
  return current;
327
328
  return isSummarizerReady(nowMs) ? 'pending' : 'skipped';
328
329
  }
329
- export function withCreatedArtifacts(s) {
330
- const created = (s.files?.changes ?? [])
331
- .filter((c) => c.op === 'created')
330
+ export function withProducedArtifacts(s) {
331
+ const written = (s.files?.changes ?? [])
332
+ .filter((c) => c.op !== 'deleted')
332
333
  .map((c) => ({ path: path.isAbsolute(c.path) || !s.cwd ? c.path : path.resolve(s.cwd, c.path), op: c.op }));
333
- const merged = created.length > 0 ? mergeArtifacts(extractArtifacts(created), s.artifacts ?? []) : (s.artifacts ?? []);
334
+ const produced = written.length > 0 ? reviewedArtifacts(extractArtifacts(written)) : [];
335
+ const merged = produced.length > 0 ? mergeArtifacts(produced, s.artifacts ?? []) : (s.artifacts ?? []);
334
336
  if (merged.length > 0)
335
337
  s.artifacts = merged.map((a) => ({ ...a, kind: artifactKind(a.path) }));
336
338
  return s;
@@ -364,7 +366,7 @@ export function mergeSessionTimeline(s) {
364
366
  return s;
365
367
  }
366
368
  export function applyImmutableMemo(s) {
367
- return withCreatedArtifacts(applyStoredFields(s));
369
+ return withProducedArtifacts(applyStoredFields(s));
368
370
  }
369
371
  function applyStoredFields(s) {
370
372
  if (!s.sessionId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.23.34",
3
+ "version": "1.23.35",
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",
@@ -89,7 +89,7 @@
89
89
  "@fontsource/jetbrains-mono": "^5.3.0",
90
90
  "@inquirer/prompts": "8.5.2",
91
91
  "@phnx-labs/secrets-cli": "0.4.0",
92
- "@phnx-labs/sessions-cli": "0.8.9",
92
+ "@phnx-labs/sessions-cli": "0.8.10",
93
93
  "@resvg/resvg-wasm": "^2.6.2",
94
94
  "@types/proper-lockfile": "4.1.4",
95
95
  "@zed-industries/agent-client-protocol": "0.4.5",