@bybrawe/opencode-loop 0.5.12 → 0.5.13

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.13
4
+
5
+ - Wrapped experimental goal tools with `tool()` and Zod schemas for current OpenCode tool validation.
6
+ - Added `@opencode-ai/plugin` as a dev dependency so fresh clones can resolve the tool helper during local development.
7
+
3
8
  ## 0.5.12
4
9
 
5
10
  - Fixed local plugin installs to write `opencode-loop.ts`, matching OpenCode local plugin discovery.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bybrawe/opencode-loop",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "Claude Code/Codex style /loop and experimental goal mode for OpenCode: heartbeat scheduler, idle-safe loops, scheduled commands, compact scheduling, verification, checkpoints, and persistent coding goals.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -54,6 +54,9 @@
54
54
  "peerDependencies": {
55
55
  "@opencode-ai/plugin": ">=1.4.0"
56
56
  },
57
+ "devDependencies": {
58
+ "@opencode-ai/plugin": "^1.4.0"
59
+ },
57
60
  "bin": {
58
61
  "opencode-loop": "scripts/install-node.mjs",
59
62
  "opencode-loopd": "scripts/loopd.mjs"
package/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { promises as fs } from "node:fs"
2
2
  import path from "node:path"
3
3
  import { spawn } from "node:child_process"
4
+ import { tool } from "@opencode-ai/plugin/tool"
4
5
 
5
6
  const SERVICE = "opencode-loop"
6
7
  const STATE_DIR = ".opencode/opencode-loop"
@@ -1640,39 +1641,39 @@ async function handleCommand(directory, client, input, fallbackName, fallbackArg
1640
1641
 
1641
1642
  function goalTools(defaultDirectory) {
1642
1643
  return {
1643
- opencode_loop_goal_complete: {
1644
+ opencode_loop_goal_complete: tool({
1644
1645
  description: "Mark the current OpenCode Loop experimental goal as completed. Use only after acceptance criteria are satisfied and you have evidence from tests, typecheck, build, or code inspection.",
1645
1646
  args: {
1646
- summary: { type: "string", description: "Short human-readable summary of what was completed." },
1647
- evidence: { type: "string", description: "Concrete evidence that the goal is complete, such as commands run, passing checks, files changed, and important results." },
1647
+ summary: tool.schema.string().describe("Short human-readable summary of what was completed."),
1648
+ evidence: tool.schema.string().describe("Concrete evidence that the goal is complete, such as commands run, passing checks, files changed, and important results."),
1648
1649
  },
1649
1650
  execute: async (args, context) => {
1650
1651
  const result = await setGoalComplete(context.directory || defaultDirectory, context.sessionID, args)
1651
1652
  return { title: result.ok ? "Goal completed" : "Goal not found", output: result.message }
1652
1653
  },
1653
- },
1654
- opencode_loop_goal_blocked: {
1654
+ }),
1655
+ opencode_loop_goal_blocked: tool({
1655
1656
  description: "Mark the current OpenCode Loop experimental goal as blocked when user input or manual intervention is required.",
1656
1657
  args: {
1657
- reason: { type: "string", description: "Why the goal is blocked." },
1658
- needed: { type: "string", description: "What user input, credential, decision, or manual action is needed to continue." },
1658
+ reason: tool.schema.string().describe("Why the goal is blocked."),
1659
+ needed: tool.schema.string().describe("What user input, credential, decision, or manual action is needed to continue."),
1659
1660
  },
1660
1661
  execute: async (args, context) => {
1661
1662
  const result = await setGoalBlocked(context.directory || defaultDirectory, context.sessionID, args)
1662
1663
  return { title: result.ok ? "Goal blocked" : "Goal not found", output: result.message }
1663
1664
  },
1664
- },
1665
- opencode_loop_goal_progress: {
1665
+ }),
1666
+ opencode_loop_goal_progress: tool({
1666
1667
  description: "Record meaningful progress on the current OpenCode Loop experimental goal without completing it.",
1667
1668
  args: {
1668
- summary: { type: "string", description: "What useful progress was made." },
1669
- next: { type: "string", description: "The next step toward completing the goal." },
1669
+ summary: tool.schema.string().describe("What useful progress was made."),
1670
+ next: tool.schema.string().describe("The next step toward completing the goal."),
1670
1671
  },
1671
1672
  execute: async (args, context) => {
1672
1673
  const result = await setGoalProgress(context.directory || defaultDirectory, context.sessionID, args)
1673
1674
  return { title: result.ok ? "Goal progress" : "Goal not found", output: result.message }
1674
1675
  },
1675
- },
1676
+ }),
1676
1677
  }
1677
1678
  }
1678
1679