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

Function getSharingEnabled

apps/opencode-plugin/index.ts:289–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287 let cachedAgents: any[] | null = null;
288
289 async function getSharingEnabled(): Promise<boolean> {
290 try {
291 const response = await ctx.client.config.get({ query: { directory: ctx.directory } });
292 // @ts-ignore - share config may exist
293 const share = response?.data?.share;
294 if (share !== undefined) {
295 return share !== "disabled";
296 }
297 } catch {
298 // Config read failed, fall through to env var / plannotator config
299 }
300 return resolveSharingEnabled(loadConfig());
301 }
302
303 function getShareBaseUrl(): string | undefined {
304 return process.env.PLANNOTATOR_SHARE_URL || undefined;

Callers 5

getBridgeContextFunction · 0.85
executeFunction · 0.85
handleReviewCommandFunction · 0.85
handleAnnotateCommandFunction · 0.85

Calls 3

resolveSharingEnabledFunction · 0.90
loadConfigFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected