@plannotator/opencode 0.4.2-beta.1 → 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 +16 -14
  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,20 +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
- setTimeout(async () => {
913
- try {
914
- await ctx.client.tui.appendPrompt({
915
- body: { text: "\u2713 Proceed with implementation" }
916
- });
917
- await ctx.client.tui.submitPrompt({});
918
- } catch {}
919
- }, 500);
920
- return `Plan approved! Switching to build mode. Please wait...
919
+ pendingApproval = { sessionID: context.sessionID };
920
+ return `Plan approved!
921
+
922
+ Your plan has been approved by the user.
921
923
 
922
924
  Plan Summary: ${args.summary}`;
923
925
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plannotator/opencode",
3
- "version": "0.4.2-beta.1",
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",