@malico/opencode-loop 0.1.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 ADDED
@@ -0,0 +1,42 @@
1
+ # opencode-loop
2
+
3
+ Session-tied fixed-delay loops for OpenCode.
4
+
5
+ ```json
6
+ {
7
+ "plugin": ["@malico/opencode-loop"]
8
+ }
9
+ ```
10
+
11
+ For local testing before publish, copy the built plugin into OpenCode's global plugins directory:
12
+
13
+ ```bash
14
+ make install-local
15
+ ```
16
+
17
+ Or reference the built file directly in your config:
18
+
19
+ ```json
20
+ {
21
+ "plugin": ["file:///Users/malico/tinkerbin/opencode-loop/dist/index.js"]
22
+ }
23
+ ```
24
+
25
+ Usage:
26
+
27
+ ```text
28
+ /loop every 5 mins check this
29
+ /loop remember every day to check this
30
+ /loop status
31
+ /loop cancel the current loops
32
+ ```
33
+
34
+ Test locally with `make check`.
35
+
36
+ Intervals are fixed-delay. If a 5 minute loop takes 10 minutes to run, the next run starts 5 minutes after it finishes.
37
+
38
+ New loops queue their first iteration after the current session becomes idle. Completed iterations must include the run-specific `[loop:evidence:<run_id>]` marker requested by the plugin; missing evidence pauses the loop as `unverified`.
39
+
40
+ State is stored in `~/.config/opencode/loops/loops.db`. Loops are tied to OpenCode session IDs.
41
+
42
+ OpenCode's own `opencode.db` is not used for plugin state because plugin APIs do not expose a stable extension table or migration hook. Loop rows store OpenCode `sessionId` so runs can still be linked back to OpenCode sessions.
@@ -0,0 +1,3 @@
1
+ import { type Plugin } from "@opencode-ai/plugin";
2
+ export declare const LoopPlugin: Plugin;
3
+ export default LoopPlugin;