opencode-handoff 0.4.0 → 0.5.0
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 -11
- package/package.json +3 -3
- package/src/tools.ts +5 -0
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Inspired by Amp's handoff command - see their [post](https://ampcode.com/news/ha
|
|
|
13
13
|
|
|
14
14
|
## Requirements
|
|
15
15
|
|
|
16
|
-
- [OpenCode](https://opencode.ai/) v1.
|
|
16
|
+
- [OpenCode](https://opencode.ai/) v1.2.15 or later
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
@@ -31,20 +31,11 @@ Optionally, pin to a specific version for stability:
|
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{
|
|
34
|
-
"plugin": ["opencode-handoff@0.
|
|
34
|
+
"plugin": ["opencode-handoff@0.5.0"]
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
OpenCode fetches unpinned plugins from npm on each startup; pinned versions are cached and require a manual version bump to update.
|
|
39
|
-
### Local Development
|
|
40
|
-
|
|
41
|
-
If you want to customize or contribute:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
git clone https://github.com/joshuadavidthomas/opencode-handoff ~/.config/opencode/opencode-handoff
|
|
45
|
-
mkdir -p ~/.config/opencode/plugin
|
|
46
|
-
ln -sf ~/.config/opencode/opencode-handoff/src/plugin.ts ~/.config/opencode/plugin/handoff.ts
|
|
47
|
-
```
|
|
48
39
|
|
|
49
40
|
## Usage
|
|
50
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-handoff",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create focused handoff prompts for continuing work in new OpenCode sessions",
|
|
6
6
|
"author": "Josh Thomas <josh@joshthomas.dev>",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"typecheck": "tsc --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@opencode-ai/plugin": "^1.
|
|
25
|
-
"@opencode-ai/sdk": "^1.
|
|
24
|
+
"@opencode-ai/plugin": "^1.2.15",
|
|
25
|
+
"@opencode-ai/sdk": "^1.2.15",
|
|
26
26
|
"zod": "^4.1.13"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
package/src/tools.ts
CHANGED
|
@@ -33,6 +33,11 @@ export const HandoffSession = (client: OpencodeClient) => {
|
|
|
33
33
|
: `${sessionReference}\n\n${args.prompt}`
|
|
34
34
|
|
|
35
35
|
await client.tui.executeCommand({ body: { command: "session_new" } })
|
|
36
|
+
// session_new is fire-and-forget (publishes a bus event, returns immediately).
|
|
37
|
+
// The TUI needs time to navigate to the home screen and mount the new prompt
|
|
38
|
+
// input before appendPrompt can insert text — otherwise the event is silently
|
|
39
|
+
// dropped because the input component doesn't exist yet.
|
|
40
|
+
await new Promise(r => setTimeout(r, 150))
|
|
36
41
|
await client.tui.appendPrompt({ body: { text: fullPrompt } })
|
|
37
42
|
|
|
38
43
|
await client.tui.showToast({
|