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

Function injectSessionPrompt

apps/opencode-plugin/cli-bridge.ts:361–380  ·  view source on GitHub ↗
(
  client: OpenCodeClient,
  sessionId: string | undefined,
  text: string,
  options?: { agent?: string; noReply?: boolean },
)

Source from the content-addressed store, hash-verified

359}
360
361async function injectSessionPrompt(
362 client: OpenCodeClient,
363 sessionId: string | undefined,
364 text: string,
365 options?: { agent?: string; noReply?: boolean },
366): Promise<void> {
367 if (!sessionId || !text.trim()) return;
368 try {
369 await client.session?.prompt?.({
370 path: { id: sessionId },
371 body: {
372 ...(options?.agent && { agent: options.agent }),
373 ...(options?.noReply && { noReply: true }),
374 parts: [{ type: "text", text }],
375 },
376 });
377 } catch {
378 // Session may be unavailable or busy.
379 }
380}
381
382export async function getRecentAssistantMessages(
383 client: OpenCodeClient,

Callers 1

handleCliCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected