@hanzo/rooms 0.1.66 → 0.1.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -141,6 +141,8 @@ export declare const guest: (hostname: string) => boolean;
141
141
  * either: it is hanzo.ai/dev's old address and redirects there.
142
142
  */
143
143
  export declare function devnet(hostname: string): boolean;
144
+ /** Whether a host signs in on hanzo.ai with its own request (`VISITS`). */
145
+ export declare const visits: (hostname: string) => boolean;
144
146
  /**
145
147
  * Whether a host answers IAM's sign-in and sign-out calls on its own origin, so
146
148
  * a page there signs in without leaving it. Every devnet host does: app-dev's
package/dist/lib/host.js CHANGED
@@ -221,11 +221,22 @@ export function devnet(hostname) {
221
221
  }
222
222
  /**
223
223
  * The hosts that answer IAM's sign-in and sign-out calls on their own origin:
224
- * every host this export is served on and signs in at (universe static-sites
225
- * `iam-on-hanzo-ai` and cloud.yaml `iam-signin`), testnet's test.hanzo.ai, and
226
- * the dev server's /v1 proxy.
224
+ * hanzo.ai, where Hanzo signs in (universe static-sites `iam-on-hanzo-ai` and
225
+ * cloud.yaml `iam-signin`), testnet's test.hanzo.ai, and the dev server's /v1
226
+ * proxy.
227
227
  */
228
- const ANSWERS = new Set([...APEX, 'cloud.hanzo.ai', 'hanzo.bot', 'bot.hanzo.ai', 'test.hanzo.ai', 'localhost', '127.0.0.1']);
228
+ const ANSWERS = new Set([...APEX, 'test.hanzo.ai', 'localhost', '127.0.0.1']);
229
+ /**
230
+ * The hosts this export is served on that keep a session of their own and sign
231
+ * in on hanzo.ai: a person signed out there is sent to hanzo.ai/login carrying
232
+ * the host's OWN authorize request (its callback, its PKCE challenge), which
233
+ * hanzo.ai's page finishes, and the code comes back to the host's
234
+ * /auth/callback. One sign-in page for Hanzo, and nobody types a credential on
235
+ * these hosts.
236
+ */
237
+ const VISITS = new Set(['cloud.hanzo.ai', 'hanzo.bot', 'bot.hanzo.ai']);
238
+ /** Whether a host signs in on hanzo.ai with its own request (`VISITS`). */
239
+ export const visits = (hostname) => VISITS.has(hostname);
229
240
  /**
230
241
  * Whether a host answers IAM's sign-in and sign-out calls on its own origin, so
231
242
  * a page there signs in without leaving it. Every devnet host does: app-dev's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/rooms",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",