praxis-agent 0.20.21 → 0.20.22

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.
@@ -11,7 +11,7 @@ import { permissionRuleValueToString } from '../permissions/permission-updates.j
11
11
  import { AgentRunCancelledError } from '../core/runtime.js';
12
12
  import { claudePermissionActionKey, claudePermissionRuleMatches, } from '../permissions/claude-permission-resolver.js';
13
13
  import { redactSensitiveText, sensitiveEnvironmentValues, } from '../platform/sensitive-data.js';
14
- import { CommandPalette, BtwPanel, Composer, DiffDashboard, DialogFrame, ExternalEditorWait, HelpMenu, HookDashboard, ListDashboard, MemoryDashboard, MentionPicker, ModelMenu, PermissionDashboard, SelectionMenu, SessionPicker, ThemePicker, CustomThemeEditor, Transcript, WelcomePanel, useTerminalRows, useTerminalWidth, } from './tui/claude-style.js';
14
+ import { CommandPalette, BtwPanel, Composer, DiffDashboard, DialogFrame, ExternalEditorWait, HelpMenu, HookDashboard, ListDashboard, MemoryDashboard, MentionPicker, ModelMenu, PermissionDashboard, SelectionMenu, SessionPicker, ThemePicker, CustomThemeEditor, SessionIdentity, Transcript, WelcomePanel, useTerminalRows, useTerminalWidth, } from './tui/claude-style.js';
15
15
  import { loadTuiMemoryFiles, openTuiMemoryFolder, } from './tui/memory-files.js';
16
16
  import { loadClaudeReleaseNotes } from './tui/release-notes.js';
17
17
  import { createClaudeStatusLineInput, StatusLine } from './tui/status-line.js';
