opencode-readseek 0.9.9 → 0.9.10
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/README.md +2 -3
- package/dist/index.js +4 -24
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -22,7 +22,6 @@ OpenCode installs the package and its platform-specific
|
|
|
22
22
|
|
|
23
23
|
| Tool | Purpose |
|
|
24
24
|
| ------------------ | ----------------------------------------------------------------------- |
|
|
25
|
-
| `readseek_read` | Read text with `LINE:HASH` anchors; read standalone images |
|
|
26
25
|
| `readseek_edit` | Apply hash-verified edits to an existing text file |
|
|
27
26
|
| `readseek_write` | Create or replace a complete text file |
|
|
28
27
|
| `readseek_grep` | Search text or regex and return anchors |
|
|
@@ -42,8 +41,8 @@ OpenCode is instructed to prefer ReadSeek over the built-in `read`, `edit`,
|
|
|
42
41
|
`write`, `grep`, and `apply_patch` tools when ReadSeek can do the job. Built-ins
|
|
43
42
|
remain available as fallbacks.
|
|
44
43
|
|
|
45
|
-
Documents such as PDFs are owned by `readseek_view`. Calling `
|
|
46
|
-
a document returns a cache receipt and directs the caller to `readseek_view`.
|
|
44
|
+
Documents such as PDFs are owned by `readseek_view`. Calling `readseek_digest`
|
|
45
|
+
on a document returns a cache receipt and directs the caller to `readseek_view`.
|
|
47
46
|
|
|
48
47
|
## Configuration
|
|
49
48
|
|
package/dist/index.js
CHANGED
|
@@ -398,7 +398,6 @@ var TOOL_CONTRACTS = [
|
|
|
398
398
|
];
|
|
399
399
|
// ../readseek-api/src/policy.ts
|
|
400
400
|
var BUILTIN_FALLBACKS = {
|
|
401
|
-
read: "digest",
|
|
402
401
|
edit: "edit",
|
|
403
402
|
write: "write",
|
|
404
403
|
grep: "grep",
|
|
@@ -416,11 +415,10 @@ var PREFERENCE_LEADS = {
|
|
|
416
415
|
view: "Preferred for digesting document structure or selected content."
|
|
417
416
|
};
|
|
418
417
|
var FALLBACK_TEMPLATES = {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
apply_patch: "Fallback only. Prefer `edit` for existing text files."
|
|
418
|
+
edit: "Prefer `edit` with fresh LINE:HASH anchors.",
|
|
419
|
+
write: "Prefer `write` so the result returns LINE:HASH anchors.",
|
|
420
|
+
grep: "Prefer `grep` for text/regex search with edit-ready anchors.",
|
|
421
|
+
apply_patch: "Prefer `edit` for existing text files."
|
|
424
422
|
};
|
|
425
423
|
function resolveToolName(name, aliases = {}) {
|
|
426
424
|
return aliases[name] ?? name;
|
|
@@ -1491,8 +1489,6 @@ async function authorizeEdit(context, filePaths, diff = "", authorizeExternalPat
|
|
|
1491
1489
|
import { tool } from "@opencode-ai/plugin";
|
|
1492
1490
|
function initialTitle(kind, args) {
|
|
1493
1491
|
switch (kind) {
|
|
1494
|
-
case "read":
|
|
1495
|
-
return `Read ${args.path}`;
|
|
1496
1492
|
case "view":
|
|
1497
1493
|
return `View ${args.path}`;
|
|
1498
1494
|
case "digest":
|
|
@@ -1516,22 +1512,6 @@ function initialTitle(kind, args) {
|
|
|
1516
1512
|
function resultPresentation(kind, args, value) {
|
|
1517
1513
|
const output = record(value);
|
|
1518
1514
|
switch (kind) {
|
|
1519
|
-
case "read": {
|
|
1520
|
-
const startLine = output.start_line;
|
|
1521
|
-
const endLine = output.end_line;
|
|
1522
|
-
if (typeof startLine === "number" && typeof endLine === "number") {
|
|
1523
|
-
return {
|
|
1524
|
-
title: `Read ${args.path}:${startLine}-${endLine}`,
|
|
1525
|
-
metadata: { start_line: startLine, end_line: endLine, line_count: endLine - startLine + 1 }
|
|
1526
|
-
};
|
|
1527
|
-
}
|
|
1528
|
-
const width = output.width;
|
|
1529
|
-
const height = output.height;
|
|
1530
|
-
if (typeof width === "number" && typeof height === "number") {
|
|
1531
|
-
return { title: `Read ${args.path} (${width}x${height})`, metadata: { width, height } };
|
|
1532
|
-
}
|
|
1533
|
-
break;
|
|
1534
|
-
}
|
|
1535
1515
|
case "view":
|
|
1536
1516
|
return { title: `Viewed ${args.path}`, metadata: {} };
|
|
1537
1517
|
case "digest": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-readseek",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.10",
|
|
4
4
|
"description": "OpenCode plugin for anchored file operations and structural code navigation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://
|
|
19
|
+
"url": "git+https://gitlab.com/jarkkojs/readseek.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"files": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=20.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@jarkkojs/readseek": "^0.9.
|
|
36
|
+
"@jarkkojs/readseek": "^0.9.10",
|
|
37
37
|
"@opencode-ai/plugin": "^1.17.20"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|