@hanzo/app 0.2.58 → 0.3.1
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/README.md +8 -8
- package/dist/{Me.d.ts → Account.d.ts} +1 -1
- package/dist/{Me.js → Account.js} +3 -3
- package/dist/App.d.ts +2 -2
- package/dist/App.js +16 -16
- package/dist/{Top.d.ts → Bar.d.ts} +1 -1
- package/dist/{Top.js → Bar.js} +3 -3
- package/dist/Betas.js +1 -1
- package/dist/Board.js +4 -4
- package/dist/Chat.d.ts +4 -4
- package/dist/Chat.js +96 -96
- package/dist/Contacts.js +17 -15
- package/dist/Directory.js +7 -21
- package/dist/Drive.js +6 -6
- package/dist/{Orgs.d.ts → Gate.d.ts} +1 -1
- package/dist/{Orgs.js → Gate.js} +32 -32
- package/dist/{Chrome.d.ts → Header.d.ts} +1 -1
- package/dist/{Chrome.js → Header.js} +1 -1
- package/dist/Home.d.ts +3 -3
- package/dist/Home.js +30 -30
- package/dist/Inbox.js +29 -33
- package/dist/Meet.js +22 -22
- package/dist/Rail.js +6 -6
- package/dist/RightPane.js +2 -2
- package/dist/{Palette.d.ts → Search.d.ts} +1 -1
- package/dist/{Palette.js → Search.js} +1 -1
- package/dist/Settings.d.ts +3 -3
- package/dist/Settings.js +5 -5
- package/dist/SettingsPane.d.ts +2 -2
- package/dist/SettingsPane.js +5 -5
- package/dist/Setup.js +2 -2
- package/dist/Shell.d.ts +22 -31
- package/dist/Shell.js +167 -114
- package/dist/{Column.d.ts → Sidebar.d.ts} +1 -1
- package/dist/{Column.js → Sidebar.js} +5 -5
- package/dist/Support.js +2 -2
- package/dist/Talk.d.ts +3 -3
- package/dist/Talk.js +18 -18
- package/dist/TeamPreview.js +26 -26
- package/dist/TeamStory.js +1 -1
- package/dist/Usage.js +2 -2
- package/dist/Work.js +2 -2
- package/dist/bots/Bots.js +2 -2
- package/dist/bots/Lights.d.ts +1 -1
- package/dist/bots/Lights.js +1 -1
- package/dist/bots/api.d.ts +8 -7
- package/dist/bots/api.js +4 -4
- package/dist/bots/ink.js +3 -3
- package/dist/bots/kit.d.ts +2 -2
- package/dist/bots/kit.js +4 -4
- package/dist/bots/runtime.js +12 -12
- package/dist/cast.d.ts +14 -14
- package/dist/cast.js +12 -12
- package/dist/channels.d.ts +132 -0
- package/dist/{rooms.js → channels.js} +56 -55
- package/dist/conversations.d.ts +8 -8
- package/dist/conversations.js +18 -17
- package/dist/crew.d.ts +1 -1
- package/dist/crew.js +12 -12
- package/dist/dev.js +6 -6
- package/dist/failure.d.ts +2 -2
- package/dist/failure.js +6 -6
- package/dist/ground.d.ts +1 -1
- package/dist/ground.js +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +2 -2
- package/dist/hint.d.ts +1 -1
- package/dist/hint.js +1 -1
- package/dist/host.d.ts +15 -15
- package/dist/host.js +13 -13
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/lib/ai.js +1 -1
- package/dist/lib/api.d.ts +1 -1
- package/dist/lib/api.js +1 -1
- package/dist/lib/destination.d.ts +3 -3
- package/dist/lib/destination.js +3 -3
- package/dist/lib/home.d.ts +2 -2
- package/dist/lib/home.js +2 -2
- package/dist/lib/host.d.ts +17 -16
- package/dist/lib/host.js +19 -18
- package/dist/lib/hostname.d.ts +1 -1
- package/dist/lib/hostname.js +1 -1
- package/dist/lib/list.d.ts +1 -1
- package/dist/lib/list.js +1 -1
- package/dist/lib/models.js +1 -1
- package/dist/lib/org.d.ts +1 -1
- package/dist/lib/org.js +1 -1
- package/dist/lib/orgname.d.ts +1 -1
- package/dist/lib/orgname.js +1 -1
- package/dist/lib/session.d.ts +4 -4
- package/dist/lib/session.js +6 -6
- package/dist/lib/tier.d.ts +4 -4
- package/dist/lib/tier.js +5 -5
- package/dist/lib/tiers.d.ts +1 -1
- package/dist/lib/tiers.js +10 -10
- package/dist/lib/web.d.ts +1 -1
- package/dist/lib/web.js +1 -1
- package/dist/look.js +7 -9
- package/dist/network.d.ts +18 -18
- package/dist/network.js +28 -28
- package/dist/open.d.ts +24 -22
- package/dist/open.js +19 -19
- package/dist/pane.d.ts +6 -6
- package/dist/pane.js +10 -10
- package/dist/roster.d.ts +2 -2
- package/dist/roster.js +1 -1
- package/dist/seek.js +1 -1
- package/dist/slide.d.ts +1 -1
- package/dist/slide.js +1 -1
- package/dist/span.js +1 -1
- package/dist/stars.d.ts +4 -4
- package/dist/stars.js +8 -10
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/team.js +1 -1
- package/dist/thread.d.ts +3 -3
- package/dist/thread.js +4 -4
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/dist/where.d.ts +7 -7
- package/dist/where.js +2 -2
- package/dist/workday.d.ts +26 -26
- package/dist/workday.js +187 -187
- package/package.json +8 -8
- package/dist/Room.d.ts +0 -8
- package/dist/Room.js +0 -51
- package/dist/rooms.d.ts +0 -131
- /package/dist/lib/{rooms.json → routes.json} +0 -0
package/dist/lib/destination.js
CHANGED
|
@@ -28,7 +28,7 @@ import { where } from "../where.js";
|
|
|
28
28
|
* who cleared their storage mid-flight). */
|
|
29
29
|
export const DEFAULT_DESTINATION = "/";
|
|
30
30
|
/** Where a sign-in with no page to go back to lands on `hostname`: the app on
|
|
31
|
-
* the apex, and the
|
|
31
|
+
* the apex, and the shell's Home everywhere else. */
|
|
32
32
|
export function landing(hostname) {
|
|
33
33
|
return apex(hostname) ? DEFAULT_DESTINATION : where().home;
|
|
34
34
|
}
|
|
@@ -108,7 +108,7 @@ export function door() {
|
|
|
108
108
|
* Send this reader to sign in, and back to this page after.
|
|
109
109
|
*
|
|
110
110
|
* Every signed-out door into the app is this one call: /chat, /dev and every
|
|
111
|
-
* path under them,
|
|
111
|
+
* path under them, an app. The page is written down, and the browser goes to `to`,
|
|
112
112
|
* which asks IAM for an existing session before it draws a form
|
|
113
113
|
* (components/auth/panel.tsx `Gate`). On a `guest` host the same address is asked for on hanzo.ai instead. With no `to`
|
|
114
114
|
* the page is `door()`'s; a control that says "Sign in" names LOGIN.
|
|
@@ -135,7 +135,7 @@ export const CAMPAIGN = [
|
|
|
135
135
|
* The sign-in address for a reader on `here`: `to`, with `here` as its `next=`
|
|
136
136
|
* when that is a page worth coming back to, and the campaign `here` carries as
|
|
137
137
|
* `to`'s own parameters. The page itself is written in the address too, so the
|
|
138
|
-
* place (
|
|
138
|
+
* place (an app, a prompt in `?q=`) survives what sessionStorage does not: a new
|
|
139
139
|
* tab, a pasted link.
|
|
140
140
|
*/
|
|
141
141
|
export function entry(to, here) {
|
package/dist/lib/home.d.ts
CHANGED
|
@@ -46,8 +46,8 @@ export interface App {
|
|
|
46
46
|
* control and its verb are the same thing again.
|
|
47
47
|
*
|
|
48
48
|
* A PATH, not a URL. It is a page of this app, so it is reached the way every
|
|
49
|
-
* other page of this app is, and the three doors that offer it (
|
|
50
|
-
*
|
|
49
|
+
* other page of this app is, and the three doors that offer it (Home's Team
|
|
50
|
+
* tile, the Create menu, the sidebar's row) all read this one line.
|
|
51
51
|
*/
|
|
52
52
|
export declare const invite: () => string;
|
|
53
53
|
/** The org's projects, newest first. */
|
package/dist/lib/home.js
CHANGED
|
@@ -32,8 +32,8 @@ import { settings } from './host.js';
|
|
|
32
32
|
* control and its verb are the same thing again.
|
|
33
33
|
*
|
|
34
34
|
* A PATH, not a URL. It is a page of this app, so it is reached the way every
|
|
35
|
-
* other page of this app is, and the three doors that offer it (
|
|
36
|
-
*
|
|
35
|
+
* other page of this app is, and the three doors that offer it (Home's Team
|
|
36
|
+
* tile, the Create menu, the sidebar's row) all read this one line.
|
|
37
37
|
*/
|
|
38
38
|
export const invite = () => site(settings('members'));
|
|
39
39
|
/** The org's projects, newest first. */
|
package/dist/lib/host.d.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* hanzo.ai is the site for a stranger and the app for a member: the web app is
|
|
6
6
|
* /chat and /dev once signed in, and `/` takes a member to the mode they were
|
|
7
7
|
* last in. hanzo.team is the workspace, its own app (hanzo-apps/team) with Home
|
|
8
|
-
* at its root. This export still carries the
|
|
9
|
-
* apex is sent to the same
|
|
10
|
-
* server to do that, so it is decided in the browser off the hostname,
|
|
8
|
+
* at its root. This export still carries the workspace's apps, so an app asked
|
|
9
|
+
* for on the apex is sent to the same app on hanzo.team, and `output: 'export'`
|
|
10
|
+
* has no server to do that, so it is decided in the browser off the hostname,
|
|
11
|
+
* here.
|
|
11
12
|
*
|
|
12
13
|
* Two predicates, one per product: `apex()` for the app, `team()` for the
|
|
13
14
|
* workspace. Every host that is neither (localhost, a preview) draws the whole
|
|
@@ -116,7 +117,7 @@ export declare function place(pathname: string): Place | null;
|
|
|
116
117
|
export declare function page(pathname: string): string;
|
|
117
118
|
/**
|
|
118
119
|
* Dev opened on one run, repository or site, from anywhere: every "Try Hanzo
|
|
119
|
-
* Dev" link,
|
|
120
|
+
* Dev" link, the rail's Dev, the console's "open in the builder". It signs a
|
|
120
121
|
* stranger in on the way (app/(app)/dev/_door.tsx), and is reached through
|
|
121
122
|
* `site()`: here on hanzo.ai, across to hanzo.ai from hanzo.team. Only a value
|
|
122
123
|
* that is exactly a session id, a repository or a site's slug is carried;
|
|
@@ -130,7 +131,7 @@ export declare const dev: (ref?: string | null) => string;
|
|
|
130
131
|
* history entry into `usePathname`, so the app follows the path it reads.
|
|
131
132
|
*/
|
|
132
133
|
export declare function go(address: string, replace?: boolean): void;
|
|
133
|
-
/** The host's router, as far as moving to a page goes (`
|
|
134
|
+
/** The host's router, as far as moving to a page goes (`useHost().router`). */
|
|
134
135
|
interface Router {
|
|
135
136
|
push(href: string): void;
|
|
136
137
|
replace(href: string): void;
|
|
@@ -146,25 +147,25 @@ export declare function remember(mode: Place['mode']): void;
|
|
|
146
147
|
/** Where `/` takes a member: the mode they were last in, Chat when none is kept. */
|
|
147
148
|
export declare function resume(): string;
|
|
148
149
|
/**
|
|
149
|
-
* The workspace's
|
|
150
|
+
* The workspace's apps: every route under app/(app) the apex does not keep.
|
|
150
151
|
*
|
|
151
|
-
* Derived from the
|
|
152
|
-
* app
|
|
152
|
+
* Derived from the routes hanzo.ai keeps under app/(app) (routes.json), so an
|
|
153
|
+
* app added there lives on hanzo.team unless the apex names it above.
|
|
153
154
|
*/
|
|
154
|
-
export declare const
|
|
155
|
-
/** The apex's hosts, where the app is served and the
|
|
155
|
+
export declare const APPS: readonly string[];
|
|
156
|
+
/** The apex's hosts, where the app is served and the workspace's apps are not. */
|
|
156
157
|
export declare const APEX: readonly string[];
|
|
157
158
|
/** Whether a host is the apex. */
|
|
158
159
|
export declare const apex: (hostname: string) => boolean;
|
|
159
|
-
/** Whether a host is the workspace's own, where every
|
|
160
|
+
/** Whether a host is the workspace's own, where every app asks for a paid plan. */
|
|
160
161
|
export declare const team: (hostname: string) => boolean;
|
|
161
|
-
/** Whether an address on this export, query and all, opens one of the workspace's
|
|
162
|
-
export declare function
|
|
162
|
+
/** Whether an address on this export, query and all, opens one of the workspace's apps, which leave the apex. */
|
|
163
|
+
export declare function leaves(address: string): boolean;
|
|
163
164
|
/**
|
|
164
165
|
* Where an address belongs when it is asked for on `hostname`: on a `guest`
|
|
165
|
-
* alias, the same address on hanzo.ai, because every
|
|
166
|
-
* host cannot; on the apex, the same
|
|
167
|
-
* null. Home is the workspace's root, so /home?
|
|
166
|
+
* alias, the same address on hanzo.ai, because every app signs in and a guest
|
|
167
|
+
* host cannot; on the apex, the same app and query on the workspace; otherwise
|
|
168
|
+
* null. Home is the workspace's root, so /home?channel=x lands on /?channel=x.
|
|
168
169
|
*/
|
|
169
170
|
export declare const away: (hostname: string, address: string) => string | null;
|
|
170
171
|
/** Where a sign-in started on a `guest` host is finished. */
|
package/dist/lib/host.js
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
* hanzo.ai is the site for a stranger and the app for a member: the web app is
|
|
6
6
|
* /chat and /dev once signed in, and `/` takes a member to the mode they were
|
|
7
7
|
* last in. hanzo.team is the workspace, its own app (hanzo-apps/team) with Home
|
|
8
|
-
* at its root. This export still carries the
|
|
9
|
-
* apex is sent to the same
|
|
10
|
-
* server to do that, so it is decided in the browser off the hostname,
|
|
8
|
+
* at its root. This export still carries the workspace's apps, so an app asked
|
|
9
|
+
* for on the apex is sent to the same app on hanzo.team, and `output: 'export'`
|
|
10
|
+
* has no server to do that, so it is decided in the browser off the hostname,
|
|
11
|
+
* here.
|
|
11
12
|
*
|
|
12
13
|
* Two predicates, one per product: `apex()` for the app, `team()` for the
|
|
13
14
|
* workspace. Every host that is neither (localhost, a preview) draws the whole
|
|
14
15
|
* workspace and admits the way the apex does.
|
|
15
16
|
*/
|
|
16
|
-
import
|
|
17
|
+
import ROUTES from './routes.json' with { type: 'json' };
|
|
17
18
|
import { href, parse, path, route, SESSION, SLUG } from '@hanzo/build/route';
|
|
18
19
|
import { site } from '../where.js';
|
|
19
20
|
import { BETAS } from './betas.js';
|
|
@@ -174,7 +175,7 @@ export function page(pathname) {
|
|
|
174
175
|
const REPO = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}\/[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
175
176
|
/**
|
|
176
177
|
* Dev opened on one run, repository or site, from anywhere: every "Try Hanzo
|
|
177
|
-
* Dev" link,
|
|
178
|
+
* Dev" link, the rail's Dev, the console's "open in the builder". It signs a
|
|
178
179
|
* stranger in on the way (app/(app)/dev/_door.tsx), and is reached through
|
|
179
180
|
* `site()`: here on hanzo.ai, across to hanzo.ai from hanzo.team. Only a value
|
|
180
181
|
* that is exactly a session id, a repository or a site's slug is carried;
|
|
@@ -237,33 +238,33 @@ export function resume() {
|
|
|
237
238
|
/** The routes under app/(app) the apex keeps: the app — /chat, a chat shared by link, and /dev. */
|
|
238
239
|
const KEPT = new Set(['/chat', '/chat/shared', '/dev']);
|
|
239
240
|
/**
|
|
240
|
-
* The workspace's
|
|
241
|
+
* The workspace's apps: every route under app/(app) the apex does not keep.
|
|
241
242
|
*
|
|
242
|
-
* Derived from the
|
|
243
|
-
* app
|
|
243
|
+
* Derived from the routes hanzo.ai keeps under app/(app) (routes.json), so an
|
|
244
|
+
* app added there lives on hanzo.team unless the apex names it above.
|
|
244
245
|
*/
|
|
245
|
-
export const
|
|
246
|
-
/** The apex's hosts, where the app is served and the
|
|
246
|
+
export const APPS = ROUTES.filter((path) => !KEPT.has(path) && path !== SETTINGS && !path.startsWith(`${SETTINGS}/`));
|
|
247
|
+
/** The apex's hosts, where the app is served and the workspace's apps are not. */
|
|
247
248
|
export const APEX = ['hanzo.ai', 'www.hanzo.ai'];
|
|
248
249
|
/** Whether a host is the apex. */
|
|
249
250
|
export const apex = (hostname) => APEX.includes(hostname);
|
|
250
|
-
/** Whether a host is the workspace's own, where every
|
|
251
|
+
/** Whether a host is the workspace's own, where every app asks for a paid plan. */
|
|
251
252
|
export const team = (hostname) => hostname === 'hanzo.team' || hostname === 'www.hanzo.team';
|
|
252
|
-
/** Whether an address on this export, query and all, opens one of the workspace's
|
|
253
|
-
export function
|
|
253
|
+
/** Whether an address on this export, query and all, opens one of the workspace's apps, which leave the apex. */
|
|
254
|
+
export function leaves(address) {
|
|
254
255
|
const path = address.split(/[?#]/)[0].replace(/\/+$/, '') || '/';
|
|
255
|
-
return
|
|
256
|
+
return APPS.includes(path);
|
|
256
257
|
}
|
|
257
258
|
/**
|
|
258
259
|
* Where an address belongs when it is asked for on `hostname`: on a `guest`
|
|
259
|
-
* alias, the same address on hanzo.ai, because every
|
|
260
|
-
* host cannot; on the apex, the same
|
|
261
|
-
* null. Home is the workspace's root, so /home?
|
|
260
|
+
* alias, the same address on hanzo.ai, because every app signs in and a guest
|
|
261
|
+
* host cannot; on the apex, the same app and query on the workspace; otherwise
|
|
262
|
+
* null. Home is the workspace's root, so /home?channel=x lands on /?channel=x.
|
|
262
263
|
*/
|
|
263
264
|
export const away = (hostname, address) => {
|
|
264
265
|
if (guest(hostname))
|
|
265
266
|
return SIGNIN + address;
|
|
266
|
-
if (!apex(hostname) || !
|
|
267
|
+
if (!apex(hostname) || !leaves(address))
|
|
267
268
|
return null;
|
|
268
269
|
const home = address.match(/^\/home\/?(?=[?#]|$)/);
|
|
269
270
|
return home ? `${WORKSPACE}/${address.slice(home[0].length)}` : `${WORKSPACE}${address}`;
|
package/dist/lib/hostname.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function useHostname(): string;
|
package/dist/lib/hostname.js
CHANGED
|
@@ -9,6 +9,6 @@ import { useSyncExternalStore } from 'react';
|
|
|
9
9
|
* subscribes, because a page's host never changes under it.
|
|
10
10
|
*/
|
|
11
11
|
const NEVER = () => () => { };
|
|
12
|
-
export function
|
|
12
|
+
export function useHostname() {
|
|
13
13
|
return useSyncExternalStore(NEVER, () => window.location.hostname, () => '');
|
|
14
14
|
}
|
package/dist/lib/list.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A fetched list, as an array or nothing.
|
|
3
3
|
*
|
|
4
4
|
* `x ?? []` covers null and undefined and nothing else: a body that answers
|
|
5
|
-
* `{
|
|
5
|
+
* `{channels: {}}`, or an error object where a page was expected, passes through
|
|
6
6
|
* it and the first `.filter` on it throws in render. A read from the network
|
|
7
7
|
* is a boundary, and this is the one check at it.
|
|
8
8
|
*/
|
package/dist/lib/list.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A fetched list, as an array or nothing.
|
|
3
3
|
*
|
|
4
4
|
* `x ?? []` covers null and undefined and nothing else: a body that answers
|
|
5
|
-
* `{
|
|
5
|
+
* `{channels: {}}`, or an error object where a page was expected, passes through
|
|
6
6
|
* it and the first `.filter` on it throws in render. A read from the network
|
|
7
7
|
* is a boundary, and this is the one check at it.
|
|
8
8
|
*/
|
package/dist/lib/models.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What a provider and a model are CALLED — the few naming rules the
|
|
2
|
+
* What a provider and a model are CALLED — the few naming rules the apps draw
|
|
3
3
|
* with. The catalogue itself (prices, contexts, the serving list) is the host's.
|
|
4
4
|
*/
|
|
5
5
|
import { getOrgAndSlug } from './path.js';
|
package/dist/lib/org.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare class Refusal extends Error {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* The words of any failure, for a toast or a line under a control: a refusal
|
|
33
|
-
* this module worded in the reader's language (
|
|
33
|
+
* this module worded in the reader's language (an app passes its `t`), the
|
|
34
34
|
* server's words as they came, else a plain line.
|
|
35
35
|
*/
|
|
36
36
|
export declare const say: (e: unknown, t?: Say) => string;
|
package/dist/lib/org.js
CHANGED
|
@@ -73,7 +73,7 @@ async function ask(path, init = {}) {
|
|
|
73
73
|
const enc = encodeURIComponent;
|
|
74
74
|
/**
|
|
75
75
|
* The words of any failure, for a toast or a line under a control: a refusal
|
|
76
|
-
* this module worded in the reader's language (
|
|
76
|
+
* this module worded in the reader's language (an app passes its `t`), the
|
|
77
77
|
* server's words as they came, else a plain line.
|
|
78
78
|
*/
|
|
79
79
|
export const say = (e, t = english) => e instanceof Refusal && e.source
|
package/dist/lib/orgname.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare function slugify(name: string): string;
|
|
|
21
21
|
* would. A name onboarding keeps exactly as typed: IAM's shape with single inner
|
|
22
22
|
* hyphens, since onboarding folds a double one. The names IAM holds for the
|
|
23
23
|
* platform are IAM's to refuse, in its own words. Said in the reader's language
|
|
24
|
-
* through the
|
|
24
|
+
* through the app's `t`.
|
|
25
25
|
*/
|
|
26
26
|
export declare function refusal(slug: string, t?: Say): string | null;
|
|
27
27
|
/** Whether an organization answers what was typed: its name or its display name, in any case (IAM's `matches`). */
|
package/dist/lib/orgname.js
CHANGED
|
@@ -35,7 +35,7 @@ export function slugify(name) {
|
|
|
35
35
|
* would. A name onboarding keeps exactly as typed: IAM's shape with single inner
|
|
36
36
|
* hyphens, since onboarding folds a double one. The names IAM holds for the
|
|
37
37
|
* platform are IAM's to refuse, in its own words. Said in the reader's language
|
|
38
|
-
* through the
|
|
38
|
+
* through the app's `t`.
|
|
39
39
|
*/
|
|
40
40
|
export function refusal(slug, t = english) {
|
|
41
41
|
if (slug.length < 2)
|
package/dist/lib/session.d.ts
CHANGED
|
@@ -186,13 +186,13 @@ export declare const ORG = "hanzo:org";
|
|
|
186
186
|
export declare const PICKED = "hanzo:org:picked";
|
|
187
187
|
/**
|
|
188
188
|
* Work in this organization from now on: the SDK's selection, noted as picked
|
|
189
|
-
* and announced. Noted here, so a choice made anywhere — the
|
|
189
|
+
* and announced. Noted here, so a choice made anywhere — the shell's gate, the
|
|
190
190
|
* app's account menu — is one the gate does not ask for again.
|
|
191
191
|
*/
|
|
192
192
|
export declare function pick(o: string): void;
|
|
193
|
-
/** Fired on `window` to open the organization chooser over the
|
|
193
|
+
/** Fired on `window` to open the organization chooser over the shell. */
|
|
194
194
|
export declare const CHOOSE = "hanzo:org:choose";
|
|
195
|
-
/** Open the chooser (`
|
|
195
|
+
/** Open the chooser (`Gate`): every organization of the person's, and every one for a SuperAdmin. */
|
|
196
196
|
export declare function choose(): void;
|
|
197
197
|
/**
|
|
198
198
|
* Whether the signed-in person is a SUPERADMIN: @hanzo/iam's `superAdmin`, which is
|
|
@@ -215,7 +215,7 @@ export declare function assumed(): string | null;
|
|
|
215
215
|
* (hanzoai/iam internal/oidc/masquerade.go). The answer is kept where the SDK
|
|
216
216
|
* keeps the session, with its own expiry, so every request made from here on
|
|
217
217
|
* carries it and the SDK's next refresh ends support mode by itself. The page
|
|
218
|
-
* reloads so every
|
|
218
|
+
* reloads so every app reads under it.
|
|
219
219
|
*/
|
|
220
220
|
export declare function support(org: string | null): Promise<void>;
|
|
221
221
|
/**
|
package/dist/lib/session.js
CHANGED
|
@@ -27,7 +27,7 @@ const KEYS = [ACCESS, REFRESH, `${PREFIX}id_token`, EXPIRES];
|
|
|
27
27
|
* The store the SDK keeps the session in: the host's (`configure({ session })`,
|
|
28
28
|
* Hanzo Desktop's keychain, where no token reaches the webview's localStorage),
|
|
29
29
|
* else this page's localStorage. Only the SDK's own keys are read from it; the
|
|
30
|
-
*
|
|
30
|
+
* apps' own choices (the organization, the person) stay in localStorage.
|
|
31
31
|
*/
|
|
32
32
|
function tokens() {
|
|
33
33
|
return where().session ?? window.localStorage;
|
|
@@ -413,7 +413,7 @@ export function org() {
|
|
|
413
413
|
const chosen = window.localStorage.getItem(`${PREFIX}current_org`);
|
|
414
414
|
if (chosen && mine.includes(chosen))
|
|
415
415
|
return chosen;
|
|
416
|
-
// ONE ORGANIZATION IS NOT A CHOICE. Answering null here until `
|
|
416
|
+
// ONE ORGANIZATION IS NOT A CHOICE. Answering null here until `Gate` had
|
|
417
417
|
// recorded a pick meant every single-organization reader began UNSCOPED:
|
|
418
418
|
// the client was built without X-Org-Id, the pick fired the event a moment
|
|
419
419
|
// later, and useAi rebuilt the client — so every hook restarted after first
|
|
@@ -457,7 +457,7 @@ export const ORG = 'hanzo:org';
|
|
|
457
457
|
export const PICKED = 'hanzo:org:picked';
|
|
458
458
|
/**
|
|
459
459
|
* Work in this organization from now on: the SDK's selection, noted as picked
|
|
460
|
-
* and announced. Noted here, so a choice made anywhere — the
|
|
460
|
+
* and announced. Noted here, so a choice made anywhere — the shell's gate, the
|
|
461
461
|
* app's account menu — is one the gate does not ask for again.
|
|
462
462
|
*/
|
|
463
463
|
export function pick(o) {
|
|
@@ -470,9 +470,9 @@ export function pick(o) {
|
|
|
470
470
|
}
|
|
471
471
|
window.dispatchEvent(new Event(ORG));
|
|
472
472
|
}
|
|
473
|
-
/** Fired on `window` to open the organization chooser over the
|
|
473
|
+
/** Fired on `window` to open the organization chooser over the shell. */
|
|
474
474
|
export const CHOOSE = 'hanzo:org:choose';
|
|
475
|
-
/** Open the chooser (`
|
|
475
|
+
/** Open the chooser (`Gate`): every organization of the person's, and every one for a SuperAdmin. */
|
|
476
476
|
export function choose() {
|
|
477
477
|
window.dispatchEvent(new Event(CHOOSE));
|
|
478
478
|
}
|
|
@@ -502,7 +502,7 @@ export function assumed() {
|
|
|
502
502
|
* (hanzoai/iam internal/oidc/masquerade.go). The answer is kept where the SDK
|
|
503
503
|
* keeps the session, with its own expiry, so every request made from here on
|
|
504
504
|
* carries it and the SDK's next refresh ends support mode by itself. The page
|
|
505
|
-
* reloads so every
|
|
505
|
+
* reloads so every app reads under it.
|
|
506
506
|
*/
|
|
507
507
|
export async function support(org) {
|
|
508
508
|
const token = bearer();
|
package/dist/lib/tier.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ export declare function transient(e: unknown): boolean;
|
|
|
115
115
|
* What a read of the tier leaves held, and the tier the next read falls back
|
|
116
116
|
* on. A read that answers is the tier. One that fails for a moment
|
|
117
117
|
* (`transient`) keeps the tier this organization was last read at, so a reader
|
|
118
|
-
* is not swapped out of
|
|
118
|
+
* is not swapped out of an app they pay for by a re-read that did not answer
|
|
119
119
|
* (the gate reads again on focus and on return). Billing's refusal, or a
|
|
120
120
|
* failure with nothing read for it yet, holds nothing and says why, which keeps
|
|
121
121
|
* every gate shut; a refusal also forgets the tier read before it, so no later
|
|
@@ -133,7 +133,7 @@ export declare function hold(last: Read | null, org: string | null, read: {
|
|
|
133
133
|
/**
|
|
134
134
|
* The tier and the refusal held for `org`, and nothing for any other: what was
|
|
135
135
|
* read for the organization a reader just left is never the one they are in,
|
|
136
|
-
* so a switch from a paid organization to a team on Free shows no
|
|
136
|
+
* so a switch from a paid organization to a team on Free shows no app while
|
|
137
137
|
* the new one is read.
|
|
138
138
|
*/
|
|
139
139
|
export declare function standing(held: Held | null, org: string | null): {
|
|
@@ -157,7 +157,7 @@ export declare function useTier(enabled?: boolean, org?: string | null): {
|
|
|
157
157
|
* The token's `orgs` claim names an organization and the reader's role in it
|
|
158
158
|
* and says nothing of its kind; IAM keeps that on the row (`isPersonal`), and
|
|
159
159
|
* `GET /v1/iam/organizations` answers the rows the caller belongs to. `null`
|
|
160
|
-
* until it is answered for this organization. A refusal reads as `false`, so
|
|
161
|
-
*
|
|
160
|
+
* until it is answered for this organization. A refusal reads as `false`, so an
|
|
161
|
+
* app that needs a plan goes on asking for one.
|
|
162
162
|
*/
|
|
163
163
|
export declare function usePersonal(org: string | null, enabled?: boolean): boolean | null;
|
package/dist/lib/tier.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* did not come from a response.
|
|
19
19
|
*
|
|
20
20
|
* The failure carries `status` because that is what `workspace/failure.ts`
|
|
21
|
-
* reads first, so a refusal here already speaks the vocabulary every
|
|
21
|
+
* reads first, so a refusal here already speaks the vocabulary every app uses.
|
|
22
22
|
* A second Refusal class would be a second vocabulary for the same event.
|
|
23
23
|
*/
|
|
24
24
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
@@ -166,7 +166,7 @@ export function transient(e) {
|
|
|
166
166
|
* What a read of the tier leaves held, and the tier the next read falls back
|
|
167
167
|
* on. A read that answers is the tier. One that fails for a moment
|
|
168
168
|
* (`transient`) keeps the tier this organization was last read at, so a reader
|
|
169
|
-
* is not swapped out of
|
|
169
|
+
* is not swapped out of an app they pay for by a re-read that did not answer
|
|
170
170
|
* (the gate reads again on focus and on return). Billing's refusal, or a
|
|
171
171
|
* failure with nothing read for it yet, holds nothing and says why, which keeps
|
|
172
172
|
* every gate shut; a refusal also forgets the tier read before it, so no later
|
|
@@ -183,7 +183,7 @@ export function hold(last, org, read) {
|
|
|
183
183
|
/**
|
|
184
184
|
* The tier and the refusal held for `org`, and nothing for any other: what was
|
|
185
185
|
* read for the organization a reader just left is never the one they are in,
|
|
186
|
-
* so a switch from a paid organization to a team on Free shows no
|
|
186
|
+
* so a switch from a paid organization to a team on Free shows no app while
|
|
187
187
|
* the new one is read.
|
|
188
188
|
*/
|
|
189
189
|
export function standing(held, org) {
|
|
@@ -223,8 +223,8 @@ export function useTier(enabled = true, org = null) {
|
|
|
223
223
|
* The token's `orgs` claim names an organization and the reader's role in it
|
|
224
224
|
* and says nothing of its kind; IAM keeps that on the row (`isPersonal`), and
|
|
225
225
|
* `GET /v1/iam/organizations` answers the rows the caller belongs to. `null`
|
|
226
|
-
* until it is answered for this organization. A refusal reads as `false`, so
|
|
227
|
-
*
|
|
226
|
+
* until it is answered for this organization. A refusal reads as `false`, so an
|
|
227
|
+
* app that needs a plan goes on asking for one.
|
|
228
228
|
*/
|
|
229
229
|
export function usePersonal(org, enabled = true) {
|
|
230
230
|
const [read, setRead] = useState(null);
|
package/dist/lib/tiers.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare function useTiers(): Set<Tier>;
|
|
|
3
3
|
/** The tiers this reader has chosen to hide, and the toggle that sets them.
|
|
4
4
|
*
|
|
5
5
|
* Entitlement is one question (`useTiers`), what you want to see is another. A
|
|
6
|
-
* reader who may see a beta
|
|
6
|
+
* reader who may see a beta app can still put it away — the choice is theirs and
|
|
7
7
|
* lives with them, in this browser, never on the server. It starts empty: you see
|
|
8
8
|
* what you are entitled to until you say otherwise. */
|
|
9
9
|
export declare function useHidden(): [Set<Tier>, (tier: Tier) => void];
|
package/dist/lib/tiers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
// Which preview tiers this identity may see.
|
|
3
3
|
//
|
|
4
|
-
// The rail offers Chat and Dev to everyone. The
|
|
4
|
+
// The rail offers Chat and Dev to everyone. The apps after them — Inbox,
|
|
5
5
|
// Agents, Tasks, Drive — are behind a tier, and a tier opens for exactly three
|
|
6
6
|
// reasons, asked here and nowhere else:
|
|
7
7
|
//
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
// 2. An ALPHA or BETA org sees its own tier. Whether an org is in a cohort is
|
|
15
15
|
// a targeting decision that lives on the cloud, so it is asked of the cloud:
|
|
16
16
|
// POST /v1/flags answers the feature flags in force for this identity, and
|
|
17
|
-
// `tier.alpha` / `tier.beta` open their
|
|
17
|
+
// `tier.alpha` / `tier.beta` open their apps.
|
|
18
18
|
//
|
|
19
|
-
// 3. A LOCALHOST BUILD sees every tier, because
|
|
20
|
-
//
|
|
19
|
+
// 3. A LOCALHOST BUILD sees every tier, because an app nobody can open is an
|
|
20
|
+
// app nobody can work on. The check is the ORIGIN the page was served
|
|
21
21
|
// from, not an env var and not a build flag: a deployed host can never
|
|
22
22
|
// satisfy it however it is configured, so this cannot leak an unfinished
|
|
23
|
-
//
|
|
23
|
+
// app into production by being set wrong somewhere.
|
|
24
24
|
//
|
|
25
25
|
// 4. Nothing else. Signed out, still loading, or on any error the answer is the
|
|
26
26
|
// empty set: the rail shows Chat and Dev and nothing more. Failing closed is
|
|
27
27
|
// the point — a stranger meets the product the landing page describes, and a
|
|
28
|
-
// flags outage cannot leak an unfinished
|
|
28
|
+
// flags outage cannot leak an unfinished app into it.
|
|
29
29
|
//
|
|
30
30
|
// The per-account SETTING that hides a tier the reader is entitled to lives with
|
|
31
31
|
// the reader, not here — see `useHidden`. This answers what you MAY see; that
|
|
@@ -82,9 +82,9 @@ export function useTiers() {
|
|
|
82
82
|
const ac = new AbortController();
|
|
83
83
|
// The PostHog-shaped evaluate: a distinct_id and the person's org, answered
|
|
84
84
|
// with `{ featureFlags: { … } }`. The bearer carries the principal, as on
|
|
85
|
-
// every other read: no host the
|
|
85
|
+
// every other read: no host the apps are drawn on holds a session cookie
|
|
86
86
|
// for the API, so a cookie alone was answered 403 on every page. A refusal
|
|
87
|
-
// still falls to the empty set, the signed-out
|
|
87
|
+
// still falls to the empty set, the signed-out rail — the safe direction.
|
|
88
88
|
fetch(`${api()}/v1/flags`, {
|
|
89
89
|
method: 'POST',
|
|
90
90
|
headers: { 'content-type': 'application/json', ...scope() },
|
|
@@ -97,7 +97,7 @@ export function useTiers() {
|
|
|
97
97
|
return () => ac.abort();
|
|
98
98
|
}, [id, superAdmin, organizations]);
|
|
99
99
|
// A platform admin, or a page served off a developer's own machine. Both see
|
|
100
|
-
// every tier for the same reason:
|
|
100
|
+
// every tier for the same reason: an app nobody can open is an app nobody can
|
|
101
101
|
// work on.
|
|
102
102
|
if (superAdmin || here)
|
|
103
103
|
return new Set(ALL);
|
|
@@ -112,7 +112,7 @@ const HIDDEN_KEY = 'hanzo.hidden-tiers';
|
|
|
112
112
|
/** The tiers this reader has chosen to hide, and the toggle that sets them.
|
|
113
113
|
*
|
|
114
114
|
* Entitlement is one question (`useTiers`), what you want to see is another. A
|
|
115
|
-
* reader who may see a beta
|
|
115
|
+
* reader who may see a beta app can still put it away — the choice is theirs and
|
|
116
116
|
* lives with them, in this browser, never on the server. It starts empty: you see
|
|
117
117
|
* what you are entitled to until you say otherwise. */
|
|
118
118
|
export function useHidden() {
|
package/dist/lib/web.d.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* WHERE WHAT WAS FOUND GOES: the end of the leading system turn, between two
|
|
28
28
|
* markers no page can know. Not a system turn of its own, because the gateway's
|
|
29
29
|
* text pipeline keeps only the last system turn it reads, and that would drop
|
|
30
|
-
* the
|
|
30
|
+
* the conversation's own; not the person's turn, because the router chooses the model
|
|
31
31
|
* from the last user turn and would read the web pages as the question.
|
|
32
32
|
*
|
|
33
33
|
* A page is read only when the person points at it — never an address that
|
package/dist/lib/web.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* WHERE WHAT WAS FOUND GOES: the end of the leading system turn, between two
|
|
28
28
|
* markers no page can know. Not a system turn of its own, because the gateway's
|
|
29
29
|
* text pipeline keeps only the last system turn it reads, and that would drop
|
|
30
|
-
* the
|
|
30
|
+
* the conversation's own; not the person's turn, because the router chooses the model
|
|
31
31
|
* from the last user turn and would read the web pages as the question.
|
|
32
32
|
*
|
|
33
33
|
* A page is read only when the person points at it — never an address that
|
package/dist/look.js
CHANGED
|
@@ -53,15 +53,13 @@ export function Look() {
|
|
|
53
53
|
if (!customFont.trim())
|
|
54
54
|
return;
|
|
55
55
|
const font = customFont.trim();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
applyFontFamily('sans', `${font}, sans-serif`);
|
|
64
|
-
}
|
|
56
|
+
// The Arabic slot stays first, as in design's own stacks: a custom face
|
|
57
|
+
// sets the Latin, and the reader's Arabic companion still sets the Arabic.
|
|
58
|
+
const family = font.startsWith('http://') || font.startsWith('https://') ? 'CustomBrandFont' : font;
|
|
59
|
+
if (family === 'CustomBrandFont')
|
|
60
|
+
injectCustomFont({ family, url: font, isStylesheet: true });
|
|
61
|
+
applyFontFamily('heading', `var(--font-arabic), ${family}, sans-serif`);
|
|
62
|
+
applyFontFamily('sans', `var(--font-arabic), ${family}, sans-serif`);
|
|
65
63
|
setFontApplied(true);
|
|
66
64
|
setTimeout(() => setFontApplied(false), 2500);
|
|
67
65
|
};
|
package/dist/network.d.ts
CHANGED
|
@@ -12,16 +12,16 @@ interface Net {
|
|
|
12
12
|
/** Set where the row is a capability rather than a brand. */
|
|
13
13
|
glyph?: LucideIcon;
|
|
14
14
|
}
|
|
15
|
-
/** What we know about a
|
|
16
|
-
* a name and nothing else, and lands on the same initial Yahoo does. */
|
|
17
|
-
export declare function of(
|
|
15
|
+
/** What we know about a transport key, including one nobody taught us — which
|
|
16
|
+
* is a name and nothing else, and lands on the same initial Yahoo does. */
|
|
17
|
+
export declare function of(transport: string): Net;
|
|
18
18
|
/**
|
|
19
19
|
* WHAT TO CALL THE SPEAKER.
|
|
20
20
|
*
|
|
21
21
|
* NOTHING THAT ARRIVES HERE CARRIES A NAME. `sender` is the network's own id
|
|
22
22
|
* for the person — "U031THJJ7F1" on Slack, a snowflake on Discord, a GUID on
|
|
23
23
|
* Teams — because that is what every adapter puts there; the envelope declares
|
|
24
|
-
* a `Display` beside it (
|
|
24
|
+
* a `Display` beside it (the transport's envelope) and not one of the
|
|
25
25
|
* five adapters fills it, so no name is stored and none is served.
|
|
26
26
|
* `senderUser` is not the name either: it is the linked account's OIDC `sub`,
|
|
27
27
|
* which IAM mints from a UUID, so it identifies a Hanzo account without saying
|
|
@@ -31,35 +31,35 @@ export declare function of(channel: string): Net;
|
|
|
31
31
|
* "U031THJJ7F1" for what somebody calls themselves. So the id is MARKED as an
|
|
32
32
|
* id — '@' is how every one of these networks writes a handle it has not
|
|
33
33
|
* resolved — and it is kept, because it is the only thing that tells two
|
|
34
|
-
* speakers apart. A
|
|
35
|
-
*
|
|
34
|
+
* speakers apart. A channel holds messages from many people (useInbox groups by
|
|
35
|
+
* transport and channel, never by sender), so dropping it renders every line of a
|
|
36
36
|
* group identically and a reader cannot tell who said what. Only where no id
|
|
37
37
|
* arrived at all is the network the one thing left to say. The day the
|
|
38
38
|
* platform resolves a name, this is where it goes.
|
|
39
39
|
*/
|
|
40
|
-
export declare const speaker: (
|
|
41
|
-
/** A
|
|
42
|
-
* handle for a DM, the network's
|
|
43
|
-
* where no id arrived. */
|
|
44
|
-
export declare function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
export declare const speaker: (transport: string, sender?: string) => string;
|
|
41
|
+
/** A channel is named by its own address, not by whoever spoke in it last: the
|
|
42
|
+
* handle for a DM, the network's channel id otherwise, and the transport it is
|
|
43
|
+
* on where no id arrived. */
|
|
44
|
+
export declare function channelName(channel: {
|
|
45
|
+
transport: string;
|
|
46
|
+
channelId?: string;
|
|
47
|
+
channelKind: string;
|
|
48
48
|
last: {
|
|
49
49
|
sender?: string;
|
|
50
50
|
};
|
|
51
51
|
}): string;
|
|
52
52
|
/**
|
|
53
|
-
* One
|
|
53
|
+
* One transport's mark, at whatever size the caller has space for.
|
|
54
54
|
*
|
|
55
55
|
* A rounded square rather than a disc, because in the Inbox the face beside it
|
|
56
56
|
* IS a disc and two circles the same size read as two people rather than as a
|
|
57
|
-
* person and where they wrote from. The
|
|
57
|
+
* person and where they wrote from. The Directory's grid draws the same mark at
|
|
58
58
|
* 46px, which is the size the vendor files were cut for and still the size the
|
|
59
59
|
* simple-icons silhouettes were meant to scale to.
|
|
60
60
|
*/
|
|
61
|
-
export declare function Network({
|
|
62
|
-
|
|
61
|
+
export declare function Network({ transport, size }: {
|
|
62
|
+
transport: string;
|
|
63
63
|
size?: number;
|
|
64
64
|
}): import("react").JSX.Element;
|
|
65
65
|
export {};
|