opencode-routines 0.1.5 → 0.1.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 +11 -6
- package/dist/tui.js +0 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,16 +34,21 @@ Add the server plugin to your OpenCode config (`~/.config/opencode/opencode.json
|
|
|
34
34
|
|
|
35
35
|
OpenCode installs the package from npm on next start. Use `@latest` if you want new versions on restart, or pin a version such as `"opencode-routines@0.1.1"`.
|
|
36
36
|
|
|
37
|
-
Optional TUI slash commands are published as a companion package
|
|
37
|
+
Optional TUI slash commands are published as a companion package, `opencode-routines-tui`. It is a **TUI plugin**, which OpenCode loads from `tui.json` — NOT from `opencode.json`'s `plugin` array (that array is for server plugins only; the server loader will reject it with `must default export an object with server()`).
|
|
38
|
+
|
|
39
|
+
Add it to `~/.config/opencode/tui.json` (or a project-level `.opencode/tui.json`, or a custom path via the `OPENCODE_TUI_CONFIG` env var):
|
|
38
40
|
|
|
39
41
|
```jsonc
|
|
42
|
+
// ~/.config/opencode/tui.json
|
|
40
43
|
{
|
|
41
|
-
"$schema": "https://opencode.ai/
|
|
42
|
-
"plugin": ["opencode-routines
|
|
44
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
45
|
+
"plugin": ["opencode-routines-tui@latest"]
|
|
43
46
|
}
|
|
44
47
|
```
|
|
45
48
|
|
|
46
|
-
`opencode-routines-tui` is separate so
|
|
49
|
+
`opencode-routines-tui` is separate so the terminal TUI can install and load the TUI plugin entrypoint (`exports["./tui"]`). The root package still ships a `./tui` export for advanced/manual loaders, but installs should use the companion package via `tui.json`.
|
|
50
|
+
|
|
51
|
+
TUI slash commands currently work in the **terminal TUI** (`opencode` in a terminal). OpenCode Desktop builds its slash list from a different command registry and does not load `tui.json` TUI plugins, so these slash commands do not appear there yet.
|
|
47
52
|
|
|
48
53
|
## What it provides
|
|
49
54
|
|
|
@@ -131,7 +136,7 @@ Legacy compatibility tools from `opencode-scheduler` are still present: `schedul
|
|
|
131
136
|
|
|
132
137
|
## TUI slash commands
|
|
133
138
|
|
|
134
|
-
Available when `opencode-routines-tui` is installed:
|
|
139
|
+
Available in the terminal TUI when `opencode-routines-tui` is installed via `tui.json` (see Install above):
|
|
135
140
|
|
|
136
141
|
| Command | Meaning |
|
|
137
142
|
|---|---|
|
|
@@ -165,7 +170,7 @@ Standalone schedule backends:
|
|
|
165
170
|
|
|
166
171
|
- Requires OpenCode `1.17.3` or newer.
|
|
167
172
|
- OpenCode loads config once at startup. Restart OpenCode after changing plugin configuration.
|
|
168
|
-
- `opencode-routines-tui` requires OpenCode's TUI plugin runtime.
|
|
173
|
+
- `opencode-routines-tui` requires OpenCode's terminal TUI plugin runtime and is loaded via `tui.json`, not `opencode.json`. OpenCode Desktop does not load TUI plugins yet — there, install only `opencode-routines`.
|
|
169
174
|
- `CronCreate({ durable: true })` is accepted for Claude Code compatibility but currently behaves as session-only.
|
|
170
175
|
|
|
171
176
|
## Debugging
|
package/dist/tui.js
CHANGED
|
@@ -155,48 +155,11 @@ function showStandaloneSchedulesHelp(api) {
|
|
|
155
155
|
message: "Use the ScheduleCreate tool (or natural language like 'create a standalone scheduled run...') to create durable OS-backed standalone sessions. The ambiguous /schedule command is intentionally not registered."
|
|
156
156
|
}));
|
|
157
157
|
}
|
|
158
|
-
function legacyCommands(api) {
|
|
159
|
-
return [
|
|
160
|
-
{
|
|
161
|
-
title: "Start same-session loop",
|
|
162
|
-
value: "routines.loop",
|
|
163
|
-
description: "Start a same-session loop. Fixed: 5m <prompt>; dynamic: <prompt>.",
|
|
164
|
-
category: "Scheduler",
|
|
165
|
-
slash: { name: "loop" },
|
|
166
|
-
onSelect: () => openLoopPrompt(api)
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
title: "List active loops",
|
|
170
|
-
value: "routines.loops",
|
|
171
|
-
description: "List and stop active same-session loops.",
|
|
172
|
-
category: "Scheduler",
|
|
173
|
-
slash: { name: "loops" },
|
|
174
|
-
onSelect: () => showLoops(api)
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
title: "Stop a same-session loop",
|
|
178
|
-
value: "routines.stop-loop",
|
|
179
|
-
description: "List active loops and select one to stop.",
|
|
180
|
-
category: "Scheduler",
|
|
181
|
-
slash: { name: "stop-loop" },
|
|
182
|
-
onSelect: () => showLoops(api)
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
title: "Create standalone scheduled session",
|
|
186
|
-
value: "routines.schedule-standalone-session",
|
|
187
|
-
description: "Show help for durable OS-backed standalone schedules.",
|
|
188
|
-
category: "Scheduler",
|
|
189
|
-
slash: { name: "schedule-standalone-session" },
|
|
190
|
-
onSelect: () => showStandaloneSchedulesHelp(api)
|
|
191
|
-
}
|
|
192
|
-
];
|
|
193
|
-
}
|
|
194
158
|
var tui = async (api) => {
|
|
195
159
|
api.lifecycle.onDispose(() => {
|
|
196
160
|
for (const id of [...loops.keys()])
|
|
197
161
|
stopLoop(id);
|
|
198
162
|
});
|
|
199
|
-
api.command?.register(() => legacyCommands(api));
|
|
200
163
|
api.keymap.registerLayer({
|
|
201
164
|
commands: [
|
|
202
165
|
{
|
package/package.json
CHANGED