@plannotator/opencode 0.4.2-beta.0 → 0.4.2-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -865,6 +865,7 @@ export const CursorOverlay: React.FC<CursorOverlayProps> = ({
865
865
 
866
866
  // index.ts
867
867
  var htmlContent = plannotator_default;
868
+ var pendingApproval = null;
868
869
  var PlannotatorPlugin = async (ctx) => {
869
870
  return {
870
871
  "experimental.chat.system.transform": async (_input, output) => {
@@ -884,6 +885,17 @@ based on their feedback and call submit_plan again.
884
885
  Do NOT proceed with implementation until your plan is approved.
885
886
  `);
886
887
  },
888
+ "tool.execute.after": async (input, _output) => {
889
+ if (input.tool === "submit_plan" && pendingApproval?.sessionID === input.sessionID) {
890
+ pendingApproval = null;
891
+ try {
892
+ await ctx.client.session.abort({ path: { id: input.sessionID } });
893
+ await ctx.client.tui.executeCommand({ body: { command: "agent_cycle" } });
894
+ await ctx.client.tui.appendPrompt({ body: { text: "Proceed with implementation" } });
895
+ await ctx.client.tui.showToast({ body: { message: "Press Enter to start building" } });
896
+ } catch {}
897
+ }
898
+ },
887
899
  tool: {
888
900
  submit_plan: tool({
889
901
  description: "Submit your completed plan for interactive user review. The user can annotate, approve, or request changes. Call this when you have finished creating your implementation plan.",
@@ -904,24 +916,10 @@ Do NOT proceed with implementation until your plan is approved.
904
916
  await Bun.sleep(1500);
905
917
  server.stop();
906
918
  if (result.approved) {
907
- try {
908
- await ctx.client.tui.executeCommand({
909
- body: { command: "agent_cycle" }
910
- });
911
- } catch {}
912
- try {
913
- await ctx.client.session.prompt({
914
- path: { id: context.sessionID },
915
- body: {
916
- agent: "build",
917
- parts: [{ type: "text", text: "\u2713 Plan approved - proceed with implementation" }],
918
- noReply: true
919
- }
920
- });
921
- } catch {}
922
- return `Plan approved! Switching to build mode.
919
+ pendingApproval = { sessionID: context.sessionID };
920
+ return `Plan approved!
923
921
 
924
- Your plan has been approved by the user. You may now proceed with implementation.
922
+ Your plan has been approved by the user.
925
923
 
926
924
  Plan Summary: ${args.summary}`;
927
925
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plannotator/opencode",
3
- "version": "0.4.2-beta.0",
3
+ "version": "0.4.2-beta.2",
4
4
  "description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation",
5
5
  "author": "backnotprop",
6
6
  "license": "BSL-1.1",