Repository navigation
Description
Agent Guild on Samsung TVs (Tizen, The Frame included) and LG TVs (webOS). This carries over parts 3 and 4 of #305, updated for what has shipped since.
Neither platform runs Android apps, so oddessentials/agent-guild-android can't serve them. That repo keeps every Android device: phones, tablets, Quest, Android TV, Google TV and Fire TV. Both platforms run packaged web apps (Tizen .wgt, webOS .ipk), so one new companion repo, for example agent-guild-tv, could hold a shared shell and a package for each.
What exists now
- Sign-in by code (feat: sign in a device by a code approved on the page #326):
POST /sign-inandPOST /sign-in/poll, approved in the page's Remote access dialog. The Android app uses it on TVs (agent-guild-android#22). - A host bridge for Android (feat: support Agent Guild in the Android app web view #312), and
&yard=none(feat: let a host turn the Yard off with &yard=none #325). On a TV, the Android app opens only the Cards (&view=cards&yard=none).
The problem to solve first: origin
A packaged app's own pages have an origin the manager doesn't know, likely file:// or an app scheme. The manager answers 403 to Origin: null and to custom schemes (checkRequestSource in src/manager/server.mjs). So the app can't call /sign-in from its own page. There are two ways out:
- Thin shell (recommended): the packaged app asks only for the computer's address. It then opens a sign-in-by-code page served by the manager, which runs at the manager's origin. That page shows the code, polls, keeps the token in the page's own storage, and goes on to the Cards. The app never holds the token, and nothing in the page is copied into the app.
- Fuller app: the packaged app runs sign-in by code itself, and the manager accepts that app's origin. That means a new allowed-origin rule, and the token living in the TV app.
Either way, the page has to recognise the TV as a host, because it accepts view, layout and yard only inside a host. Since there's no addWebMessageListener on these platforms, that needs a Tizen/webOS variant of the host check (#305's groundwork B).
Still open from #305's groundwork
- A. A read-only token. A TV signed in by code now holds the full token, which can use terminals. A TV in a living room or an office only needs to read sessions.
- C. An address a Samsung or LG TV can reach. These TVs can't join a tailnet. A reverse proxy saved in Settings works today. An opt-in local-network address, or Tailscale Funnel, limited to the read-only token, would make this easier for most people.
Samsung (Tizen)
- A packaged
.wgtwithconfig.xml, signed with Samsung certificates, published through TV Seller Office. A public seller can launch in the United States; other countries need a partner agreement. - An app that only points at a remote page ("hosted") is open only to Samsung's partner sellers, so it has to be a packaged app.
- Loading anything from outside the package needs Samsung's permission, and a
Content-Security-Policywithoutunsafe-inlineorunsafe-eval. Check the manager's page against that. - Samsung certifies each version per model group against its launch checklist. Include a reviewer demo.
LG (webOS)
- A packaged
.ipkbuilt with LG'saresCLI, submitted through LG Seller Lounge, which accepts individual sellers. Submission needs a UX scenario, a self-checklist, LG's QA testing and a reviewer demo. - LG has suspended apps that turn TVs into proxies for others' traffic. Ours only reaches its own manager, and the submission should say so plainly.
Check before building
A short spike on a Samsung TV and an LG TV in developer mode, or their emulators:
- What Origin a packaged app sends, and whether it can open the manager's page at the top level.
- Whether the Cards run on a mid-age model's browser engine. These TVs run Chromium versions tied to their model year.
- Each store's current rules for packaged apps that load a remote page, and whether a developer tool is accepted in a store built for media.
- The remote's Back key on the manager's page.
Activity