Files
skillshare/internal/utils
Rusty Shackleford e969ebcfb0 fix(mcp): close Skills conformance gaps with directory reads and resource metadata (#905)
* feat(mcp): support Skills directory reads and metadata listing

Expose accepted skill directories and SKILL.md metadata so MCP hosts can
browse served packages without guessing manifest filenames. Reuse catalog
selection and refresh boundaries, including empty directories and stable
pagination, and normalize strict frontmatter for YAML 1.2 Core readback.

Add regressions and a pinned official conformance runner, and update the
runbook and MCP references to describe the browsing contract.

Refs #895

* fix(mcp): preserve supporting file MIME types in directory listings

Record UTF-8 classification from the same bounded bytes used for package
digests so directory metadata agrees with resource reads for extensionless
and unknown-extension text. Reuse the existing bounded reader without
adding listing-time payload reads or changing package limits.

Share pagination with skills/list, trust the SDK's typed request boundary,
and repair the pagination regression to detect stale catalog snapshots.

Refs #895

* fix(mcp): stream supporting file metadata inspection

Buffering supporting files during catalog refresh allocated with asset size.
Restore one bounded stream for digest, size and UTF-8 classification, retaining
at most three incomplete rune bytes and consuming invalid text through EOF.
Preserve the existing same-file checks, package caps and SKILL.md byte reader.

Keep real package-load benchmarks and strengthen the existing MIME fixtures
for split runes and bytes after invalid sequences. Use one first-match sed
command for the conformance URL without a truncated pipeline under pipefail.

Scoped packages, focused race tests, vet, shell syntax/shellcheck and all 45
pinned official checks pass. Allocation stays near 48 KB for 64 KiB and 8 MiB
assets; multibyte UTF-8 validation still costs CPU versus digest-only loading.

* test(mcp): consolidate directory and frontmatter coverage

Check every directory continuation URI so a duplicated middle entry cannot
hide a missing resource. Keep the existing before/after-cursor refresh cases.

Merge nested-skill acceptance fixtures in the catalog owner, preserving all
skill-count, skip-warning and directory assertions across configured and
targetless cases. Move directory capability coverage to initialization and
merge scalar, alias and rejection cases under the existing parser test.

Give cached-page benchmark skills names that match their URI directories.
Narrow tests, benchmark smoke and vet pass; duplicate-result and stale-catalog
mutations both fail, then restored source passes. Production is unchanged.
2026-11-15 00:21:35 +08:00
..