@xenosystem/blocks 0.21.0 → 0.22.0

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.
@@ -252,6 +252,12 @@ interface XenoAuthGateState {
252
252
  message?: string;
253
253
  /** For `expired-offline`: when the licence was last confirmed, so the plate can say how long ago. */
254
254
  lastVerifiedAt?: number;
255
+ /**
256
+ * The host name the system browser opens for sign-in (`xenosystem.ai`), as the HOST knows it — the gate
257
+ * does not. Named on the sign-in plate only when it is a plain host name; absent, the plate names no domain
258
+ * rather than guess one (apps sign in at different origins while the domain moves).
259
+ */
260
+ signInHost?: string;
255
261
  /** Which intents the host implements. A missing one hides its affordance (COMPONENTS §1.7). */
256
262
  capabilities?: Partial<Record<XenoAuthGateIntentKind, boolean>>;
257
263
  }
@@ -131,6 +131,11 @@ import { useEffect, useState } from "react";
131
131
  import { AuthDoor, SignInForm } from "@xenosystem/components/auth";
132
132
 
133
133
  // src/auth/gate/behaviour.ts
134
+ var HOST = /^(?=.{3,253}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/i;
135
+ function signInNote(signInHost, productName) {
136
+ const where = signInHost && HOST.test(signInHost) ? `at ${signInHost.toLowerCase()}` : "to sign in";
137
+ return `Your browser opens ${where}, where you can continue with Google, GitHub or email. ${productName} never sees your password.`;
138
+ }
134
139
  function authGateView(state, productName, now = Date.now()) {
135
140
  const phase = deriveAuthGatePhase(state);
136
141
  const copy = plateCopy(phase, productName, state.message, formatSince(state.lastVerifiedAt, now));
@@ -159,7 +164,7 @@ function authGateView(state, productName, now = Date.now()) {
159
164
  tag: copy.tag,
160
165
  title: copy.title,
161
166
  body: copy.body,
162
- note: phase === "sign-in" && !state.pending ? `Your browser opens at xenostudio.ai, where you can continue with Google, GitHub or email. ${productName} never sees your password.` : void 0,
167
+ note: phase === "sign-in" && !state.pending ? signInNote(state.signInHost, productName) : void 0,
163
168
  warning: copy.note,
164
169
  identity: state.identity && phase !== "sign-in" ? state.identity.email ?? state.identity.name ?? state.identity.sub : void 0,
165
170
  actions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/blocks",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "XENO Blocks — rung 3 of the front ladder: components composed into a contract-bearing unit (manifest: ports, intents, commands, agent surface), rendered by @xenosystem/workbench. ONE package, one subpath per family (/auth, /edit, /data, /time, /ops, /trust, /agent, /docs; framework-free /docs/core and pure /docs/format), one named export per block — XENO PACKAGE NAMING - STANDARD.md.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",