@prevalentware/opencode-goal-plugin 0.1.12 → 0.1.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/README.md CHANGED
@@ -6,7 +6,7 @@ This plugin adds:
6
6
 
7
7
  - `/goal <objective>` as an OpenCode command for TUI, desktop, and web.
8
8
  - A sidebar goal indicator with status, elapsed time, and objective.
9
- - Agent tools: `get_goal`, `create_goal`, `update_goal`, and `clear_goal`.
9
+ - Agent tools: `get_goal`, `create_goal`, `set_goal`, `update_goal`, and `clear_goal`.
10
10
  - Goal close evidence: `complete` requires verified evidence, and `unmet` requires a concrete blocker.
11
11
  - Persistent per-session goal state.
12
12
  - Optional automatic continuation on `session.idle`.
@@ -85,6 +85,8 @@ Use `/goal <objective>` in a fresh OpenCode chat to create a long-running goal:
85
85
 
86
86
  Bare `/goal` reports the current goal state. `/goal clear` clears the goal. The TUI also includes a `Goal` command-palette entry for viewing, refreshing, or clearing the current goal state without creating a new goal.
87
87
 
88
+ You can also ask the agent to formulate the objective and call `set_goal` itself, for example: "set your own goal to finish this refactor safely." The tool uses the agent-written objective but still only creates a goal when explicitly requested.
89
+
88
90
  When writing the objective, include the scope, non-goals, and verification path when they matter. The agent is reminded to audit real files, command output, tests, or PR state before closing the goal.
89
91
 
90
92
  The `update_goal` tool can close a goal in two ways:
package/dist/server.js CHANGED
@@ -312,9 +312,9 @@ Do not rely on intent, partial progress, elapsed effort, memory of earlier work,
312
312
  }
313
313
  function systemReminder(goal) {
314
314
  if (!goal) {
315
- return `OpenCode goal mode is available through get_goal, create_goal, and update_goal tools.
315
+ return `OpenCode goal mode is available through get_goal, create_goal, set_goal, and update_goal tools.
316
316
 
317
- Create a goal only when explicitly requested by the user or system/developer instructions. Do not infer goals from ordinary tasks. When closing a goal, update_goal requires evidence for status "complete" or a blocker for status "unmet".`;
317
+ Create a goal only when explicitly requested by the user or system/developer instructions. Use set_goal when the user asks you to formulate and set your own goal. Do not infer goals from ordinary tasks. When closing a goal, update_goal requires evidence for status "complete" or a blocker for status "unmet".`;
318
318
  }
319
319
  if (goal.status === "active")
320
320
  return continuationPrompt(goal);
@@ -457,6 +457,17 @@ var server = async ({ client }, options) => {
457
457
  return JSON.stringify({ goal }, null, 2);
458
458
  }
459
459
  },
460
+ set_goal: {
461
+ description: "Set a new goal when the user explicitly asks the agent to formulate and set its own goal. The model should write the objective itself based on the user's explicit request. Fails if a non-complete goal exists.",
462
+ args: {
463
+ objective: z.string().min(1).max(4000).describe("The model-formulated concrete objective to start pursuing.")
464
+ },
465
+ async execute(args, context) {
466
+ const input = args;
467
+ const goal = await createGoal(context.sessionID, input.objective);
468
+ return JSON.stringify({ goal }, null, 2);
469
+ }
470
+ },
460
471
  update_goal: {
461
472
  description: "Close the existing goal only after an audit against real evidence. Use status complete only when the objective is achieved and no required work remains, and include evidence. Use status unmet only when the objective cannot be achieved or is blocked, and include the blocker. Do not close a goal merely because work is stopping.",
462
473
  args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prevalentware/opencode-goal-plugin",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Codex-style long-running goal mode for OpenCode.",
5
5
  "keywords": [
6
6
  "opencode",