# Open Links From Route C Messages

This guide helps you understand what should happen when you click links in
Route C chat, Mail, Markdown previews, and other Oysterun text surfaces.
Oysterun chooses the destination from the link target, not from the file
extension alone.

## Before You Start

Start from an Oysterun screen that shows a message, Mail item, Markdown preview,
or other text with visible links. For local file or folder links, the Host must
be able to check the target path. For Website links, the link must use a
`/sites/<agent>/...` route or a same-origin Host URL that points to that route.

After an Agent authors a Website post, page, or report, its default completion
link is the absolute `canonical_url` returned by `oysterun website url --path`
from the registered healthy Oysterun managed tunnel. That external share URL
still points to the same `/sites/<project_id>/...` namespace described here.
It is not an Explorer Preview, File Preview, local source path, or Website
index substitute. Renderers may normalize it to the same-origin relative
`/sites/...` route after the page is opened on that exact Host.

## Start With The Link Target

Use these targets when you write or inspect a link:

1. Link to an existing local file when you want Oysterun to open File Preview.
2. Link to an existing local folder when you want Oysterun to open Explorer.
3. Link to `/sites/<agent>/...` when you want to open a Host-served Website
   page.
4. Link to `https://...` when you want the normal external URL behavior for the
   current surface.

You should see local files and folders handled inside Oysterun, Website routes
handled as Host-served pages, and external URLs handled by the normal external
URL policy.

## Check Desktop Behavior

On a desktop browser, click a visible link from the rendered Oysterun text.

You should see these results:

- An existing local file opens in File Preview.
- An existing local folder opens in Explorer.
- A `/sites/<agent>/...` Website route opens directly as the Host-served page in
  the browser.
- A same-origin Host URL that points at `/sites/<agent>/...` behaves like the
  matching `/sites` route.
- An external `https://...` URL follows normal browser behavior.

Local HTML files are still local files. If the link target is a filesystem path
such as `/Users/x/report.html` or `.oysterun/site/report.html`, the expected
desktop result is File Preview, not Website serving. If the link target starts
with `/sites/`, the expected result is Website serving.

## Check Phone App Behavior

In the Oysterun phone app, tap the visible link from the rendered text.

You should see these results:

- An existing local file opens in the app's File Preview surface.
- An existing local folder opens in the app's Explorer surface.
- A `/sites/<agent>/...` Website route opens in the app's internal browser
  wrapper.
- A same-origin Host URL that points at `/sites/<agent>/...` stays in the
  internal browser wrapper.
- An external `https://...` URL follows the app's current external URL policy.

The phone app keeps Website pages inside Oysterun because the app owns the
browser controls. It should not send local File Preview, Explorer, or Host
Website links to Safari as a fallback.

## Understand Hidden Or Disabled Links

Oysterun only promotes supported local paths after the Host proves the target.
If a local file or folder is missing, unreadable, malformed, or unsupported,
the path should remain plain text instead of becoming a clickable link.

For an invalid Markdown local link, the visible text should become the target
path, not the short Markdown label:

```text
[Report](/missing/report.md)
  displays as /missing/report.md

[Report](/missing/report.md:12)
  displays as /missing/report.md:12
```

If a root-relative path such as `/foo/bar` is not a known Website route and is
not proved as a supported local target, do not expect File Preview, Explorer, or
external-browser navigation.

## Reveal Local Paths

Some local file and folder links use a two-step reveal. The first click shows
the full path or an agent-relative path. The second click on the expanded link
opens File Preview or Explorer.

You should see short labels such as `report.md`, `src`, or a user-written label
until you reveal the path. Clicking outside the message or pressing Escape
collapses the expanded local path link. This reveal behavior applies to local
file and folder links only; Website and external URL links open normally.

## Recover When A Link Does Not Open

If a local file or folder does not become a link, check that the path exists and
that the Host can read enough metadata to classify it. Send a corrected path or
move the target into a reachable location, then try the link again.

If a Website route opens an unavailable or 404 page, check that the agent name
in `/sites/<agent>/...` is the Website project that owns the file and that the
file exists under that Website. Correct routing cannot make a missing Website
file appear.

If an HTML file opens in File Preview instead of as a Website, check whether the
link target was a filesystem path. Use `/sites/<agent>/...` when you want Host
Website serving.

If the phone app sends a local or Website link to an external browser, return to
Oysterun and try the same link again. If it still leaves the app, treat that as
a link-routing problem for the current surface rather than changing the file
extension.
