@agimon-ai/doompi-read 0.0.1-alpha.20 → 0.0.1-alpha.21

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-read",
3
- "version": "0.0.1-alpha.20",
3
+ "version": "0.0.1-alpha.21",
4
4
  "description": "Snapshot-bound hashline read tool 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.47",
56
- "@agimon-ai/doompi-web-contracts": "0.0.1-alpha.11",
57
- "@agimon-ai/doompi-hashline": "0.0.1-alpha.19",
58
- "@agimon-ai/doompi-ui": "0.0.1-alpha.48",
59
- "@agimon-ai/doompi-web-components": "0.0.1-alpha.8"
55
+ "@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.48",
56
+ "@agimon-ai/doompi-hashline": "0.0.1-alpha.20",
57
+ "@agimon-ai/doompi-ui": "0.0.1-alpha.49",
58
+ "@agimon-ai/doompi-web-contracts": "0.0.1-alpha.12",
59
+ "@agimon-ai/doompi-web-components": "0.0.1-alpha.9"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@earendil-works/pi-coding-agent": "0.84.4",
@@ -6,6 +6,7 @@ import {
6
6
  MessageItemHeader,
7
7
  MessageItemStatus,
8
8
  resultTextLines,
9
+ ToolPathLink,
9
10
  toolTone,
10
11
  } from '@agimon-ai/doompi-web-components';
11
12
  import type { ToolMessageRenderProps } from '@agimon-ai/doompi-web-contracts';
@@ -31,9 +32,20 @@ function resultImages(content: readonly unknown[]): Array<{ data: string; mimeTy
31
32
  * a line-number gutter in the body, collapsed to the TUI's budget until the
32
33
  * item expands. A failure shows the tool's message in red instead.
33
34
  */
34
- export function ReadToolMessage({ args, result, output, running, isError }: ToolMessageRenderProps) {
35
+ export function ReadToolMessage({
36
+ args,
37
+ result,
38
+ output,
39
+ running,
40
+ isError,
41
+ fileTabFor,
42
+ openTransientTab,
43
+ }: ToolMessageRenderProps) {
35
44
  const view = readCallView(args);
36
45
  const images = resultImages(result?.content ?? []);
46
+ // A read is the one call whose file the session usually has not changed, so
47
+ // this is the link that opens it read-only rather than in its history.
48
+ const tab = fileTabFor(view.path);
37
49
  const collapsed = result === null || isError ? null : hashlineBody(result, output, 'read', false);
38
50
  return (
39
51
  <MessageItem tone={toolTone({ running, isError })} expandable={collapsed !== null && collapsed.hidden > 0}>
@@ -44,7 +56,10 @@ export function ReadToolMessage({ args, result, output, running, isError }: Tool
44
56
  <>
45
57
  <MessageItemHeader title="read">
46
58
  <span data-testid="tool-call-read" className="flex min-w-0 flex-1 items-center gap-2">
47
- <span className="truncate text-doom-text">{view.path}</span>
59
+ <ToolPathLink
60
+ path={view.path}
61
+ {...(tab === undefined ? {} : { onOpen: () => openTransientTab(tab) })}
62
+ />
48
63
  {view.details.length > 0 ? (
49
64
  <span className="shrink-0 text-doom-faint">· {view.details.join(' · ')}</span>
50
65
  ) : null}
@@ -67,7 +82,9 @@ export function ReadToolMessage({ args, result, output, running, isError }: Tool
67
82
  ) : null
68
83
  ) : body.shown.length === 0 && body.notice === undefined && images.length === 0 ? null : (
69
84
  <MessageItemBody data-testid="tool-result-read" className="flex flex-col gap-1">
70
- <HashlineLines lines={body.shown} gutter={body.gutter} />
85
+ {/* A read body is one file with no heading of its own, so the
86
+ call's path is what names the grammar for it. */}
87
+ <HashlineLines lines={body.shown} gutter={body.gutter} path={view.path} />
71
88
  {images.map((image, index) => {
72
89
  const url = `data:${image.mimeType};base64,${image.data}`;
73
90
  return (