MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / buildPluginInput

Function buildPluginInput

crates/opencode-plugin/host/plugin-host.ts:370–392  ·  view source on GitHub ↗
(context: PluginContext, client: unknown)

Source from the content-addressed store, hash-verified

368}
369
370function buildPluginInput(context: PluginContext, client: unknown): UnknownRecord {
371 let serverUrl: string | URL = context.serverUrl;
372 try {
373 serverUrl = new URL(context.serverUrl);
374 } catch {
375 // Keep as string if URL parsing fails.
376 }
377
378 return {
379 // Legacy Rust host shape (already used by some plugins)
380 context,
381 // TS plugin ecosystem shape
382 client,
383 directory: context.directory,
384 worktree: context.worktree,
385 serverUrl,
386 project: {
387 directory: context.directory,
388 worktree: context.worktree,
389 },
390 $: createShell(),
391 };
392}
393
394// ---------------------------------------------------------------------------
395// Handlers

Callers 1

handleInitializeFunction · 0.85

Calls 1

createShellFunction · 0.85

Tested by

no test coverage detected