Skip to content

Static route config grammar forbids identifier references, so an MCP App's resourceUri must be duplicated as a literal in every tool's _meta.ui.resourceUri; config.template resolves from the project root #388

Description

@ScriptedAlchemy

What happened

Two small drift traps hit while moving cargo-hauler to conventional routes:

  1. AB4806 — identifier in static config. src/mcp/hauler/tools/hauler_status.tsx had

    export const config = { _meta: { ui: { resourceUri: APP_RESOURCE_URI } }, ... }

    with APP_RESOURCE_URI imported from src/constants.ts. The static extractor rejects the identifier, so the same string (ui://cargo-hauler/dashboard.html) must now be spelled as a literal in the app route's config.resourceUri, in src/constants.ts (runtime use), and in each tool that wants the widget. Nothing checks they agree.

    Ask: let a tool reference the app route it targets (e.g. _meta: { ui: { app: 'hauler/dashboard' } } resolved by the compiler to that app's resourceUri), or allow const string identifiers from the same module in the static grammar.

  2. config.template is project-root relative. In src/mcp/hauler/apps/dashboard.tsx, template: './src/mcp/hauler/apps/dashboard.html' — the path resolves from the project root, not the route file, so moving the app route requires editing the literal. Route-relative resolution (or accepting both with route-relative preferred) would match how every other import in the file resolves.

Minor, same session: agent-bundle inspect --routes aborts on the first diagnostic set instead of emitting the partial route graph, which makes it impossible to verify one route while another is mid-edit.

Pin: agent-bundle@105c65d8f.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions