@agent-api/cli 0.4.32 → 0.4.34
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/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/tui/ink/components.js +13 -2
- package/package.json +2 -2
package/dist/runtime.d.ts
CHANGED
package/dist/runtime.js
CHANGED
|
@@ -8,7 +8,7 @@ export function InkWorkbenchScreen({ activityCursor, activitySelection, conversa
|
|
|
8
8
|
const text = `${new Date(activity.timestamp).toLocaleTimeString()} ${activity.text}`;
|
|
9
9
|
return (_jsxs(Text, { color: activityColor(activity.level), wrap: "truncate", children: [cursor ? _jsx(Text, { color: "cyan", children: "\u203A " }) : _jsx(Text, { children: " " }), _jsx(SelectableText, { cursorColumn: cursor && !activitySelection ? activityCursor.column : null, selection: lineSelection(index, activitySelection), text: text || " " })] }, activity.id));
|
|
10
10
|
})] }));
|
|
11
|
-
const sidePanels = (_jsxs(Box, { flexDirection: "column", flexShrink: 0, marginRight: renderModel.layout === "wide" ? 1 : 0, width: renderModel.layout === "wide" ? renderModel.workdirPanelWidth : "100%", children: [_jsx(InfoPanel, { cursor: conversationCursor, focused: focusedPanel === "conversation", height: renderModel.conversationHeight, lines: renderModel.conversation.lines, selection: conversationSelection, title: "Conversation" }), _jsx(
|
|
11
|
+
const sidePanels = (_jsxs(Box, { flexDirection: "column", flexShrink: 0, marginRight: renderModel.layout === "wide" ? 1 : 0, width: renderModel.layout === "wide" ? renderModel.workdirPanelWidth : "100%", children: [_jsx(InfoPanel, { cursor: conversationCursor, focused: focusedPanel === "conversation", height: renderModel.conversationHeight, lines: renderModel.conversation.lines, selection: conversationSelection, title: "Conversation" }), _jsx(InfoPanel, { cursor: workdirCursor, focused: focusedPanel === "workdir", height: renderModel.workdirHeight, lines: renderModel.workdir.lines, selection: workdirSelection, title: "Workdir" }), _jsx(InfoPanel, { cursor: workspaceCursor, focused: focusedPanel === "workspace", height: renderModel.workspaceHeight, lines: renderModel.workspace.lines, selection: workspaceSelection, title: "Workspace" })] }));
|
|
12
12
|
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Header, { focused: focusedPanel === "header", cursor: headerCursor, selection: headerSelection, contextEnabled: renderModel.header.contextEnabled, conversation: renderModel.header.conversation, conversationId: renderModel.header.conversationId, conversationPreviousResponseId: renderModel.header.conversationPreviousResponseId, conversationStatus: renderModel.header.conversationStatus, lines: renderModel.header.lines, model: renderModel.header.model, accessMode: renderModel.header.accessMode, pendingLocalLabel: renderModel.header.pendingLocalLabel, preset: renderModel.header.preset, profile: renderModel.header.profile, renderMode: renderModel.header.renderMode, workdir: renderModel.header.workdir }), _jsxs(Box, { height: renderModel.viewportHeight, flexDirection: renderModel.layout === "wide" ? "row" : "column", children: [renderModel.layout === "wide" && sidePanels, _jsxs(Box, { flexDirection: renderModel.layout === "wide" ? "row" : "column", flexGrow: 1, children: [_jsxs(Box, { borderStyle: "round", borderColor: panelBorderColor(focusedPanel === "transcript"), flexGrow: renderModel.layout === "wide" ? 1 : 0, flexDirection: "column", height: renderModel.transcript.viewportHeight + 3, paddingX: 1, width: renderModel.layout === "wide" ? undefined : "100%", children: [_jsxs(Text, { bold: true, color: renderModel.transcriptStatus.color, wrap: "truncate", children: ["Transcript \u00B7 ", renderModel.transcriptStatus.label] }), renderModel.transcript.visibleLines.map((line, index) => (_jsx(TranscriptText, { cursorColumn: focusedPanel === "transcript" && renderModel.transcript.startLine + index - 1 === transcriptCursor.line && !transcriptSelection
|
|
13
13
|
? transcriptCursor.column
|
|
14
14
|
: null, line: line, lineSelection: lineSelection(renderModel.transcript.startLine + index - 1, transcriptSelection), lineCursor: focusedPanel === "transcript" && renderModel.transcript.startLine + index - 1 === transcriptCursor.line }, line.id))), renderModel.transcript.visibleLines.length === 0 && _jsx(Text, { color: "gray", children: "No transcript lines." })] }), activity] })] }), _jsxs(Box, { borderStyle: "round", borderColor: panelBorderColor(focusedPanel === "input"), paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { children: [renderModel.input.fullAccess && (_jsx(Text, { color: "red", bold: true, inverse: true, children: "FULL ACCESS" })), renderModel.input.fullAccess && _jsx(Text, { children: " " }), _jsx(Text, { color: renderModel.input.busy ? "yellow" : "green", children: renderModel.input.label }), renderModel.input.statusText && (_jsxs(Text, { color: "yellow", children: [" ", busySpinner(spinnerFrame), " ", renderModel.input.statusText] }))] }), _jsx(Box, { flexDirection: "column", children: renderModel.input.lines.map((line, index) => (_jsx(Text, { wrap: "truncate", children: line.spans.map((span, spanIndex) => (_jsx(Text, { inverse: span.inverse, children: span.text }, spanIndex))) }, index))) })] }), _jsx(Box, { paddingX: 1, children: _jsx(Text, { color: "gray", wrap: "truncate", children: renderModel.footerText }) })] }));
|
|
@@ -101,7 +101,18 @@ function Header({ cursor, focused, selection, contextEnabled, conversation, conv
|
|
|
101
101
|
return (_jsx(Box, { borderStyle: "round", borderColor: panelBorderColor(focused), paddingX: 1, flexDirection: "column", children: renderedLines.map((line, index) => (_jsxs(Text, { bold: line.bold || (focused && index === cursor.line), color: focused && index === 0 ? "cyan" : line.color, wrap: "truncate", children: [focused && index === cursor.line ? _jsx(Text, { color: "cyan", children: "\u203A " }) : _jsx(Text, { children: " " }), _jsx(SelectableText, { bold: line.bold, color: line.color, cursorColumn: focused && index === cursor.line && !selection ? cursor.column : null, selection: lineSelection(index, selection), text: line.text })] }, index))) }));
|
|
102
102
|
}
|
|
103
103
|
function InfoPanel({ cursor, focused, height, lines, selection, title, }) {
|
|
104
|
-
|
|
104
|
+
const visibleCount = Math.max(0, height - 2);
|
|
105
|
+
const startLine = panelWindowStart(cursor.line, lines.length, visibleCount);
|
|
106
|
+
const visibleLines = lines.slice(startLine, startLine + visibleCount);
|
|
107
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: panelBorderColor(focused), flexDirection: "column", height: height, paddingX: 1, children: [_jsx(Text, { bold: true, color: focused ? "cyan" : undefined, wrap: "truncate", children: title }), visibleLines.map((line, index) => {
|
|
108
|
+
const absoluteLine = startLine + index;
|
|
109
|
+
return (_jsxs(Text, { bold: focused && absoluteLine === cursor.line, color: "gray", wrap: "truncate", children: [focused && absoluteLine === cursor.line ? _jsx(Text, { color: "cyan", children: "\u203A " }) : _jsx(Text, { children: " " }), _jsx(SelectableText, { cursorColumn: focused && absoluteLine === cursor.line && !selection ? cursor.column : null, selection: lineSelection(absoluteLine, selection), text: line || " " })] }, `${title}:${absoluteLine}`));
|
|
110
|
+
})] }));
|
|
111
|
+
}
|
|
112
|
+
function panelWindowStart(cursorLine, lineCount, visibleCount) {
|
|
113
|
+
if (visibleCount <= 0 || lineCount <= visibleCount)
|
|
114
|
+
return 0;
|
|
115
|
+
return Math.max(0, Math.min(cursorLine, lineCount - visibleCount));
|
|
105
116
|
}
|
|
106
117
|
function panelBorderColor(focused) {
|
|
107
118
|
return focused ? "cyan" : "gray";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-api/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.34",
|
|
4
4
|
"description": "First-class command line interface for Agent API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/scalebox-dev/agent-tui#readme",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"test": "npm run sync-version && npm run build && npm run smoke -w @agent-api/app-engine && node --test test/*.test.mjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@agent-api/app-engine": "^0.1.
|
|
39
|
+
"@agent-api/app-engine": "^0.1.31",
|
|
40
40
|
"better-sqlite3": "^12.11.1",
|
|
41
41
|
"commander": "^14.0.3",
|
|
42
42
|
"ink": "^6.8.0",
|