orquesta-cli 0.2.50 → 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 +23 -40
- 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);
|
|
@@ -290,14 +279,23 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
290
279
|
};
|
|
291
280
|
}, [addLog]);
|
|
292
281
|
useEffect(() => {
|
|
293
|
-
if (llmClient)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
282
|
+
if (!llmClient)
|
|
283
|
+
return;
|
|
284
|
+
let buffer = '';
|
|
285
|
+
let rafId = null;
|
|
286
|
+
llmClient.onStreamingContent = (token) => {
|
|
287
|
+
buffer += token;
|
|
288
|
+
if (!rafId) {
|
|
289
|
+
rafId = setTimeout(() => {
|
|
290
|
+
setStreamingText(buffer);
|
|
291
|
+
rafId = null;
|
|
292
|
+
}, 80);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
298
295
|
return () => {
|
|
299
|
-
if (
|
|
300
|
-
|
|
296
|
+
if (rafId)
|
|
297
|
+
clearTimeout(rafId);
|
|
298
|
+
llmClient.onStreamingContent = null;
|
|
301
299
|
};
|
|
302
300
|
}, [llmClient]);
|
|
303
301
|
useEffect(() => {
|
|
@@ -1191,13 +1189,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
1191
1189
|
return (React.createElement(Box, { key: entry.id, marginTop: 1 },
|
|
1192
1190
|
React.createElement(Text, { color: "red", bold: true }, entry.content)));
|
|
1193
1191
|
case 'session_restored':
|
|
1194
|
-
return (React.createElement(
|
|
1195
|
-
React.createElement(Text, { color: "cyan", bold: true },
|
|
1196
|
-
"\uD83D\uDCC2 ",
|
|
1197
|
-
entry.content),
|
|
1198
|
-
entry.details && React.createElement(Text, { color: "gray", dimColor: true },
|
|
1199
|
-
" ",
|
|
1200
|
-
entry.details)));
|
|
1192
|
+
return (React.createElement(SessionBanner, { key: entry.id, entry: entry }));
|
|
1201
1193
|
case 'git_info':
|
|
1202
1194
|
return (React.createElement(Box, { key: entry.id, marginTop: 0, marginBottom: 0, flexDirection: "column" },
|
|
1203
1195
|
React.createElement(Text, { color: "yellow" },
|
|
@@ -1329,15 +1321,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
1329
1321
|
filePath = JSON.parse(entry.details || '{}').file || '';
|
|
1330
1322
|
}
|
|
1331
1323
|
catch { }
|
|
1332
|
-
|
|
1333
|
-
return (React.createElement(Box, { key: entry.id, flexDirection: "column", marginLeft: 2 },
|
|
1334
|
-
React.createElement(Text, { color: "gray" },
|
|
1335
|
-
header,
|
|
1336
|
-
'─'.repeat(Math.max(0, 32 - header.length))),
|
|
1337
|
-
entry.diff.map((line, i) => (React.createElement(Text, { key: i, color: line.startsWith('+') ? 'green' : line.startsWith('-') ? 'red' : 'gray' },
|
|
1338
|
-
'│ ',
|
|
1339
|
-
line))),
|
|
1340
|
-
React.createElement(Text, { color: "gray" }, '└' + '─'.repeat(32))));
|
|
1324
|
+
return (React.createElement(DiffView, { key: entry.id, diff: entry.diff, filePath: filePath || undefined }));
|
|
1341
1325
|
}
|
|
1342
1326
|
case 'shell_result': {
|
|
1343
1327
|
const SHELL_MAX_LINES = 8;
|
|
@@ -1438,8 +1422,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo, resumeL
|
|
|
1438
1422
|
React.createElement(ApprovalDialog, { toolName: pendingToolApproval.toolName, args: pendingToolApproval.args, reason: pendingToolApproval.reason, onResponse: handleApprovalResponse }))),
|
|
1439
1423
|
isProcessing && (planExecutionState.executionPhase === 'planning' || planExecutionState.todos.length === 0) && !pendingToolApproval && !isDocsSearching && (React.createElement(Box, { marginY: 1, flexDirection: "column" },
|
|
1440
1424
|
React.createElement(ActivityIndicator, { activity: getCurrentActivityType(), startTime: activityStartTime, detail: activityDetail, subActivities: subActivities, modelName: currentModelInfo.model }),
|
|
1441
|
-
streamingText && (React.createElement(
|
|
1442
|
-
React.createElement(Text, { wrap: "wrap" }, streamingText))))),
|
|
1425
|
+
streamingText && (React.createElement(StreamingOutput, { text: streamingText })))),
|
|
1443
1426
|
isDocsSearching && (React.createElement(DocsSearchProgress, { logs: docsSearchLogs, isSearching: isDocsSearching })),
|
|
1444
1427
|
planExecutionState.todos.length > 0 && (React.createElement(Box, { marginTop: 2, marginBottom: 1 },
|
|
1445
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
|