opencode-readseek 0.10.5 → 0.10.7
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 +22 -6
- package/dist/index.js +16 -16
- package/dist/v2.js +37 -0
- package/package.json +15 -5
package/README.md
CHANGED
|
@@ -13,12 +13,28 @@ For OpenCode with the legacy server plugin API, add the plugin to `opencode.json
|
|
|
13
13
|
}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
OpenCode V2
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
For OpenCode V2, install the package locally:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install --save-dev opencode-readseek
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then select the isolated entrypoint in your project's `opencode.json`:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"plugins": ["./node_modules/opencode-readseek/dist/v2.js"]
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Local plugin modules can also import the default export from `opencode-readseek/v2`.
|
|
31
|
+
This entrypoint does not load the legacy tool implementation. The existing
|
|
32
|
+
`opencode-readseek` and `opencode-readseek/server` entrypoints remain unchanged.
|
|
33
|
+
|
|
34
|
+
The V2 entrypoint supplies a ReadSeek skill and agent guidance only; it does not
|
|
35
|
+
register custom tools. The `readseek_*` tools listed below require the legacy
|
|
36
|
+
server plugin API. To use the V2 skill, install `@jarkkojs/readseek` globally so
|
|
37
|
+
`readseek` is on PATH; otherwise use OpenCode's built-in tools.
|
|
22
38
|
|
|
23
39
|
The plugin uses the AppImage on Linux (without FUSE) and native executables on
|
|
24
40
|
macOS/Windows supplied by `@jarkkojs/readseek`. Set
|
package/dist/index.js
CHANGED
|
@@ -2714,29 +2714,28 @@ function createReadSeekTools(imagePolicy) {
|
|
|
2714
2714
|
}
|
|
2715
2715
|
|
|
2716
2716
|
// v2.ts
|
|
2717
|
-
import { define } from "@opencode-ai/plugin/v2/promise";
|
|
2718
2717
|
var GUIDANCE = "For structural code navigation, consult the readseek skill when ReadSeek tools are unavailable and the readseek CLI is installed.";
|
|
2719
|
-
var
|
|
2720
|
-
id: "
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
skill: {
|
|
2726
|
-
name: "readseek",
|
|
2727
|
-
description: "Use for structural code navigation and anchored edits when the readseek CLI is installed.",
|
|
2728
|
-
location: "/plugin/opencode-readseek/SKILL.md",
|
|
2729
|
-
content: `# ReadSeek CLI
|
|
2718
|
+
var SKILL = {
|
|
2719
|
+
id: "readseek",
|
|
2720
|
+
name: "readseek",
|
|
2721
|
+
description: "Use for structural code navigation and anchored edits when the readseek CLI is installed.",
|
|
2722
|
+
path: "/plugin/opencode-readseek/SKILL.md",
|
|
2723
|
+
content: `# ReadSeek CLI
|
|
2730
2724
|
|
|
2731
2725
|
When ReadSeek tools are unavailable, use the readseek CLI for structural navigation and anchored edits if it is installed and available on PATH. Run \`readseek --help\` to inspect supported commands before invoking them. Get fresh anchors before editing; re-read after external file changes.
|
|
2732
2726
|
|
|
2733
2727
|
This V2 plugin supplies guidance only; it does not register readseek_* tools. If the CLI is unavailable, use OpenCode's built-in tools instead.`
|
|
2734
|
-
|
|
2735
|
-
|
|
2728
|
+
};
|
|
2729
|
+
var ReadSeekV2Plugin = {
|
|
2730
|
+
id: "opencode-readseek",
|
|
2731
|
+
setup: async (ctx) => {
|
|
2732
|
+
await ctx.skill.transform((draft) => {
|
|
2733
|
+
if (!draft.get(SKILL.id))
|
|
2734
|
+
draft.add(SKILL);
|
|
2736
2735
|
});
|
|
2737
2736
|
await ctx.agent.transform((draft) => {
|
|
2738
2737
|
for (const agent of draft.list()) {
|
|
2739
|
-
draft.update(agent.id, (item) => {
|
|
2738
|
+
draft.update(String(agent.id), (item) => {
|
|
2740
2739
|
if (!item.system?.includes(GUIDANCE))
|
|
2741
2740
|
item.system = [item.system, GUIDANCE].filter(Boolean).join(`
|
|
2742
2741
|
|
|
@@ -2745,7 +2744,8 @@ This V2 plugin supplies guidance only; it does not register readseek_* tools. If
|
|
|
2745
2744
|
}
|
|
2746
2745
|
});
|
|
2747
2746
|
}
|
|
2748
|
-
}
|
|
2747
|
+
};
|
|
2748
|
+
var v2_default = ReadSeekV2Plugin;
|
|
2749
2749
|
|
|
2750
2750
|
// index.ts
|
|
2751
2751
|
var ReadSeekPlugin = async (_input, options) => {
|
package/dist/v2.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// v2.ts
|
|
2
|
+
var GUIDANCE = "For structural code navigation, consult the readseek skill when ReadSeek tools are unavailable and the readseek CLI is installed.";
|
|
3
|
+
var SKILL = {
|
|
4
|
+
id: "readseek",
|
|
5
|
+
name: "readseek",
|
|
6
|
+
description: "Use for structural code navigation and anchored edits when the readseek CLI is installed.",
|
|
7
|
+
path: "/plugin/opencode-readseek/SKILL.md",
|
|
8
|
+
content: `# ReadSeek CLI
|
|
9
|
+
|
|
10
|
+
When ReadSeek tools are unavailable, use the readseek CLI for structural navigation and anchored edits if it is installed and available on PATH. Run \`readseek --help\` to inspect supported commands before invoking them. Get fresh anchors before editing; re-read after external file changes.
|
|
11
|
+
|
|
12
|
+
This V2 plugin supplies guidance only; it does not register readseek_* tools. If the CLI is unavailable, use OpenCode's built-in tools instead.`
|
|
13
|
+
};
|
|
14
|
+
var ReadSeekV2Plugin = {
|
|
15
|
+
id: "opencode-readseek",
|
|
16
|
+
setup: async (ctx) => {
|
|
17
|
+
await ctx.skill.transform((draft) => {
|
|
18
|
+
if (!draft.get(SKILL.id))
|
|
19
|
+
draft.add(SKILL);
|
|
20
|
+
});
|
|
21
|
+
await ctx.agent.transform((draft) => {
|
|
22
|
+
for (const agent of draft.list()) {
|
|
23
|
+
draft.update(String(agent.id), (item) => {
|
|
24
|
+
if (!item.system?.includes(GUIDANCE))
|
|
25
|
+
item.system = [item.system, GUIDANCE].filter(Boolean).join(`
|
|
26
|
+
|
|
27
|
+
`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var v2_default = ReadSeekV2Plugin;
|
|
34
|
+
export {
|
|
35
|
+
ReadSeekV2Plugin,
|
|
36
|
+
v2_default as default
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-readseek",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.7",
|
|
4
4
|
"description": "OpenCode plugin for anchored file operations and structural code navigation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
-
"./server": "./dist/index.js"
|
|
9
|
+
"./server": "./dist/index.js",
|
|
10
|
+
"./v2": "./dist/v2.js"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
12
13
|
"opencode",
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
"README.md"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
|
-
"build": "bun build ./index.ts --
|
|
28
|
+
"build": "bun build ./index.ts ./v2.ts --outdir dist --target=node --format=esm --packages=external",
|
|
28
29
|
"prepack": "npm run build",
|
|
29
30
|
"typecheck": "tsc --noEmit"
|
|
30
31
|
},
|
|
@@ -32,13 +33,22 @@
|
|
|
32
33
|
"node": ">=20.0.0"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@jarkkojs/readseek": "^0.10.
|
|
36
|
-
"@jarkkojs/readseek-api": "^0.10.
|
|
36
|
+
"@jarkkojs/readseek": "^0.10.7",
|
|
37
|
+
"@jarkkojs/readseek-api": "^0.10.7",
|
|
37
38
|
"@opencode-ai/plugin": "^1.18.18"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@bgotink/kdl": "0.4.0",
|
|
42
|
+
"@opencode/plugin": "^2.0.26",
|
|
41
43
|
"@types/bun": "^1.3.14",
|
|
42
44
|
"typescript": "^5.9.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@opencode/plugin": "^2.0.26"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@opencode/plugin": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
43
53
|
}
|
|
44
54
|
}
|