diff --git a/app/Mcp/Prompts/BuildResource.php b/app/Mcp/Prompts/BuildResource.php index 0d3eb5b..458cc0c 100644 --- a/app/Mcp/Prompts/BuildResource.php +++ b/app/Mcp/Prompts/BuildResource.php @@ -43,11 +43,12 @@ public function handle(Request $request): Response $meta = Catalog::metaPackage(); $context = collect([ - [Catalog::META_PACKAGE, 'docs/getting-started/first-resource.md', 7000], - [Catalog::META_PACKAGE, 'docs/panel/resources/introduction.md', 5000], + [Catalog::META_PACKAGE, ['docs/getting-started/first-resource.md'], 7000], + // The docs moved folder introductions to README.md; older releases still have introduction.md. + [Catalog::META_PACKAGE, ['docs/panel/resources/README.md', 'docs/panel/resources/introduction.md'], 5000], ])->map(function (array $candidate): ?string { - [$package, $path, $limit] = $candidate; - $document = Catalog::firstDocument([[$package, $path]]); + [$package, $paths, $limit] = $candidate; + $document = Catalog::firstDocument(array_map(fn (string $path): array => [$package, $path], $paths)); return $document ? Catalog::embed($document, 2, $limit) : null; })->filter()->implode("\n\n"); diff --git a/app/Mcp/Tools/PluginDevelopmentGuide.php b/app/Mcp/Tools/PluginDevelopmentGuide.php index eeab649..def4943 100644 --- a/app/Mcp/Tools/PluginDevelopmentGuide.php +++ b/app/Mcp/Tools/PluginDevelopmentGuide.php @@ -52,7 +52,8 @@ public function handle(Request $request): Response $overview[] = Markdown::summary($readme->content, 700); } - if ($intro = $this->document($meta, 'docs/plugins/introduction.md')) { + // The docs moved folder introductions to README.md; older releases still have introduction.md. + if ($intro = $this->document($meta, 'docs/plugins/README.md') ?? $this->document($meta, 'docs/plugins/introduction.md')) { $overview[] = $this->limit(Markdown::demoteHeadings(Markdown::body($intro->content), 1), 2500); $overview[] = $this->source($intro); } @@ -86,7 +87,7 @@ public function handle(Request $request): Response // 5. Components $parts[] = $this->chapter('## 5. Registering components (resources, pages, widgets)', [ [$this->document($meta, 'docs/plugins/components/resources.md'), null], - [$this->document($meta, 'docs/plugins/components/introduction.md'), null], + [$this->document($meta, 'docs/plugins/components/README.md') ?? $this->document($meta, 'docs/plugins/components/introduction.md'), null], ], all: true); // 6. Frontend