Repository navigation
docs(typescript): add a standalone native local-link diagnostic - #65
Open
Zixiaobowen wants to merge 1 commit into
Open
Zixiaobowen wants to merge 1 commit into
Zixiaobowen wants to merge 1 commit into
Conversation
Author
|
anyone here? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a standalone TypeScript example and documentation for the local-file link behavior reported in #19.
The example uses only this repository's SDK: no omp, agent session, model call, plugin, Markdown rewrite, or automatic navigation. This is a reproduction/documentation contribution, not a renderer fix, and it should not close #19.
Reproduce
Run in a Tern terminal pane from
typescript/:The default target is the example's own existing
.tsfile. The example requires a native TSP connection; it explicitly errors if TSP is unavailable rather than accepting a plain-text rendering as proof.Set
TERN_TSP_RECORDto a local JSONL file to inspect the SDK's actual messages.Observed behavior
Verified with Tern 0.8.3 (e2b8656) on macOS arm64, using the real SDK program in an isolated
tern servenative renderer. The rendered element tree and screenshot were inspected.file:///…URLaelementaaafile:///…hrefspan.sf-linkspan.sf-linkThe wire recording contains the original
file:///…destination in the Markdown node, unchanged. The native span uses that same URL and does produce a link. This independently isolates the difference to Tern's native Markdown rendering rather than omp or SDK URL rewriting. Both the default non-HTML file and an existing HTML file with spaces and a literal#in its name reproduced it.Handling notes
On the affected native Markdown renderer, an encoded absolute local path can be used as a destination-side workaround after resolving the intended session directory. Preserve encoded filename bytes (
%20,%23) and leave the original file URL unchanged for native spans and OSC 8 hyperlinks. Do not blindly replace strings throughout Markdown source or alter unrelated URL schemes.The local omp workaround that prompted this contribution changes only its native Markdown destinations after session-relative resolution; it does not repair Tern's renderer. This PR does not change SDK serialization, the renderer's URL policy, or plugin routing. Windows/UNC paths, remote hosts and fragment navigation have not been verified.
Checks
bun run typecheckintypescript/: passed..tstarget and a boundary-name.htmltarget; inspected actual rendered links and TSP messages.TERN_TSP=0 bun examples/local-links.ts: expected native-only error and exit status 1 observed.git diff --check: passed.No full multi-language test suites or build were run; no library implementation changed. The native-renderer checks above establish link generation, not GUI click/navigation success.
Related: #19.
Need help on this PR? Tag
@codesmith-botwith what you need.