@trim21/personal-pi-extensions 0.0.409 → 0.0.411
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
package/src/claude-code/files.ts
CHANGED
|
@@ -116,9 +116,10 @@ function splitFileLines(content: string): string[] {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
119
|
+
* 格式化读取输出:行号前缀用 `N: `(对齐 opencode Read)。弃用 Claude Code
|
|
120
|
+
* 的 `N\t` 前缀——tab 分隔符在 Go 等 tab 缩进语言里会与内容缩进连排,模型
|
|
121
|
+
* 易误判多一层缩进。limit 未指定时读取全部。无 PARTIAL 提示、无单行截断
|
|
122
|
+
* (由 execute 层的字节/token 上限兜底)。
|
|
122
123
|
*/
|
|
123
124
|
export function formatReadOutput(
|
|
124
125
|
content: string,
|
|
@@ -143,7 +144,7 @@ export function formatReadOutput(
|
|
|
143
144
|
const startIndex = offset === 0 ? 0 : offset - 1;
|
|
144
145
|
const selected =
|
|
145
146
|
limit === undefined ? lines.slice(startIndex) : lines.slice(startIndex, startIndex + limit);
|
|
146
|
-
const text = selected.map((line, index) => `${offset + index}
|
|
147
|
+
const text = selected.map((line, index) => `${offset + index}: ${line}`).join("\n");
|
|
147
148
|
return { text, totalLines };
|
|
148
149
|
}
|
|
149
150
|
|
package/src/claude-code/read.md
CHANGED
|
@@ -7,7 +7,7 @@ Usage:
|
|
|
7
7
|
- The file_path parameter must be an absolute path, not a relative path
|
|
8
8
|
- By default, it reads the entire file; files over 256 KB or 25K tokens require offset and limit to read specific portions
|
|
9
9
|
- When you already know which part of the file you need, only read that part. This can be important for larger files.
|
|
10
|
-
- Results are returned as `<lineNumber
|
|
10
|
+
- Results are returned as `<lineNumber>: <content>` lines, 1-indexed
|
|
11
11
|
- This tool allows you to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually.
|
|
12
12
|
- This tool can only read files, not directories. To read a directory, use an ls command via the Bash tool.
|
|
13
13
|
- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.
|