From 713eb6c1805cf5c46de2c4fa392ef2da727c5977 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Sun, 17 Aug 2025 17:28:30 +0000 Subject: [PATCH] fix: align everything server resource URI numbering with array indices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue where array indices (0-based) didn't match URI numbers (1-based), causing confusion where: - Resource at index 0 was accessed via 'test://static/resource/1' - Even indices (text resources) mapped to odd URI numbers Changes: - Resource URIs now use 0-based numbering to match array indices - Resource 0 is now accessed via 'test://static/resource/0' - Even indices now map to even URI numbers (more intuitive) Resolves #475 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Ola Hungerford --- src/everything/everything.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/everything/everything.ts b/src/everything/everything.ts index 26e4352193..4885a3e00b 100644 --- a/src/everything/everything.ts +++ b/src/everything/everything.ts @@ -254,7 +254,7 @@ export const createServer = () => { }; const ALL_RESOURCES: Resource[] = Array.from({ length: 100 }, (_, i) => { - const uri = `test://static/resource/${i + 1}`; + const uri = `test://static/resource/${i}`; if (i % 2 === 0) { return { uri, @@ -316,7 +316,7 @@ export const createServer = () => { const uri = request.params.uri; if (uri.startsWith("test://static/resource/")) { - const index = parseInt(uri.split("/").pop() ?? "", 10) - 1; + const index = parseInt(uri.split("/").pop() ?? "", 10); if (index >= 0 && index < ALL_RESOURCES.length) { const resource = ALL_RESOURCES[index]; return {