orquesta-cli 0.2.51 → 0.2.52
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/ui/components/DiffView.d.ts +8 -0
- package/dist/ui/components/DiffView.js +15 -0
- package/dist/ui/components/PlanExecuteApp.js +7 -34
- package/dist/ui/components/SessionBanner.d.ts +10 -0
- package/dist/ui/components/SessionBanner.js +30 -0
- package/dist/ui/components/StreamingOutput.d.ts +7 -0
- package/dist/ui/components/StreamingOutput.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export const DiffView = ({ diff, filePath }) => {
|
|
4
|
+
const diffLines = diff.length > 10 ? [...diff.slice(0, 10), `... +${diff.length - 10} more lines`] : diff;
|
|
5
|
+
const header = filePath ? `┌─ ${filePath} ─` : '┌─';
|
|
6
|
+
return (React.createElement(Box, { flexDirection: "column", marginLeft: 2 },
|
|
7
|
+
React.createElement(Text, { color: "gray" },
|
|
8
|
+
header,
|
|
9
|
+
'─'.repeat(Math.max(0, 32 - header.length))),
|
|
10
|
+
diffLines.map((line, i) => (React.createElement(Text, { key: i, color: line.startsWith('+') ? 'green' : line.startsWith('-') ? 'red' : 'gray' },
|
|
11
|
+
'│ ',
|
|
12
|
+
line))),
|
|
13
|
+
React.createElement(Text, { color: "gray" }, '└' + '─'.repeat(32))));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=DiffView.js.map
|
|
@@ -25,6 +25,9 @@ import { CommandBrowser } from './CommandBrowser.js';
|
|
|
25
25
|
import { Logo } from './Logo.js';
|
|
26
26
|
import { MarkdownRenderer } from './MarkdownRenderer.js';
|
|
27
27
|
import { ActivityIndicator } from './ActivityIndicator.js';
|
|
28
|
+
import { DiffView } from './DiffView.js';
|
|
29
|
+
import { StreamingOutput } from './StreamingOutput.js';
|
|
30
|
+
import { SessionBanner, useResumeSession } from './SessionBanner.js';
|
|
28
31
|
import { useFileBrowserState } from '../hooks/useFileBrowserState.js';
|
|
29
32
|
import { useCommandBrowserState } from '../hooks/useCommandBrowserState.js';
|
|
30
33
|
import { usePlanExecution } from '../hooks/usePlanExecution.js';
|
|
@@ -170,21 +173,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
170
173
|
useEffect(() => {
|
|
171
174
|
sessionManager.setLogEntries(logEntries);
|
|
172
175
|
}, [logEntries]);
|
|
173
|
-
|
|
174
|
-
if (!resumeLastSession)
|
|
175
|
-
return;
|
|
176
|
-
(async () => {
|
|
177
|
-
const sessions = await sessionManager.listSessions();
|
|
178
|
-
if (sessions.length === 0)
|
|
179
|
-
return;
|
|
180
|
-
const last = sessions[0];
|
|
181
|
-
const data = await sessionManager.loadSession(last.id);
|
|
182
|
-
if (data && data.messages.length > 0) {
|
|
183
|
-
setMessages(data.messages);
|
|
184
|
-
addLog({ type: 'session_restored', content: `↩ Resumed session (${data.messages.filter(m => m.role === 'user').length} messages)` });
|
|
185
|
-
}
|
|
186
|
-
})();
|
|
187
|
-
}, [resumeLastSession]);
|
|
176
|
+
useResumeSession(resumeLastSession, setMessages, addLog);
|
|
188
177
|
const fileBrowserState = useFileBrowserState(input, isProcessing);
|
|
189
178
|
const commandBrowserState = useCommandBrowserState(input, isProcessing);
|
|
190
179
|
const planExecutionState = usePlanExecution(pendingMessageCallbacks);
|
|
@@ -1200,13 +1189,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
1200
1189
|
return (React.createElement(Box, { key: entry.id, marginTop: 1 },
|
|
1201
1190
|
React.createElement(Text, { color: "red", bold: true }, entry.content)));
|
|
1202
1191
|
case 'session_restored':
|
|
1203
|
-
return (React.createElement(
|
|
1204
|
-
React.createElement(Text, { color: "cyan", bold: true },
|
|
1205
|
-
"\uD83D\uDCC2 ",
|
|
1206
|
-
entry.content),
|
|
1207
|
-
entry.details && React.createElement(Text, { color: "gray", dimColor: true },
|
|
1208
|
-
" ",
|
|
1209
|
-
entry.details)));
|
|
1192
|
+
return (React.createElement(SessionBanner, { key: entry.id, entry: entry }));
|
|
1210
1193
|
case 'git_info':
|
|
1211
1194
|
return (React.createElement(Box, { key: entry.id, marginTop: 0, marginBottom: 0, flexDirection: "column" },
|
|
1212
1195
|
React.createElement(Text, { color: "yellow" },
|
|
@@ -1338,16 +1321,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
1338
1321
|
filePath = JSON.parse(entry.details || '{}').file || '';
|
|
1339
1322
|
}
|
|
1340
1323
|
catch { }
|
|
1341
|
-
|
|
1342
|
-
const header = filePath ? `┌─ ${filePath} ─` : '┌─';
|
|
1343
|
-
return (React.createElement(Box, { key: entry.id, flexDirection: "column", marginLeft: 2 },
|
|
1344
|
-
React.createElement(Text, { color: "gray" },
|
|
1345
|
-
header,
|
|
1346
|
-
'─'.repeat(Math.max(0, 32 - header.length))),
|
|
1347
|
-
diffLines.map((line, i) => (React.createElement(Text, { key: i, color: line.startsWith('+') ? 'green' : line.startsWith('-') ? 'red' : 'gray' },
|
|
1348
|
-
'│ ',
|
|
1349
|
-
line))),
|
|
1350
|
-
React.createElement(Text, { color: "gray" }, '└' + '─'.repeat(32))));
|
|
1324
|
+
return (React.createElement(DiffView, { key: entry.id, diff: entry.diff, filePath: filePath || undefined }));
|
|
1351
1325
|
}
|
|
1352
1326
|
case 'shell_result': {
|
|
1353
1327
|
const SHELL_MAX_LINES = 8;
|
|
@@ -1448,8 +1422,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
1448
1422
|
React.createElement(ApprovalDialog, { toolName: pendingToolApproval.toolName, args: pendingToolApproval.args, reason: pendingToolApproval.reason, onResponse: handleApprovalResponse }))),
|
|
1449
1423
|
isProcessing && (planExecutionState.executionPhase === 'planning' || planExecutionState.todos.length === 0) && !pendingToolApproval && !isDocsSearching && (React.createElement(Box, { marginY: 1, flexDirection: "column" },
|
|
1450
1424
|
React.createElement(ActivityIndicator, { activity: getCurrentActivityType(), startTime: activityStartTime, detail: activityDetail, subActivities: subActivities, modelName: currentModelInfo.model }),
|
|
1451
|
-
streamingText && (React.createElement(
|
|
1452
|
-
React.createElement(Text, { wrap: "wrap" }, streamingText.split('\n').slice(-15).join('\n')))))),
|
|
1425
|
+
streamingText && (React.createElement(StreamingOutput, { text: streamingText })))),
|
|
1453
1426
|
isDocsSearching && (React.createElement(DocsSearchProgress, { logs: docsSearchLogs, isSearching: isDocsSearching })),
|
|
1454
1427
|
planExecutionState.todos.length > 0 && (React.createElement(Box, { marginTop: 2, marginBottom: 1 },
|
|
1455
1428
|
React.createElement(TodoPanel, { todos: planExecutionState.todos, currentTodoId: planExecutionState.currentTodoId, isProcessing: isProcessing }))),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Message } from '../../types/index.js';
|
|
3
|
+
import type { LogEntry } from './PlanExecuteApp.js';
|
|
4
|
+
interface SessionBannerProps {
|
|
5
|
+
entry: LogEntry;
|
|
6
|
+
}
|
|
7
|
+
export declare const SessionBanner: React.FC<SessionBannerProps>;
|
|
8
|
+
export declare function useResumeSession(resumeLastSession: boolean | undefined, setMessages: React.Dispatch<React.SetStateAction<Message[]>>, addLog: (entry: Omit<LogEntry, 'id'>) => void): void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=SessionBanner.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { sessionManager } from '../../core/session/session-manager.js';
|
|
4
|
+
export const SessionBanner = ({ entry }) => {
|
|
5
|
+
return (React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
6
|
+
React.createElement(Text, { color: "cyan", bold: true },
|
|
7
|
+
"\uD83D\uDCC2 ",
|
|
8
|
+
entry.content),
|
|
9
|
+
entry.details && React.createElement(Text, { color: "gray", dimColor: true },
|
|
10
|
+
" ",
|
|
11
|
+
entry.details)));
|
|
12
|
+
};
|
|
13
|
+
export function useResumeSession(resumeLastSession, setMessages, addLog) {
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!resumeLastSession)
|
|
16
|
+
return;
|
|
17
|
+
(async () => {
|
|
18
|
+
const sessions = await sessionManager.listSessions();
|
|
19
|
+
if (sessions.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
const last = sessions[0];
|
|
22
|
+
const data = await sessionManager.loadSession(last.id);
|
|
23
|
+
if (data && data.messages.length > 0) {
|
|
24
|
+
setMessages(data.messages);
|
|
25
|
+
addLog({ type: 'session_restored', content: `↩ Resumed session (${data.messages.filter(m => m.role === 'user').length} messages)` });
|
|
26
|
+
}
|
|
27
|
+
})();
|
|
28
|
+
}, [resumeLastSession]);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=SessionBanner.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export const StreamingOutput = ({ text }) => {
|
|
4
|
+
if (!text)
|
|
5
|
+
return null;
|
|
6
|
+
return (React.createElement(Box, { marginTop: 1, paddingX: 1 },
|
|
7
|
+
React.createElement(Text, { wrap: "wrap" }, text.split('\n').slice(-15).join('\n'))));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=StreamingOutput.js.map
|