mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +00:00
Follow-up to #905. The conformance script builds and serves skillshare and runs npm ci, which the repository only allows inside a container, but nothing stopped it from running on the host. It now refuses outside a container, with the same check scripts/hooks/git-e2e.sh uses. Nothing referred to the script either, so the testing topic now says when and how to run it. The translated mcp reference pages left out the example URI the English page gives for a skill root. All four now carry it. The streaming UTF-8 check in the package loader was only exercised with a rune split one byte before the read boundary. Two fixtures in the existing directory test add the 2+2 and 3+1 splits, so a mistake in the carried-over bytes shows up as a wrong MIME type.
This commit is contained in:
@@ -51,6 +51,8 @@ func TestServer_DirectoryBrowsingAndResourceMetadata(t *testing.T) {
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/boundary"), strings.Repeat("a", 32767)+"界")
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/boundary-two"), strings.Repeat("a", 32767)+"é")
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/boundary-four"), strings.Repeat("a", 32767)+"😀")
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/boundary-four-split-two"), strings.Repeat("a", 32766)+"😀")
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/boundary-four-split-three"), strings.Repeat("a", 32765)+"😀")
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/empty"), "")
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/invalid"), "\xff"+strings.Repeat("a", 65536))
|
||||
writeFile(t, filepath.Join(src, "_team/doc/mime/truncated"), strings.Repeat("a", 8192)+"\xe7\x95")
|
||||
@@ -79,14 +81,16 @@ func TestServer_DirectoryBrowsingAndResourceMetadata(t *testing.T) {
|
||||
}
|
||||
mimes := directory(t, cs, "skill://_team/doc/mime", "")
|
||||
wantMIMEs := map[string]string{
|
||||
"skill://_team/doc/LICENSE": "text/plain",
|
||||
"skill://_team/doc/raw.unknown-extension": "text/plain",
|
||||
"skill://_team/doc/mime/boundary": "text/plain",
|
||||
"skill://_team/doc/mime/boundary-two": "text/plain",
|
||||
"skill://_team/doc/mime/boundary-four": "text/plain",
|
||||
"skill://_team/doc/mime/empty": "text/plain",
|
||||
"skill://_team/doc/mime/invalid": "application/octet-stream",
|
||||
"skill://_team/doc/mime/truncated": "application/octet-stream",
|
||||
"skill://_team/doc/LICENSE": "text/plain",
|
||||
"skill://_team/doc/raw.unknown-extension": "text/plain",
|
||||
"skill://_team/doc/mime/boundary": "text/plain",
|
||||
"skill://_team/doc/mime/boundary-two": "text/plain",
|
||||
"skill://_team/doc/mime/boundary-four": "text/plain",
|
||||
"skill://_team/doc/mime/boundary-four-split-two": "text/plain",
|
||||
"skill://_team/doc/mime/boundary-four-split-three": "text/plain",
|
||||
"skill://_team/doc/mime/empty": "text/plain",
|
||||
"skill://_team/doc/mime/invalid": "application/octet-stream",
|
||||
"skill://_team/doc/mime/truncated": "application/octet-stream",
|
||||
}
|
||||
for _, resource := range append(root.Resources, mimes.Resources...) {
|
||||
mime, tested := wantMIMEs[resource.URI]
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# Usage: bash scripts/mcp/skills-conformance.sh <absolute-report-directory>
|
||||
set -euo pipefail
|
||||
|
||||
# It builds and serves skillshare and installs npm packages: container only.
|
||||
[[ -f /.dockerenv ]] || { echo 'run this inside the devcontainer, not on the host' >&2; exit 1; }
|
||||
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
|
||||
REPORT=${1:?provide an absolute report directory outside the fixture HOME}
|
||||
[[ "$REPORT" = /* ]] || { echo 'report directory must be absolute' >&2; exit 1; }
|
||||
|
||||
@@ -736,7 +736,7 @@ SKILLSHARE_MCP_TOKEN=change-me skillshare mcp serve --http 0.0.0.0:8765 \
|
||||
|
||||
`resources/list` は、提供する `SKILL.md` の frontmatter の名前と説明を一覧表示します。
|
||||
`directoryRead: true` により、client は `resources/directory/read`(`uri`、任意の `cursor`)で
|
||||
Skill のルートとサブディレクトリを参照できます。応答の `resources` は直下の項目のみで、
|
||||
`skill://_team/tools/pdf` のような Skill のルートとそのサブディレクトリを参照できます。応答の `resources` は直下の項目のみで、
|
||||
MIME タイプが `inode/directory` の空ディレクトリも含みます。ディレクトリ URI に末尾の
|
||||
スラッシュは付けません。ファイルや不明なディレクトリは `-32602` を返します。
|
||||
両方の一覧は URI 順で、1 ページ最大 100 件です。`nextCursor` を `cursor` として渡すと
|
||||
|
||||
@@ -854,7 +854,7 @@ SKILLSHARE_MCP_TOKEN=change-me skillshare mcp serve --http 0.0.0.0:8765 \
|
||||
|
||||
`resources/list`는 제공되는 `SKILL.md`의 frontmatter 이름과 설명을 나열합니다.
|
||||
`directoryRead: true`로 client는 `resources/directory/read`(`uri`, 선택 사항인 `cursor`)를 통해
|
||||
skill 루트와 하위 디렉터리를 탐색할 수 있습니다. 응답의 `resources`는 바로 아래 항목만 포함하며,
|
||||
`skill://_team/tools/pdf` 같은 skill 루트와 그 하위 디렉터리를 탐색할 수 있습니다. 응답의 `resources`는 바로 아래 항목만 포함하며,
|
||||
MIME 타입이 `inode/directory`인 빈 디렉터리도 포함합니다. 디렉터리 URI에는 끝 슬래시가 없으며,
|
||||
파일이나 알 수 없는 디렉터리는 `-32602`를 반환합니다. 두 목록 모두 URI 순서로 페이지당 최대
|
||||
100개를 반환합니다. `nextCursor`를 `cursor`로 전달하여 계속하며, skill과 같은 선택 및 갱신 규칙을 따릅니다.
|
||||
|
||||
+1
-1
@@ -835,7 +835,7 @@ SKILLSHARE_MCP_TOKEN=change-me skillshare mcp serve --http 0.0.0.0:8765 \
|
||||
|
||||
`resources/list` 列出所提供 `SKILL.md` 的 frontmatter 名称和描述。
|
||||
`directoryRead: true` 让 client 通过 `resources/directory/read`(`uri`、可选 `cursor`)
|
||||
浏览 skill 根目录和子目录;响应的 `resources` 只含直接子项,包括 MIME 类型为
|
||||
浏览 skill 根目录(例如 `skill://_team/tools/pdf`)及其子目录;响应的 `resources` 只含直接子项,包括 MIME 类型为
|
||||
`inode/directory` 的空目录。目录 URI 不加结尾斜线;文件或未知目录返回 `-32602`。
|
||||
两种列表都按 URI 排序,每页最多 100 项,以 `nextCursor` 作为 `cursor` 继续,
|
||||
并使用与 skills 相同的选择和刷新规则。
|
||||
|
||||
+1
-1
@@ -801,7 +801,7 @@ SKILLSHARE_MCP_TOKEN=change-me skillshare mcp serve --http 0.0.0.0:8765 \
|
||||
|
||||
`resources/list` 列出所提供 `SKILL.md` 的 frontmatter 名稱與描述。
|
||||
`directoryRead: true` 讓 client 透過 `resources/directory/read`(`uri`、選填 `cursor`)
|
||||
瀏覽 skill 根目錄與子目錄;回應的 `resources` 只含直接子項目,包括 MIME 類型為
|
||||
瀏覽 skill 根目錄(例如 `skill://_team/tools/pdf`)及其子目錄;回應的 `resources` 只含直接子項目,包括 MIME 類型為
|
||||
`inode/directory` 的空目錄。目錄 URI 不加結尾斜線;檔案或未知目錄回傳 `-32602`。
|
||||
兩種列表都依 URI 排序,每頁最多 100 項,以 `nextCursor` 作為 `cursor` 繼續,
|
||||
並使用與 skills 相同的選取與更新規則。
|
||||
|
||||
@@ -150,6 +150,8 @@ Rules:
|
||||
|
||||
Load `e2e-runbooks` to write or run `ai_docs/tests/*_runbook.md` runbooks or to verify on a Windows guest.
|
||||
|
||||
For changes to what `mcp serve` exposes through the Skills extension (SEP-2640), also run `bash scripts/mcp/skills-conformance.sh <absolute-report-dir>` inside the devcontainer. It fetches the official conformance suite at a pinned commit (needs network and `npm ci`), serves a synthetic source, and fails unless every check is `SUCCESS`. It is not part of `make check` or CI.
|
||||
|
||||
## Frontend and Website Verification
|
||||
|
||||
Start the dashboard through the devcontainer `ui` command. Run website package commands according to `website/AGENTS.md`. Visual changes require inspected screenshots in addition to builds and tests. Load `frontend` for design-specific checks.
|
||||
|
||||
Reference in New Issue
Block a user