v1.4.0: plain read/grep output outside hashline mode (Claude Code style replace mode)
This commit is contained in:
1 parent
de37af4b8c
commit
ad5743baec
3 files changed
+10
-3
No files matched your search
@@ -682,7 +682,7 @@ export function apply(ctx, config = {}) {
|
||||
function readTool(builtin) {
|
||||
return {
|
||||
...builtin,
|
||||
description: `${builtin.description} Returns at most ${cfg.pageLines} lines per call; continue with offset from the footer.${P.READ_HASHLINE_NOTE}`,
|
||||
description: `${builtin.description} Returns at most ${cfg.pageLines} lines per call; continue with offset from the footer.${cfg.mode === 'hashline' ? P.READ_HASHLINE_NOTE : ''}`,
|
||||
parameters: capLimit(builtin.parameters, cfg.pageLines),
|
||||
output: {
|
||||
...builtin.output,
|
||||
@@ -703,6 +703,8 @@ export function apply(ctx, config = {}) {
|
||||
const target = await resolveTarget(args.file_path, exec)
|
||||
const { text } = await readFile(target, exec)
|
||||
const tag = storeFor(exec).record(String(target.targetKey), text)
|
||||
// Tags only matter to hashline patches; other modes get the plain built-in output.
|
||||
if (modeFor(exec?.agent) !== 'hashline') return value
|
||||
return { ...value, tag, rel: relPath(target, exec) }
|
||||
} catch {
|
||||
return value
|
||||
@@ -721,7 +723,7 @@ export function apply(ctx, config = {}) {
|
||||
function grepTool(builtin) {
|
||||
return {
|
||||
...builtin,
|
||||
description: `Search file contents with a ripgrep regular expression. Returns at most ${cfg.pageLines} matching lines per call, grouped by file; pass offset to page through more.${P.GREP_HASHLINE_NOTE}`,
|
||||
description: `Search file contents with a ripgrep regular expression. Returns at most ${cfg.pageLines} matching lines per call, grouped by file; pass offset to page through more.${cfg.mode === 'hashline' ? P.GREP_HASHLINE_NOTE : ' A match counts as having read the file, so it can be edited straight away.'}`,
|
||||
parameters: withOffset(builtin.parameters, 'Skip this many matches (paging; the footer gives the next offset).'),
|
||||
output: {
|
||||
...builtin.output,
|
||||
|
||||
Reference in new issue
Block a user