@@ -417,9 +417,21 @@ export function InteractiveApp({ factory, initialSessions, initialPrompt, initia
417
417
  const [history, setHistory] = useState([...initialHistory]);
418
418
  // Startup diagnostics are useful before the first prompt, but they are not
419
419
  // conversation history and must not suppress the new-session welcome panel.
420
- const hasConversationHistory = history.some((item) => item.kind !== 'notice' &&
421
- item.kind !== 'warning' &&
422
- item.kind !== 'local-result');
420
+ // Only real user/assistant transcript entries start a conversation; every
421
+ // other kind (thinking, context, tool, shell, notices, results, and so on)
422
+ // is operational bookkeeping that must not hide the fresh-session welcome.
423
+ const isRealConversation = (item) => item.kind === 'user' || item.kind === 'assistant';
424
+ // The original loaded transcript decides whether the session was resumed,
425
+ // separately from the live history that grows while the session runs.
426
+ const resumedWithTranscript = initialHistory.some(isRealConversation);
427
+ const hasConversationHistory = history.some(isRealConversation);
428
+ // A session is resumed only when it was opened through `resume` and the
429
+ // original transcript already contained real conversation content. Supplying
430
+ // a session ID alone with an empty transcript keeps the session fresh, so the
431
+ // full welcome panel renders and the compact identity stays hidden until real
432
+ // conversation content appears.
433
+ const resumed = resume !== undefined && resumedWithTranscript;
434
+ const freshSession = !resumed && !hasConversationHistory;
423
435
  const sessionLoadRef = useRef(0);
424
436
  const [turnDiffs, setTurnDiffs] = useState([]);
425
437
  const turnNumberRef = useRef(0);
@@ -5635,7 +5647,7 @@ export function InteractiveApp({ factory, initialSessions, initialPrompt, initia
5635
5647
  });
5636
5648
  return (_jsx(TuiThemeProvider, { settings: themeSettings, children: _jsx(Box, { flexDirection: "column", ...(!fixedViewport
5637
5649
  ? {}
5638
- : { height: rows, overflowY: 'hidden' }), children: selectingSession ? (_jsx(SessionPicker, { sessions: filteredPickerChoices, selectedIndex: selectedIndex, screenReader: axScreenReader, query: sessionSearch })) : (_jsxs(_Fragment, { children: [!axScreenReader && !hasConversationHistory && !sessionId ? (_jsx(WelcomePanel, { display: runtimeDisplay, width: width, showTips: runtimeSettings.tips })) : null, sessionId ? (_jsxs(Text, { dimColor: true, children: ["Session ", sessionId.slice(0, 8)] })) : null, _jsx(Transcript, { items: history, activeText: activeText, activeThinking: activeThinking, thinkingExpanded: thinkingExpanded, detailedTranscript: thinkingExpanded || runtimeSettings.verbose, screenReader: axScreenReader }), externalEditorRequest !== null ||
5650
+ : { height: rows, overflowY: 'hidden' }), children: selectingSession ? (_jsx(SessionPicker, { sessions: filteredPickerChoices, selectedIndex: selectedIndex, screenReader: axScreenReader, query: sessionSearch })) : (_jsxs(_Fragment, { children: [!axScreenReader && freshSession ? (_jsx(WelcomePanel, { display: runtimeDisplay, width: width, showTips: runtimeSettings.tips })) : null, sessionId ? (_jsxs(Text, { dimColor: true, children: ["Session ", sessionId.slice(0, 8)] })) : null, !axScreenReader && !resumed && hasConversationHistory ? (_jsx(SessionIdentity, { display: runtimeDisplay, width: width })) : null, _jsx(Transcript, { items: history, activeText: activeText, activeThinking: activeThinking, thinkingExpanded: thinkingExpanded, detailedTranscript: thinkingExpanded || runtimeSettings.verbose, screenReader: axScreenReader }), externalEditorRequest !== null ||
5639
5651
  keybindingsEditing ||
5640
5652
  memoryEditorRequest !== null ? (_jsx(ExternalEditorWait, { screenReader: axScreenReader })) : permission ? (permission.kind === 'tool' && toolPermissionModel ? (_jsx(ToolPermissionDialog, { model: toolPermissionModel, selection: permissionSelection, feedbackMode: permissionFeedbackMode, feedback: input, ruleEditor: permissionRuleEditor, screenReader: axScreenReader })) : (_jsxs(DialogFrame, { title: `Retry interrupted ${permission.call.name}?`, screenReader: axScreenReader, children: [_jsx(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: _jsx(Text, { bold: true, children: describeTool(permission.call, sensitiveValues) }) }), _jsx(Text, { children: "Do you want to proceed?" }), _jsxs(Text, { inverse: !axScreenReader && permissionSelection === 0, children: [selectionPrefix(permissionSelection === 0, axScreenReader), "1. Yes"] }), _jsxs(Text, { inverse: !axScreenReader && permissionSelection === 1, children: [selectionPrefix(permissionSelection === 1, axScreenReader), "2. No"] }), permissionFeedbackMode ? (_jsxs(Text, { children: ["\u203A", ' ', input ||
5641
5653
  (permissionSelection === 0
@@ -77,6 +77,10 @@ export declare function WelcomePanel({ display, width, showTips, }: {
77
77
  width: number;
78
78
  showTips: boolean;
79
79
  }): import("react").JSX.Element | null;
80
+ export declare function SessionIdentity({ display, width, }: {
81
+ display: TuiDisplayMetadata;
82
+ width: number;
83
+ }): import("react").JSX.Element;
80
84
  export declare function MarkdownText({ text }: {
81
85
  text: string;
82
86
  }): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -125,6 +125,17 @@ export function WelcomePanel({ display, width, showTips, }) {
125
125
  const rightWidth = Math.max(12, panelWidth - leftWidth - 4);
126
126
  return (_jsxs(Box, { flexDirection: "column", width: panelWidth, children: [_jsxs(Text, { color: palette.muted, children: ['╭───', _jsx(Text, { color: palette.brand, bold: true, children: brand }), ` Code v${display.version} `, _jsx(Text, { dimColor: true, children: '─'.repeat(fill) }), '╮'] }), _jsxs(Box, { borderStyle: "round", borderColor: palette.muted, borderTop: false, flexDirection: wide ? 'row' : 'column', width: panelWidth, paddingX: 1, children: [_jsxs(Box, { alignItems: wide ? 'center' : undefined, flexDirection: "column", width: wide ? leftWidth : '100%', children: [_jsx(Text, { children: " " }), _jsxs(Text, { bold: true, children: ["Welcome to ", brand] }), _jsx(Text, { children: " " }), _jsx(Text, { color: palette.brand, bold: true, children: "\u2590\u259B\u2588\u2588\u2588\u259C\u258C" }), _jsx(Text, { color: palette.brand, children: "\u259D\u259C\u2588\u2588\u2588\u2588\u2588\u259B\u2598" }), _jsx(Text, { color: palette.brand, children: " \u2598\u2598 \u259D\u259D" }), _jsx(Text, { children: " " }), _jsxs(Text, { wrap: "truncate-end", children: [model, effort] }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: cwd })] }), _jsxs(Box, { flexDirection: "column", width: wide ? rightWidth : '100%', marginTop: wide ? 0 : 1, children: [_jsx(Text, { bold: true, children: "Get started" }), _jsx(Text, { wrap: "truncate-end", children: "/init to create CLAUDE.md" }), _jsx(Text, { wrap: "truncate-end", children: "/config to open settings" }), _jsx(Text, { dimColor: true, children: " " }), _jsx(Text, { bold: true, children: "Shared with Claude Code" }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: "Sessions \u00B7 memory \u00B7 skills" })] })] })] }));
127
127
  }
128
+ // Compact identity header shown above the transcript once a fresh session has
129
+ // conversation content. Keeps the same product/model/cwd facts as WelcomePanel
130
+ // in a small fixed footprint, truncating every line to the supplied width.
131
+ export function SessionIdentity({ display, width, }) {
132
+ const palette = useTuiPalette();
133
+ const identityWidth = Math.max(1, Math.floor(width));
134
+ const model = display.model ?? 'provider default';
135
+ const effort = display.effort ? ` · ${display.effort} effort` : '';
136
+ const cwd = compactPath(display.cwd);
137
+ return (_jsxs(Box, { flexDirection: "column", width: identityWidth, children: [_jsx(Text, { wrap: "truncate-end", children: _jsx(Text, { color: palette.brand, bold: true, children: `Praxis Code v${display.version}` }) }), _jsxs(Text, { wrap: "truncate-end", children: [model, effort] }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: cwd })] }));
138
+ }
128
139
  const INLINE_SEGMENT_CACHE_MAX = 4096;
129
140
  const inlineSegmentCache = new Map();
130
141
  function cachedInlineSegments(text) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praxis-agent",
3
- "version": "0.20.21",
3
+ "version": "0.20.22",
4
4
  "description": "Local-first, single-user general agent for the command line.",
5
5
  "license": "MIT",
6
6
  "author": "wuqisen",