MCPcopy
hub / github.com/opentrace/opentrace / sourceGrepText

Method sourceGrepText

plugins/opencode/src/graph-client.ts:533–542  ·  view source on GitHub ↗

* Render a `source-grep` text block from the CLI. Mirrors * `sourceSearchText` — CLI owns the formatting and the absolute-path * scrubbing, so the plugin doesn't reinvent ripgrep orchestration. * * `surfaceErrors` is on so an unknown `--repo` id (or any other * CLI-side validation fai

(
    pattern: string,
    opts?: { repo?: string; include?: string; limit?: number },
  )

Source from the content-addressed store, hash-verified

531 * collapsing to a misleading null.
532 */
533 async sourceGrepText(
534 pattern: string,
535 opts?: { repo?: string; include?: string; limit?: number },
536 ): Promise<string | null> {
537 const args = ["source-grep", pattern]
538 if (opts?.repo) args.push("--repo", opts.repo)
539 if (opts?.include) args.push("--include", opts.include)
540 if (opts?.limit) args.push("--limit", String(opts.limit))
541 return this.run(args, { surfaceErrors: true })
542 }
543
544 // -------------------------------------------------------------------
545 // Augment

Callers 2

executeFunction · 0.80

Calls 2

runMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected