MCPcopy Index your code
hub / github.com/anomalyco/opencode / emitError

Function emitError

packages/opencode/src/cli/cmd/run/demo.ts:568–583  ·  view source on GitHub ↗
(state: State, text: string)

Source from the content-addressed store, hash-verified

566}
567
568function emitError(state: State, text: string): void {
569 const event = {
570 id: `session.error:${state.id}:${Date.now()}`,
571 type: "session.error",
572 properties: {
573 sessionID: state.id,
574 error: {
575 name: "UnknownError",
576 data: {
577 message: text,
578 },
579 },
580 },
581 } satisfies Event
582 feed(state, event)
583}
584
585async function emitBash(state: State, signal?: AbortSignal): Promise<void> {
586 const ref = make(state, "bash", {

Callers 1

emitFmtFunction · 0.85

Calls 1

feedFunction · 0.70

Tested by

no test coverage detected