@plannotator/opencode 0.19.8 → 0.19.10

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
@@ -38,10 +38,11 @@ Restart OpenCode. By default, the `submit_plan` tool is available to OpenCode's
38
38
 
39
39
  ## Workflow Modes
40
40
 
41
- Plannotator supports three OpenCode workflows:
41
+ Plannotator supports four OpenCode workflows:
42
42
 
43
43
  - **`plan-agent`** (default): `submit_plan` is available to OpenCode's built-in `plan` agent plus any extra agents listed in `planningAgents`. This keeps Plannotator integrated with OpenCode plan mode without nudging `build` to call it.
44
44
  - **`manual`**: `submit_plan` is not registered. Use `/plannotator-last`, `/plannotator-annotate`, `/plannotator-review`, and `/plannotator-archive` when you want Plannotator.
45
+ - **`user-managed`**: `submit_plan` is registered but no prompts or agent permissions are modified. You manage which agents can call `submit_plan` via OpenCode's native agent configuration.
45
46
  - **`all-agents`**: legacy broad behavior. Primary agents can see and call `submit_plan`.
46
47
 
47
48
  Default config:
@@ -103,6 +104,19 @@ Use commands only:
103
104
  }
104
105
  ```
105
106
 
107
+ Register the tool but manage prompts and permissions yourself:
108
+
109
+ ```json
110
+ {
111
+ "$schema": "https://opencode.ai/config.json",
112
+ "plugin": [
113
+ ["@plannotator/opencode@latest", {
114
+ "workflow": "user-managed"
115
+ }]
116
+ ]
117
+ }
118
+ ```
119
+
106
120
  ## How It Works
107
121
 
108
122
  1. The configured planning agent calls `submit_plan` → Plannotator opens in your browser
package/dist/index.js CHANGED
@@ -67277,7 +67277,7 @@ function stripConflictingPlanModeRules(systemEntries) {
67277
67277
  }
67278
67278
 
67279
67279
  // workflow.ts
67280
- var WORKFLOWS = new Set(["manual", "plan-agent", "all-agents"]);
67280
+ var WORKFLOWS = new Set(["manual", "user-managed", "plan-agent", "all-agents"]);
67281
67281
  var DEFAULT_WORKFLOW = "plan-agent";
67282
67282
  var BUILTIN_PLAN_AGENT = "plan";
67283
67283
  function normalizeWorkflowOptions(rawOptions) {
@@ -67313,11 +67313,14 @@ function isPlanningAgent(agentName, options) {
67313
67313
  function shouldRegisterSubmitPlan(options) {
67314
67314
  return options.workflow !== "manual";
67315
67315
  }
67316
+ function shouldModifyPrompts(options) {
67317
+ return options.workflow !== "manual" && options.workflow !== "user-managed";
67318
+ }
67316
67319
  function shouldApplyToolDefinitionRewrites(options) {
67317
- return options.workflow !== "manual";
67320
+ return options.workflow !== "manual" && options.workflow !== "user-managed";
67318
67321
  }
67319
67322
  function shouldInjectFullPlanningPrompt(agentName, options) {
67320
- return options.workflow !== "manual" && isPlanningAgent(agentName, options);
67323
+ return shouldModifyPrompts(options) && isPlanningAgent(agentName, options);
67321
67324
  }
67322
67325
  function shouldInjectGenericPlanReminder(agentName, isSubagent, options) {
67323
67326
  if (options.workflow !== "all-agents")
@@ -67332,7 +67335,7 @@ function shouldRejectSubmitPlanForAgent(agentName, options) {
67332
67335
  return options.workflow === "plan-agent" && !isPlanningAgent(agentName, options);
67333
67336
  }
67334
67337
  function applyWorkflowConfig(opencodeConfig, options, allowSubagents) {
67335
- if (options.workflow === "manual")
67338
+ if (options.workflow === "manual" || options.workflow === "user-managed")
67336
67339
  return;
67337
67340
  if (!allowSubagents) {
67338
67341
  const existingPrimaryTools = opencodeConfig.experimental?.primary_tools ?? [];
@@ -67531,7 +67534,7 @@ var PlannotatorPlugin = async (ctx, rawOptions) => {
67531
67534
  applyWorkflowConfig(opencodeConfig, workflowOptions, allowSubagents());
67532
67535
  },
67533
67536
  "experimental.chat.messages.transform": async (input, output) => {
67534
- if (workflowOptions.workflow === "manual")
67537
+ if (!shouldModifyPrompts(workflowOptions))
67535
67538
  return;
67536
67539
  const lastUserAgent = getLastUserAgentFromMessages(output.messages);
67537
67540
  if (workflowOptions.workflow === "plan-agent" && !isPlanningAgent(lastUserAgent, workflowOptions)) {
@@ -67576,7 +67579,7 @@ tools (except writing markdown files), or otherwise make changes to the system.
67576
67579
  }
67577
67580
  },
67578
67581
  "experimental.chat.system.transform": async (input, output) => {
67579
- if (workflowOptions.workflow === "manual")
67582
+ if (!shouldModifyPrompts(workflowOptions))
67580
67583
  return;
67581
67584
  const systemText = output.system.join(`
67582
67585
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plannotator/opencode",
3
- "version": "0.19.8",
3
+ "version": "0.19.10",
4
4
  "description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation",
5
5
  "author": "backnotprop",
6
6
  "license": "MIT OR Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@opencode-ai/plugin": "^1.1.10"
39
39
  },
40
40
  "devDependencies": {
41
- "@plannotator/server": "0.19.8",
41
+ "@plannotator/server": "0.19.10",
42
42
  "@plannotator/shared": "0.0.1"
43
43
  },
44
44
  "peerDependencies": {