MCPcopy Create free account
hub / github.com/backnotprop/plannotator / handleEmbeddedCommand

Function handleEmbeddedCommand

apps/opencode-plugin/embedded.ts:73–107  ·  view source on GitHub ↗
(
  command: string,
  event: any,
  deps: {
    client: any;
    htmlContent: string;
    reviewHtmlContent: string;
    getSharingEnabled: () => Promise<boolean>;
    getShareBaseUrl: () => string | undefined;
    getPasteApiUrl: () => string | undefined;
    directory?: string;
  },
)

Source from the content-addressed store, hash-verified

71}
72
73export async function handleEmbeddedCommand(
74 command: string,
75 event: any,
76 deps: {
77 client: any;
78 htmlContent: string;
79 reviewHtmlContent: string;
80 getSharingEnabled: () => Promise<boolean>;
81 getShareBaseUrl: () => string | undefined;
82 getPasteApiUrl: () => string | undefined;
83 directory?: string;
84 },
85): Promise<{ feedback?: string | null }> {
86 const {
87 handleReviewCommand,
88 handleAnnotateCommand,
89 handleAnnotateLastCommand,
90 } = await loadCommandHandlers();
91
92 if (command === "plannotator-last") {
93 return { feedback: await handleAnnotateLastCommand(event, deps) };
94 }
95
96 if (command === "plannotator-annotate") {
97 await handleAnnotateCommand(event, deps);
98 return {};
99 }
100
101 if (command === "plannotator-review") {
102 await handleReviewCommand(event, deps);
103 return {};
104 }
105
106 return {};
107}

Callers

nothing calls this directly

Calls 4

loadCommandHandlersFunction · 0.85
handleAnnotateCommandFunction · 0.85
handleReviewCommandFunction · 0.85

Tested by

no test coverage detected