@agimon-ai/doompi-grep 0.0.1-alpha.24 → 0.0.1-alpha.26
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/package.json +6 -6
- package/src/web/GrepToolMessage.tsx +27 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-grep",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.26",
|
|
4
4
|
"description": "Snapshot-bound hashline grep for Pi and DoomPi.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@deepseek-ai/cordis": "4.0.1",
|
|
54
54
|
"typebox": "1.3.19",
|
|
55
|
-
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.
|
|
56
|
-
"@agimon-ai/doompi-
|
|
57
|
-
"@agimon-ai/doompi-web-
|
|
58
|
-
"@agimon-ai/doompi-hashline": "0.0.1-alpha.
|
|
59
|
-
"@agimon-ai/doompi-
|
|
55
|
+
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.53",
|
|
56
|
+
"@agimon-ai/doompi-web-components": "0.0.1-alpha.14",
|
|
57
|
+
"@agimon-ai/doompi-web-contracts": "0.0.1-alpha.17",
|
|
58
|
+
"@agimon-ai/doompi-hashline": "0.0.1-alpha.25",
|
|
59
|
+
"@agimon-ai/doompi-ui": "0.0.1-alpha.54"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@earendil-works/pi-coding-agent": "0.84.4",
|
|
@@ -13,18 +13,16 @@ import { grepCallView } from './grepToolView.ts';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The grep tool's timeline item, the web half of its renderCall and
|
|
16
|
-
* renderResult: the call summary in the header and
|
|
17
|
-
* a line-number gutter in the body
|
|
18
|
-
*
|
|
16
|
+
* renderResult: the call summary in the header and, when expanded, the
|
|
17
|
+
* anchored matches with a line-number gutter in the body. A failure shows the
|
|
18
|
+
* tool's message in red inside the expanded body instead.
|
|
19
19
|
*/
|
|
20
20
|
export function GrepToolMessage({ args, result, output, running, isError }: ToolMessageRenderProps) {
|
|
21
21
|
const view = grepCallView(args);
|
|
22
|
-
const
|
|
22
|
+
const body = result === null || isError ? null : hashlineBody(result, output, 'grep', true);
|
|
23
23
|
return (
|
|
24
|
-
<MessageItem tone={toolTone({ running, isError })} expandable={
|
|
24
|
+
<MessageItem tone={toolTone({ running, isError })} expandable defaultExpanded={false}>
|
|
25
25
|
{({ expanded }) => {
|
|
26
|
-
const body =
|
|
27
|
-
result === null || isError ? null : expanded ? hashlineBody(result, output, 'grep', true) : collapsed;
|
|
28
26
|
return (
|
|
29
27
|
<>
|
|
30
28
|
<MessageItemHeader title="grep">
|
|
@@ -35,28 +33,29 @@ export function GrepToolMessage({ args, result, output, running, isError }: Tool
|
|
|
35
33
|
) : null}
|
|
36
34
|
</span>
|
|
37
35
|
</MessageItemHeader>
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{line}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
) : body === null ? (
|
|
48
|
-
running ? (
|
|
49
|
-
<MessageItemBody data-testid="tool-result-grep">
|
|
50
|
-
<MessageItemStatus tone="running">running</MessageItemStatus>
|
|
36
|
+
{expanded ? (
|
|
37
|
+
isError ? (
|
|
38
|
+
<MessageItemBody data-testid="tool-result-grep" className="flex flex-col">
|
|
39
|
+
<MessageItemStatus tone="error">failed</MessageItemStatus>
|
|
40
|
+
{resultTextLines(result, output).map((line, index) => (
|
|
41
|
+
<span key={`${String(index)}-${line}`} className="whitespace-pre-wrap break-words text-doom-red">
|
|
42
|
+
{line}
|
|
43
|
+
</span>
|
|
44
|
+
))}
|
|
51
45
|
</MessageItemBody>
|
|
52
|
-
) : null
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
) : body === null ? (
|
|
47
|
+
running ? (
|
|
48
|
+
<MessageItemBody data-testid="tool-result-grep">
|
|
49
|
+
<MessageItemStatus tone="running">running</MessageItemStatus>
|
|
50
|
+
</MessageItemBody>
|
|
51
|
+
) : null
|
|
52
|
+
) : body.shown.length === 0 && body.notice === undefined ? null : (
|
|
53
|
+
<MessageItemBody data-testid="tool-result-grep" className="flex flex-col gap-1">
|
|
54
|
+
<HashlineLines lines={body.shown} gutter={body.gutter} />
|
|
55
|
+
{body.notice !== undefined ? <span className="text-doom-faint">{body.notice}</span> : null}
|
|
56
|
+
</MessageItemBody>
|
|
57
|
+
)
|
|
58
|
+
) : null}
|
|
60
59
|
</>
|
|
61
60
|
);
|
|
62
61
|
}}
|