@ridit/lens 0.3.7 → 0.3.9
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/index.mjs +105368 -274002
- package/package.json +13 -19
- package/src/colors.ts +15 -15
- package/src/commands/chat.tsx +32 -23
- package/src/commands/provider.tsx +11 -238
- package/src/commands/repo.tsx +66 -120
- package/src/commands/timeline.tsx +11 -22
- package/src/components/ChatView.tsx +238 -0
- package/src/components/Message.tsx +46 -0
- package/src/components/ToolCall.tsx +67 -0
- package/src/components/chat/ChatView.tsx +550 -0
- package/src/components/chat/Message.tsx +152 -0
- package/src/components/chat/StatusBar.tsx +214 -0
- package/src/components/chat/TextArea.tsx +173 -176
- package/src/components/provider/ApiKeyStep.tsx +207 -199
- package/src/components/provider/ModelStep.tsx +90 -88
- package/src/components/provider/ProviderSetup.tsx +331 -0
- package/src/components/provider/ProviderTypeStep.tsx +53 -61
- package/src/components/repo/StepRow.tsx +68 -69
- package/src/components/timeline/TimelineView.tsx +840 -0
- package/src/components/toolcall-utils.ts +103 -0
- package/src/components/watch/RunView.tsx +497 -0
- package/src/hooks/useChatInput.ts +49 -0
- package/src/hooks/useCommandHandler.ts +117 -0
- package/src/index.tsx +386 -139
- package/src/utils/git.ts +149 -155
- package/src/utils/repo.ts +62 -69
- package/src/utils/thinking.tsx +64 -0
- package/src/utils/watch.ts +165 -307
- package/tests/message.test.ts +38 -0
- package/tests/toolcall-utils.test.ts +111 -0
- package/tsconfig.json +8 -24
- package/CLAUDE.md +0 -50
- package/LENS.md +0 -48
- package/LICENSE +0 -21
- package/README.md +0 -93
- package/addons/README.md +0 -55
- package/addons/clean-cache.js +0 -48
- package/addons/generate-readme.js +0 -67
- package/addons/git-stats.js +0 -29
- package/addons/run-tests.js +0 -127
- package/src/commands/commit.tsx +0 -668
- package/src/commands/review.tsx +0 -294
- package/src/commands/run.tsx +0 -56
- package/src/commands/task.tsx +0 -36
- package/src/components/chat/ChatMessage.tsx +0 -195
- package/src/components/chat/ChatOverlays.tsx +0 -399
- package/src/components/chat/ChatRunner.tsx +0 -517
- package/src/components/chat/hooks/useChat.ts +0 -631
- package/src/components/chat/hooks/useChatInput.ts +0 -79
- package/src/components/chat/hooks/useCommandHandlers.ts +0 -327
- package/src/components/provider/ProviderPicker.tsx +0 -76
- package/src/components/provider/RemoveProviderStep.tsx +0 -82
- package/src/components/repo/DiffViewer.tsx +0 -175
- package/src/components/repo/FileReviewer.tsx +0 -70
- package/src/components/repo/FileViewer.tsx +0 -60
- package/src/components/repo/IssueFixer.tsx +0 -666
- package/src/components/repo/LensFileMenu.tsx +0 -115
- package/src/components/repo/NoProviderPrompt.tsx +0 -28
- package/src/components/repo/PreviewRunner.tsx +0 -217
- package/src/components/repo/RepoAnalysis.tsx +0 -534
- package/src/components/task/TaskRunner.tsx +0 -396
- package/src/components/timeline/CommitDetail.tsx +0 -272
- package/src/components/timeline/CommitList.tsx +0 -162
- package/src/components/timeline/TimelineChat.tsx +0 -166
- package/src/components/timeline/TimelineRunner.tsx +0 -1285
- package/src/components/watch/RunRunner.tsx +0 -929
- package/src/prompts/fewshot.ts +0 -252
- package/src/prompts/index.ts +0 -2
- package/src/prompts/system.ts +0 -285
- package/src/tools/chart.ts +0 -202
- package/src/tools/convert-image.ts +0 -312
- package/src/tools/files.ts +0 -253
- package/src/tools/git.ts +0 -603
- package/src/tools/index.ts +0 -17
- package/src/tools/pdf.ts +0 -164
- package/src/tools/shell.ts +0 -96
- package/src/tools/view-image.ts +0 -335
- package/src/tools/web.ts +0 -212
- package/src/types/chat.ts +0 -86
- package/src/types/config.ts +0 -20
- package/src/types/repo.ts +0 -54
- package/src/utils/addons/loadAddons.ts +0 -34
- package/src/utils/ai.ts +0 -321
- package/src/utils/chat.ts +0 -326
- package/src/utils/chatHistory.ts +0 -121
- package/src/utils/config.ts +0 -61
- package/src/utils/files.ts +0 -105
- package/src/utils/intentClassifier.ts +0 -58
- package/src/utils/lensfile.ts +0 -142
- package/src/utils/llm.ts +0 -81
- package/src/utils/memory.ts +0 -209
- package/src/utils/preview.ts +0 -119
- package/src/utils/stats.ts +0 -174
- package/src/utils/tools/builtins.ts +0 -377
- package/src/utils/tools/registry.ts +0 -105
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text, useInput } from "ink";
|
|
3
|
-
import figures from "figures";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import { iconForFile } from "../../utils/files";
|
|
6
|
-
import { FileViewer } from "./FileViewer";
|
|
7
|
-
import type { ImportantFile, ReviewStage } from "../../types/repo";
|
|
8
|
-
|
|
9
|
-
export const FileReviewer = ({
|
|
10
|
-
files,
|
|
11
|
-
onDone,
|
|
12
|
-
}: {
|
|
13
|
-
files: ImportantFile[];
|
|
14
|
-
onDone: () => void;
|
|
15
|
-
}) => {
|
|
16
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
17
|
-
const [reviewStage, setReviewStage] = useState<ReviewStage>("list");
|
|
18
|
-
|
|
19
|
-
useInput((_, key) => {
|
|
20
|
-
if (reviewStage === "file") return;
|
|
21
|
-
|
|
22
|
-
if (key.upArrow) setSelectedIndex((i) => Math.max(0, i - 1));
|
|
23
|
-
if (key.downArrow)
|
|
24
|
-
setSelectedIndex((i) => Math.min(files.length - 1, i + 1));
|
|
25
|
-
if (key.return || key.rightArrow) setReviewStage("file");
|
|
26
|
-
if (key.escape) onDone();
|
|
27
|
-
if (key.rightArrow) onDone();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
if (reviewStage === "file") {
|
|
31
|
-
const file = files[selectedIndex];
|
|
32
|
-
if (!file) return null;
|
|
33
|
-
return (
|
|
34
|
-
<FileViewer
|
|
35
|
-
file={file}
|
|
36
|
-
index={selectedIndex}
|
|
37
|
-
total={files.length}
|
|
38
|
-
onBack={() => setReviewStage("list")}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Box flexDirection="column" marginTop={1} gap={1}>
|
|
45
|
-
<Text bold color="cyan">
|
|
46
|
-
{figures.hamburger} {files.length} important file(s) found
|
|
47
|
-
<Text color="gray">
|
|
48
|
-
{" "}↑↓ navigate · enter to open · → next step · esc to skip
|
|
49
|
-
</Text>
|
|
50
|
-
</Text>
|
|
51
|
-
|
|
52
|
-
<Box flexDirection="column">
|
|
53
|
-
{files.map((file, i) => {
|
|
54
|
-
const isSelected = i === selectedIndex;
|
|
55
|
-
return (
|
|
56
|
-
<Box key={file.path} marginLeft={1}>
|
|
57
|
-
<Text color={isSelected ? "cyan" : "yellow"}>
|
|
58
|
-
{isSelected ? figures.arrowRight : " "}
|
|
59
|
-
{" "}
|
|
60
|
-
{iconForFile(file.path)}
|
|
61
|
-
{" "}
|
|
62
|
-
{file.path}
|
|
63
|
-
</Text>
|
|
64
|
-
</Box>
|
|
65
|
-
);
|
|
66
|
-
})}
|
|
67
|
-
</Box>
|
|
68
|
-
</Box>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text, useInput } from "ink";
|
|
3
|
-
import figures from "figures";
|
|
4
|
-
import { iconForFile } from "../../utils/files";
|
|
5
|
-
import type { ImportantFile } from "../../types/repo";
|
|
6
|
-
|
|
7
|
-
export const FileViewer = ({
|
|
8
|
-
file,
|
|
9
|
-
index,
|
|
10
|
-
total,
|
|
11
|
-
onBack,
|
|
12
|
-
}: {
|
|
13
|
-
file: ImportantFile;
|
|
14
|
-
index: number;
|
|
15
|
-
total: number;
|
|
16
|
-
onBack: () => void;
|
|
17
|
-
}) => {
|
|
18
|
-
useInput((_, key) => {
|
|
19
|
-
if (key.backspace || key.delete || key.leftArrow) onBack();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const lines = file.content.split("\n");
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Box flexDirection="column">
|
|
26
|
-
<Box flexDirection="column" paddingX={1}>
|
|
27
|
-
{lines.map((line, i) => (
|
|
28
|
-
<Text key={i} color="white">
|
|
29
|
-
{line}
|
|
30
|
-
</Text>
|
|
31
|
-
))}
|
|
32
|
-
</Box>
|
|
33
|
-
|
|
34
|
-
<Box
|
|
35
|
-
marginTop={1}
|
|
36
|
-
paddingX={1}
|
|
37
|
-
borderStyle="single"
|
|
38
|
-
borderColor="gray"
|
|
39
|
-
justifyContent="space-between"
|
|
40
|
-
>
|
|
41
|
-
<Text color="cyan">
|
|
42
|
-
{iconForFile(file.path)}
|
|
43
|
-
{" "}
|
|
44
|
-
{file.path}
|
|
45
|
-
</Text>
|
|
46
|
-
<Text color="gray">
|
|
47
|
-
{" "}
|
|
48
|
-
{lines.length} lines{" "}
|
|
49
|
-
{figures.bullet}
|
|
50
|
-
{" "}
|
|
51
|
-
{index + 1}/{total}
|
|
52
|
-
{" "}
|
|
53
|
-
{figures.bullet}
|
|
54
|
-
{" "}
|
|
55
|
-
{figures.arrowLeft} back
|
|
56
|
-
</Text>
|
|
57
|
-
</Box>
|
|
58
|
-
</Box>
|
|
59
|
-
);
|
|
60
|
-
};
|