@bybrawe/opencode-loop 0.4.2

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Preset dev loop. Usage: /loop-dev 0s, /loop-dev 5m optional extra instruction
3
+ ---
4
+
5
+ OpenCode Loop dev preset. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Diagnose the OpenCode Loop plugin installation and current session state.
3
+ ---
4
+
5
+ Plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Export the current session loop state as JSON.
3
+ ---
4
+
5
+ Plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Show OpenCode Loop help and examples.
3
+ ---
4
+
5
+ OpenCode Loop help command. The plugin handles this command.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Create a starter progress.md file for autonomous OpenCode loop workflows.
3
+ ---
4
+
5
+ Plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Show recent OpenCode Loop log entries.
3
+ ---
4
+
5
+ OpenCode Loop logs command. The plugin handles this command.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Run loop jobs immediately. Usage: /loop-now, /loop-now <id|name|number>
3
+ ---
4
+
5
+ OpenCode Loop run-now command. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Pause loop jobs. Usage: /loop-pause, /loop-pause <id|name|number|all>
3
+ ---
4
+
5
+ OpenCode Loop pause command. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Preset progress.md loop. Usage: /loop-progress 0s or /loop-progress 5m
3
+ ---
4
+
5
+ OpenCode Loop progress preset. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Remove loop jobs. Alias of /loop-stop. Usage: /loop-remove <id|name|number|all>
3
+ ---
4
+
5
+ OpenCode Loop remove command. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Resume loop jobs. Usage: /loop-resume, /loop-resume <id|name|number|all>
3
+ ---
4
+
5
+ OpenCode Loop resume command. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Preset safe dev loop with ask-never, safe mode, batch 5 and checkpoint-only. Usage: /loop-safe-dev 0s
3
+ ---
4
+
5
+ OpenCode Loop safe-dev preset. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Show active OpenCode loop jobs for this session.
3
+ ---
4
+
5
+ OpenCode Loop status command. The plugin handles this command.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Stop loop jobs. Usage: /loop-stop, /loop-stop all, /loop-stop <id|name|number>
3
+ ---
4
+
5
+ OpenCode Loop stop command. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Preset test-fix loop. Usage: /loop-testfix 0s "npm test"
3
+ ---
4
+
5
+ OpenCode Loop test-fix preset. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Start an OpenCode idle/interval loop. Usage: /loop 0s prompt, /loop 5m --safe --ask-never prompt, /loop 200m /compact, /loop --watch progress.md prompt
3
+ ---
4
+
5
+ OpenCode Loop command. The plugin handles this command. Arguments: $ARGUMENTS
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "plugin": [
4
+ "@bybrawe/opencode-loop",
5
+ "@tarquinen/opencode-dcp@latest"
6
+ ],
7
+ "permission": {
8
+ "read": "allow",
9
+ "grep": "allow",
10
+ "glob": "allow",
11
+ "todowrite": "allow",
12
+ "edit": "allow",
13
+ "webfetch": "allow",
14
+ "websearch": "allow",
15
+ "bash": {
16
+ "*": "ask",
17
+ "dir*": "allow",
18
+ "ls*": "allow",
19
+ "pwd*": "allow",
20
+ "git status*": "allow",
21
+ "git diff*": "allow",
22
+ "git log*": "allow",
23
+ "npm test*": "allow",
24
+ "npm run test*": "allow",
25
+ "npm run lint*": "allow",
26
+ "pnpm test*": "allow",
27
+ "pnpm lint*": "allow",
28
+ "git add*": "ask",
29
+ "git commit*": "ask",
30
+ "git push*": "ask",
31
+ "git reset*": "ask",
32
+ "git clean*": "deny",
33
+ "rm *": "deny",
34
+ "del *": "ask",
35
+ "rmdir *": "ask",
36
+ "terraform destroy*": "deny"
37
+ },
38
+ "external_directory": "ask"
39
+ }
40
+ }
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@bybrawe/opencode-loop",
3
+ "version": "0.4.2",
4
+ "description": "Claude Code style auto-continue /loop command for OpenCode: autonomous loops, compact scheduling, progress.md TODO automation, verification, checkpoints, and safe long-running coding sessions.",
5
+ "type": "module",
6
+ "main": "src/index.js",
7
+ "exports": {
8
+ ".": "./src/index.js"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "commands",
13
+ "scripts",
14
+ "examples",
15
+ "README.md",
16
+ "LICENSE",
17
+ "CHANGELOG.md"
18
+ ],
19
+ "scripts": {
20
+ "check": "node --check src/index.js",
21
+ "install:global": "node scripts/install-node.mjs",
22
+ "pack:zip": "node scripts/make-zip.mjs"
23
+ },
24
+ "keywords": [
25
+ "opencode",
26
+ "opencode-plugin",
27
+ "opencode-loop",
28
+ "claude-code",
29
+ "claude-code-loop",
30
+ "loop",
31
+ "auto-continue",
32
+ "autonomous-coding",
33
+ "ai-coding-agent",
34
+ "compact",
35
+ "checkpoint",
36
+ "scheduler",
37
+ "progress-md",
38
+ "todo-automation",
39
+ "ralph-loop"
40
+ ],
41
+ "author": "ByBrawe",
42
+ "license": "MIT",
43
+ "homepage": "https://github.com/ByBrawe/opencode-loop#readme",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/ByBrawe/opencode-loop.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/ByBrawe/opencode-loop/issues"
50
+ },
51
+ "peerDependencies": {
52
+ "@opencode-ai/plugin": ">=1.4.0"
53
+ },
54
+ "bin": {
55
+ "opencode-loop": "./scripts/install-node.mjs"
56
+ }
57
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { copyFile, mkdir, readdir } from "node:fs/promises"
3
+ import { homedir } from "node:os"
4
+ import { dirname, join } from "node:path"
5
+ import { fileURLToPath } from "node:url"
6
+
7
+ const root = dirname(dirname(fileURLToPath(import.meta.url)))
8
+ const config = process.env.OPENCODE_CONFIG_DIR || join(homedir(), ".config", "opencode")
9
+ const pluginDir = join(config, "plugins")
10
+ const commandDir = join(config, "commands")
11
+
12
+ await mkdir(pluginDir, { recursive: true })
13
+ await mkdir(commandDir, { recursive: true })
14
+ await copyFile(join(root, "src", "index.js"), join(pluginDir, "opencode-loop.js"))
15
+
16
+ for (const name of await readdir(join(root, "commands"))) {
17
+ if (name.endsWith(".md")) {
18
+ await copyFile(join(root, "commands", name), join(commandDir, name))
19
+ }
20
+ }
21
+
22
+ console.log(`Installed OpenCode Loop plugin to ${config}`)
23
+ console.log("Restart OpenCode, then run: /loop-help")
@@ -0,0 +1,17 @@
1
+ $ErrorActionPreference = "Stop"
2
+
3
+ $ConfigDir = Join-Path $env:USERPROFILE ".config\opencode"
4
+ $PluginDir = Join-Path $ConfigDir "plugins"
5
+ $CommandDir = Join-Path $ConfigDir "commands"
6
+ $Root = Split-Path -Parent $PSScriptRoot
7
+
8
+ New-Item -ItemType Directory -Force -Path $PluginDir | Out-Null
9
+ New-Item -ItemType Directory -Force -Path $CommandDir | Out-Null
10
+
11
+ Copy-Item -Force (Join-Path $Root "src\index.js") (Join-Path $PluginDir "opencode-loop.js")
12
+ Copy-Item -Force (Join-Path $Root "commands\*.md") $CommandDir
13
+
14
+ Write-Host "Installed OpenCode Loop plugin." -ForegroundColor Green
15
+ Write-Host "Plugin: $PluginDir\opencode-loop.js"
16
+ Write-Host "Commands: $CommandDir\loop*.md"
17
+ Write-Host "Restart OpenCode, then run: /loop-help"
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ CONFIG_DIR="${OPENCODE_CONFIG_DIR:-$HOME/.config/opencode}"
5
+ PLUGIN_DIR="$CONFIG_DIR/plugins"
6
+ COMMAND_DIR="$CONFIG_DIR/commands"
7
+ ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
8
+
9
+ mkdir -p "$PLUGIN_DIR" "$COMMAND_DIR"
10
+ cp "$ROOT_DIR/src/index.js" "$PLUGIN_DIR/opencode-loop.js"
11
+ cp "$ROOT_DIR/commands"/*.md "$COMMAND_DIR/"
12
+
13
+ echo "Installed OpenCode Loop plugin."
14
+ echo "Plugin: $PLUGIN_DIR/opencode-loop.js"
15
+ echo "Commands: $COMMAND_DIR/loop*.md"
16
+ echo "Restart OpenCode, then run: /loop-help"
@@ -0,0 +1,7 @@
1
+ import { spawnSync } from "node:child_process"
2
+ import { readFileSync } from "node:fs"
3
+
4
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"))
5
+ const name = `${pkg.name}-v${pkg.version}.zip`
6
+ const result = spawnSync("zip", ["-r", name, ".", "-x", "*.git*", "node_modules/*"], { stdio: "inherit" })
7
+ process.exit(result.status ?? 0)