@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.
- package/CHANGELOG.md +51 -0
- package/LICENSE +21 -0
- package/README.md +706 -0
- package/commands/loop-clear.md +5 -0
- package/commands/loop-compact.md +5 -0
- package/commands/loop-dev.md +5 -0
- package/commands/loop-doctor.md +5 -0
- package/commands/loop-export.md +5 -0
- package/commands/loop-help.md +5 -0
- package/commands/loop-init.md +5 -0
- package/commands/loop-logs.md +5 -0
- package/commands/loop-now.md +5 -0
- package/commands/loop-pause.md +5 -0
- package/commands/loop-progress.md +5 -0
- package/commands/loop-remove.md +5 -0
- package/commands/loop-resume.md +5 -0
- package/commands/loop-safe-dev.md +5 -0
- package/commands/loop-status.md +5 -0
- package/commands/loop-stop.md +5 -0
- package/commands/loop-testfix.md +5 -0
- package/commands/loop.md +5 -0
- package/examples/opencode.json +40 -0
- package/package.json +57 -0
- package/scripts/install-node.mjs +23 -0
- package/scripts/install.ps1 +17 -0
- package/scripts/install.sh +16 -0
- package/scripts/make-zip.mjs +7 -0
- package/src/index.js +846 -0
package/commands/loop.md
ADDED
|
@@ -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)
|