feat(core): add AppInfo + extractAppInfo() to core/mcp/apps.ts#1584
Conversation
|
@claude review |
|
Claude finished @cliffhall's task in 2m 18s —— View job Review:
|
|
Thanks for the round-1 review. Addressed the two cheap, zero-behavioral-risk nits in ee4b232:
Declined (all explicitly "fine in practice" in the review):
apps.ts coverage remains 100% lines / 97.05% branch / 100% funcs — clears the ≥90 gate. |
|
@claude review |
|
Claude finished @cliffhall's task in 50s —— View job Review (round 2):
|
|
📋 Smoke test & AGENTS.md audit for this PR: #1556 (comment) (posted on the linked issue #1556). |
…ase change; tree unchanged)
Closes #1556
Summary
Wave 1 of the PR #1510 decomposition (tracking #1579). Adds a machine-readable app summary to
core/mcp/apps.ts:AppInfointerface —hasApp,toolName,resourceUri,visibility, plus resource-sidecsp/permissions/domain/prefersBorder/resourceMimeType.extractAppInfo(tool, resource?)— merges the tool's_meta.ui(resourceUri, visibility) with the linked UI resource's_meta.ui(csp, permissions, domain, prefersBorder). Returns{ hasApp: false, toolName }for non-App tools and propagates the underlying throw on a malformedresourceUri.readUiMeta(),normalizeResourceUri(),findResourceContent(). Content-block matching is exact-URI → lowercase + trailing-slash normalized → single-block fallback (sinceresources/readreturns the requested resource by definition), then result-level_meta.uias a last resort.Per spec,
csp/permissions/domainlive on the resource (not the tool), so a caller wanting the security posture must read the resource and pass it._meta.uicarriers are read structurally (the ext-apps named types aren't importable under NodeNext), with noany.Why
Shared plumbing for the programmatic-review path — the CLI
--app-infomode and integration tests need one canonical answer to "does this tool have an app, and what does it ask for?" without rendering it.Tests
clients/web/src/test/core/apps.test.ts— newextractAppInfodescribe block (non-App tool, tool-only info, full merge, result-level fallback,prefersBorder:false, malformed-URI throw, and aresource-content URI matchinggroup covering exact/normalized/single-block/no-arbitrary-pick/empty-URI cases). 25 tests pass.Coverage for
core/mcp/apps.ts: 100% stmts / 96.66% branch / 100% funcs / 100% lines (all ≥90 gate).cd clients/web && npm run validatepasses (2449 unit tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX