Skip to content

Import links v2: per-service parameters, grouped import page, builder and docs - #72

Merged
fylorn merged 4 commits into
mainfrom
docs/import-v2
Oct 11, 2026
Merged

fylorn merged 4 commits into
mainfrom
docs/import-v2

Conversation

@fylorn

@fylorn fylorn commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Website side of import link v2. Do not merge before the ThinkWatch Lite 2026.10.16 and ThinkWatch Enterprise releases.

Import page and link builder

  • src/lib/import-link.ts validates the v2 rules: the envelope (8192 characters, strict percent-decoding, each parameter once, no empty values, no $ { }, control or invisible characters), and every parameter only where the New upstream dialog shows its field for the chosen service and authentication method. The per-service table mirrors Lite's presets (SERVICE_RULES, fieldsFor): own addresses and fixed protocols may be repeated but not changed, Z.ai site against url, Bedrock region against a standard address, OAuth and AWS key requirements, header deny list, specs and prices encodings, price sheet only with per-token billing. Without service, the service is recognized from url by host, standard Bedrock host or port 11434, else custom.
  • /import shows the receiving hosts first (token endpoint host too when different; an account sign-in shows the account instead), then the settings in the dialog's groups: Service, Connection (Account), Advanced settings, Models, Billing. A link that uses v2 parameters says it needs Lite 2026.10.16 or later. An unknown parameter shows that a newer ThinkWatch Lite is needed and still offers to open the link, passing the parameter on re-encoded. Proxy, AWS profile, aliases, routes, default, weight, disabled and the checking-only access token are rejected. The privacy properties are unchanged: fragment only, removed from the address bar, no analytics or third-party scripts, textContent only, one navigation target.
  • The link builder at the end of the Import links page asks what the dialog asks for each service and authentication method, and leaves out service when the address alone gives it, so a plain relay link still opens in earlier versions.

Docs

  • Import links (en, zh-CN) rewritten for v2: parameters grouped like the dialog, a by-service table, encodings for headers, specs and prices, limits, what the app does, links from a newer version, what a link can never set and why, examples (relay with headers, concurrency, models and prices; Bedrock with access keys; ThinkWatch Enterprise gateway; ChatGPT account; a v1 link).
  • Lite features and the comparison page updated where they describe import links.
  • Enterprise: the Add to ThinkWatch Lite button (key created, rotated, first-run, Configuration Guide tab; Lite 2026.10.16 or later), the Configuration Guide path corrected to /guide, and GET /v1/models listing only the models the calling key may use.

Verification

  • pnpm build passes; tsc --noEmit passes for the library and the two page scripts.
  • The validator was exercised with a node test suite (v1 links, envelope, every service and auth method, headers, specs, prices, unknown parameters, round trip). The repository has no test runner, so it is not committed.
  • Headless Chromium against the built site: the five documented examples and several invalid links on /import and /zh-CN/import (hosts, groups, update notice, key toggle, the app link the button opens), and the builder for custom, Bedrock, ChatGPT, ThinkWatch and Ollama.

🤖 Generated with Claude Code

fylorn and others added 4 commits October 11, 2026 20:25
… and docs

The import page and the link builder now follow version 2 of the import
link: every parameter the New upstream dialog shows for the chosen service
and authentication method (service, auth, site, OAuth, Bedrock access keys,
headers, client identity, concurrency, balance source, models_only, specs,
billing, price sheet), with the same per-service rules as the app. The
page lists the receiving hosts first and the settings in the dialog's
groups; a parameter from a newer version shows that a newer ThinkWatch
Lite is needed and is passed on to the app. Proxies, AWS profiles,
aliases, routes, weights, the disabled switch and the checking-only access
token are rejected.

The Import links docs are rewritten for v2, the Lite features and
comparison pages updated, and the enterprise docs describe the Add to
ThinkWatch Lite button (Lite 2026.10.16 or later), fix the Configuration
Guide path to /guide, and note that GET /v1/models lists only the models
the calling key may use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without `service`, the service recognized from the address is used only
when every parameter fits it; otherwise the link is a custom upstream, so
every link written for the first version stays valid (an official address
with another path, an Ollama address with a key, DeepSeek with
protocol=openai-chat). An explicit `service` stays strict. The docs say
so next to the v1 example and under `service`, the balance source is
detected automatically when omitted, and the builder's default reads
Auto-detect like the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`url` and `oauth_endpoint` accept plain http:// for loopback, private
IPv4 ranges (10/8, 172.16/12, 192.168/16, 100.64/10, 169.254/16), IPv6
fc00::/7 and fe80::/10, names without a dot and names ending in .local,
.lan, .internal, .intranet, .corp, .home.arpa or .localhost, so an
enterprise gateway on the company intranet can be imported. Other http
addresses stay rejected. The import page states under such a host that
the key and request content travel in plain text; the docs list the
rule, and the enterprise docs note that intranet http gateways work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A New API or One API admin can add ThinkWatch Lite to every key's chat
menu with one preset; no change to the site's code is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit bb58afd into main Oct 11, 2026
1 check passed
@fylorn
fylorn deleted the docs/import-v2 branch October 11, 2026 16:51
fylorn added a commit that referenced this pull request Oct 11, 2026
* Docs and product pages for the three request guards

Outbound redaction, tool-call inspection and the content filter are now
the only guards: the output limit is gone (a routing rule that sets
max_tokens caps answers instead) and hidden characters are content filter
rules. Each guard has Off, Observe and a third mode named for what it
does: Replace, Cut off, Enforce.

- Lite features and overview: three protections and their third modes;
  redaction searches the whole request, has email and phone rules (off)
  and named placeholders; the two new tool-call rules; content rules
  that refuse, delete or record, match by code point, and the hidden
  character rules; the Deleted mark on Traffic; max_tokens in Routing.
- Core overview, crate layers and the Core page: three guards, the
  content filter, tw-guard holding the shared rule model, and the
  <<TW_SECRET_1>> placeholder in the illustration.
- Lite page: the security feature in two sentences, three protections.
- Enterprise overview, architecture, configuration and API reference:
  the security.redact, security.inspect_tools and security.content
  settings, their shape and permissions, the conversion of the old keys,
  and a model's maximum output tokens; the product page's guard bullet.
- src/data/core-docs synced from ThinkWatch-Core feat/guard-unify.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Core documents snapshot from the v0.59.0 release

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
fylorn added a commit that referenced this pull request Oct 11, 2026
… and docs (#72)

* Import links v2: per-service parameters, grouped import page, builder and docs

The import page and the link builder now follow version 2 of the import
link: every parameter the New upstream dialog shows for the chosen service
and authentication method (service, auth, site, OAuth, Bedrock access keys,
headers, client identity, concurrency, balance source, models_only, specs,
billing, price sheet), with the same per-service rules as the app. The
page lists the receiving hosts first and the settings in the dialog's
groups; a parameter from a newer version shows that a newer ThinkWatch
Lite is needed and is passed on to the app. Proxies, AWS profiles,
aliases, routes, weights, the disabled switch and the checking-only access
token are rejected.

The Import links docs are rewritten for v2, the Lite features and
comparison pages updated, and the enterprise docs describe the Add to
ThinkWatch Lite button (Lite 2026.10.16 or later), fix the Configuration
Guide path to /guide, and note that GET /v1/models lists only the models
the calling key may use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import links v2.1: a link without service falls back to custom

Without `service`, the service recognized from the address is used only
when every parameter fits it; otherwise the link is a custom upstream, so
every link written for the first version stays valid (an official address
with another path, an Ollama address with a key, DeepSeek with
protocol=openai-chat). An explicit `service` stays strict. The docs say
so next to the v1 example and under `service`, the balance source is
detected automatically when omitted, and the builder's default reads
Auto-detect like the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import links v2.2: plain http on private networks

`url` and `oauth_endpoint` accept plain http:// for loopback, private
IPv4 ranges (10/8, 172.16/12, 192.168/16, 100.64/10, 169.254/16), IPv6
fc00::/7 and fe80::/10, names without a dot and names ending in .local,
.lan, .internal, .intranet, .corp, .home.arpa or .localhost, so an
enterprise gateway on the company intranet can be imported. Other http
addresses stay rejected. The import page states under such a host that
the key and request content travel in plain text; the docs list the
rule, and the enterprise docs note that intranet http gateways work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Import links: the chat preset for New API sites

A New API or One API admin can add ThinkWatch Lite to every key's chat
menu with one preset; no change to the site's code is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant