@hanzo/rooms 0.1.93 → 0.1.94

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.
package/dist/Chat.js CHANGED
@@ -18,9 +18,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
18
18
  //
19
19
  // The FREE lane is about PRICE, not identity: a free turn spends no balance and
20
20
  // is data-shared in exchange. That choice is made once, at onboarding, where
21
- // the terms are linked. The line under the composer says so for as long as a
22
- // free model answers. Signing in buys the paid models and a history that
23
- // follows you; it is never the price of asking a question.
21
+ // the terms are linked. Nothing under the composer repeats it. Signing in buys
22
+ // the paid models and a history that follows you; it is never the price of
23
+ // asking a question.
24
24
  //
25
25
  // This file used to branch on `isAuthenticated` and hand a visitor a composer
26
26
  // whose only action was a trip to hanzo.id, captioned "Sign in to send". The
@@ -31,7 +31,6 @@ import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "r
31
31
  import { billed, detail, familyOf, planRequired, plainly, refused } from "./failure.js";
32
32
  import { Prose } from "./Prose.js";
33
33
  import { useAgent, useAi, useChat, } from "@hanzo/ai/react";
34
- import { isFree } from "@hanzo/ai";
35
34
  import { ASK, Chat as ChatSurface, Failure, Parts, words } from "@hanzo/ui/chat";
36
35
  import { carriedIn, carrying, compose, partsOf, said as told, weigh } from "./lib/attach.js";
37
36
  import { download, dropped, fileOf, pct, readable, refOf, retrieve } from "./lib/files.js";
@@ -70,7 +69,7 @@ import { Upgrade, useFree } from './Upgrade.js';
70
69
  import { enter, LOGIN } from './lib/destination.js';
71
70
  import { first } from './lib/first.js';
72
71
  import { BAD } from "./lib/mix.js";
73
- import { brand, site } from './where.js';
72
+ import { brand } from './where.js';
74
73
  // NO REASONING PANEL HERE. Every assistant turn opened a "Thinking" disclosure
75
74
  // listing seven steps — "Planning CSS extraction for chat styles", "Designing
76
75
  // responsive top bar grid layout" — typed into this file as a literal array.
@@ -466,8 +465,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
466
465
  * `useState(anonymous ? FREE : ENSO)` read the flag ONCE, on the first render
467
466
  * — which is the render before hydration settles, where `anonymous` is always
468
467
  * false. So every visitor opened on ENSO while the composer beside them said
469
- * "Enso Free", and `isFree(model)` was false, so the data-sharing notice
470
- * never appeared. A visitor was sending on the paid pool, because a state
468
+ * "Enso Free". A visitor was sending on the paid pool, because a state
471
469
  * initialiser cannot see a value that arrives later.
472
470
  *
473
471
  * A CHOICE, or the identity. `null` is "nobody has chosen", which is a
@@ -684,8 +682,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
684
682
  // EVERY MODEL IS CHOSEN, never asked for: one the plan does not cover still
685
683
  // picks, and the gateway answers it with the policy's refusal or from Enso,
686
684
  // which the room then shows. A turn the gateway refuses `plan_required`
687
- // opens the upgrade, titled with the model. `isFree` still drives the
688
- // free-lane notice.
685
+ // opens the upgrade, titled with the model.
689
686
  const free = useFree(!anonymous) && !held;
690
687
  const [ask, setAsk] = useState(null);
691
688
  // KEEPING THE CONVERSATION is the reader's account, not this pane's choice:
@@ -1115,8 +1112,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
1115
1112
  * no longer allowed to draw. `:focus-within` would say this in CSS; the
1116
1113
  * stylesheet that would hold it cannot reach past gui's own rule, so the
1117
1114
  * state is read where the event is. */
1118
- // A free send goes. The data-share choice was made at onboarding, once,
1119
- // and the line under the composer still says what a free model does.
1115
+ // A free send goes. The data-share choice was made at onboarding, once.
1120
1116
  const guarded = speak;
1121
1117
  /**
1122
1118
  * The draft and the files, sent as one turn.
@@ -1523,5 +1519,5 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
1523
1519
  empty: heading === null ? undefined : (_jsxs(YStack, { "data-slot": "opening", items: "center", width: "100%", pt: "$6", pb: "$2", ...(media.sm ? null : { flex: 1, justify: "flex-end" }), children: [room.length > 1 ? (_jsx(XStack, { items: "center", justify: "center", mb: "$4", children: room.map((name, i) => (_jsx(Box, { ml: i ? -16 : 0, rounded: 40, borderWidth: 2, borderColor: "$background", z: room.length - i, children: _jsx(Face, { src: faces[name]?.avatar, emoji: faces[name]?.emoji, name: name, size: 72 }) }, name))) })) : portrait ? (_jsx(Box, { width: 160, height: 160, rounded: 24, overflow: "hidden", borderWidth: 2, borderColor: "var(--white-15)", boxShadow: "0 10px 24px color-mix(in srgb, var(--pure-black) 70%, transparent)", mb: "$4", bg: "var(--neutral-900)", children: _jsx(View, { render: _jsx("img", { src: portrait, alt: withWhom }), width: "100%", height: "100%", objectFit: "cover" }) })) : null, room.length === 1 && !portrait ? (_jsx(Box, { mb: "$3", children: _jsx(Face, { emoji: mate?.emoji ?? persona?.emoji, name: withWhom, size: 72 }) })) : null, _jsx(Text, { render: "h1", fontSize: "$7", lineHeight: "$7", fontWeight: "700", color: "$ink", text: "center", mb: "$1", children: join(room) || heading || (firstName ? `What’s up, ${firstName}?` : "What’s up?") }), room.length === 1 && (mate?.description ?? persona?.description) ? (_jsx(Text, { fontSize: "$3", color: "$soft", text: "center", maxW: 500, mb: "$4", lineHeight: "$4", children: mate?.description ?? persona?.description })) : null] })),
1524
1520
  // The transcript reads at the same measure. `Thread` defaults to 768
1525
1521
  // itself; handing it the column here is what lets Width reach it.
1526
- column: { maxW: MEASURE }, composer: prompt({ ...composing, field: mention.field }, mention.state) }), _jsx(AgentMaker, {}), carry.dialog, _jsx(XStack, { items: "center", justify: "center", py: "$1", px: "$3", gap: "$2", children: isFree(model) ? (_jsxs(Text, { fontSize: "$1", color: "$soft", children: ["Free chat is data-shared to train models.", " ", _jsx(Anchor, { href: site("/legal/privacy"), fontSize: "$1", color: "$ink", children: "Privacy" })] })) : (_jsxs(_Fragment, { children: [_jsx(Anchor, { href: site("/legal/terms"), fontSize: "$1", color: "$soft", children: "Terms" }), _jsx(Text, { fontSize: "$1", color: "$soft", children: "\u00B7" }), _jsx(Anchor, { href: site("/legal/privacy"), fontSize: "$1", color: "$soft", children: "Privacy" })] })) }), _jsx(Upgrade, { ask: ask, onClose: () => setAsk(null) })] }));
1522
+ column: { maxW: MEASURE }, composer: prompt({ ...composing, field: mention.field }, mention.state) }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Upgrade, { ask: ask, onClose: () => setAsk(null) })] }));
1527
1523
  }
package/dist/lib/ai.d.ts CHANGED
@@ -40,7 +40,7 @@ export declare const base: () => {
40
40
  export interface Ai {
41
41
  client: AiClient | null;
42
42
  model: string;
43
- /** Answering free, so the turn is data-shared and owes the notice. */
43
+ /** Answering on the free pool. The data-share choice was made at onboarding. */
44
44
  free: boolean;
45
45
  /** Mounted client-side. The static export always prerenders the signed-out
46
46
  * page, so nothing interactive may render until this is true. */
package/dist/lib/ai.js CHANGED
@@ -5,8 +5,8 @@
5
5
  // their account like every other turn they run.
6
6
  //
7
7
  // Signed out — the FREE POOL, anonymously. There is no account to bill and none
8
- // is needed: a free turn spends no balance, and what it costs instead is stated
9
- // in the consent block the composer asks before the first send. A widget key, if
8
+ // is needed: a free turn spends no balance. The data-share choice is made
9
+ // once, at onboarding. A widget key, if
10
10
  // one is configured, rides along so the turn attributes to the org that minted
11
11
  // it; without one the turn is simply anonymous. Either way the client EXISTS,
12
12
  // because a chat you cannot send is not a chat.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/rooms",
3
- "version": "0.1.93",
3
+ "version": "0.1.94",
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",