Import links: web form and relay documentation - #26
Merged
Merged
Conversation
- /import and /zh-CN/import: the web form of a ThinkWatch Lite import link. The parameters stay in the fragment, are checked with the same rules as the app (src/lib/import-link.ts), rendered with textContent only, and removed from the address bar after reading. The only navigation is to thinkwatch://import?… built from the checked values. No analytics or other third-party script on this page (Base gains an `analytics` prop), noindex, left out of the sitemap, and a download button when the app is missing. - Lite docs "Import links" (en, zh-CN) for relay and vendor operators: link forms, parameters, limits, what the app does, examples for Anthropic- and OpenAI-compatible relays, what a link cannot set and why, and a client-side link builder that generates both link forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Site side of ThinkWatch Lite import links (app side: ThinkWatchProject/ThinkWatch-Lite#252).
/importand/zh-CN/import— the web formhttps://thinkwat.ch/import#name=…&url=…&protocol=…&key=…&models=….URLSearchParams(never sent to a server) and removes it from the address bar and history entry withhistory.replaceState; reloads onhashchangeso a second link is never shown with the first one's data.src/lib/import-link.ts, mirroringimport_link.rs): allowlisted parameters, no duplicates or empty values, https only (http for localhost/127.0.0.1/[::1]), no userinfo/query/fragment, host shown in ASCII (IDN → punycode), key limited to key characters (no$ { }so${NAME}can never reach the app), protocol enum, name and model rules. An invalid link shows nothing but the reason.textContent; the key is hidden until "Show".thinkwatch://import?…rebuilt from the validated values withencodeURIComponent.Basegains ananalyticsprop and this page turns Google Analytics off.noindex, excluded from the sitemap. Offers the Lite download (LiteDownload) when the app is not installed./docs/lite/import-links, en + zh-CN), for relay/vendor operators: link forms, parameter table, limits, what the app does with a link, examples for Anthropic- and OpenAI-compatible relays, what a link intentionally cannot set and why, keys in links. Ends with a link builder (ImportLinkBuilder.astro, hooked into_DocArticle.astrofor this page only) that validates in the browser and writes both link forms withtextContent.Checks
astro buildpasses (55 pages). The existing core-docs drift warning is unrelated.xn--…),key=${OPENAI_API_KEY}rejected,name=<img …>rejected with no element created, fragment stripped, zh redirect keeps the fragment, builder output matches the docs examples, nogoogletagmanageron the import pages.🤖 Generated with Claude Code