@hanzo/app 0.2.58 → 0.3.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.
- 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/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 +3 -3
- 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/conversations.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
// WHAT ARRIVED, IN ONE LIST.
|
|
3
3
|
//
|
|
4
|
-
// The messages other networks carry in (`/v1/
|
|
5
|
-
// `@hanzo/ai`'s `useInbox`), as the Inbox lists them. A
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// REPLY to and a
|
|
4
|
+
// The messages other networks carry in (`/v1/transport/inbox`, read by
|
|
5
|
+
// `@hanzo/ai`'s `useInbox`), as the Inbox lists them. A team channel is not an
|
|
6
|
+
// arrival: it is a place the org talks in, read and answered on /home
|
|
7
|
+
// (`channels.ts`), and each kind keeps its own reader because a thread you
|
|
8
|
+
// REPLY to and a channel you POST into are not the same act.
|
|
9
9
|
//
|
|
10
10
|
// `key` is the ONE id the workspace selects by, and it names its own source:
|
|
11
|
-
// `net:<
|
|
12
|
-
//
|
|
13
|
-
//
|
|
11
|
+
// `net:<key>` here (`@hanzo/ai` keys an arrived channel by its transport and
|
|
12
|
+
// channel id), `team:<space>/<id>` for a team channel. Prefixed rather than
|
|
13
|
+
// hashed, because a key a person can read in a URL is one they can report in a
|
|
14
|
+
// bug, and a lookup that misses is a bug rather than a category.
|
|
14
15
|
import { useMemo } from 'react';
|
|
15
16
|
import { useInbox } from '@hanzo/ai/react';
|
|
16
17
|
import { roster } from './cast.js';
|
|
17
|
-
/** What to call a member in a
|
|
18
|
+
/** What to call a member in a conversation. The roster carries one name; this is it. */
|
|
18
19
|
const label = (m) => m.name;
|
|
19
20
|
/** "Ada", "Ada and Mel", "Ada, Mel and Sam". */
|
|
20
21
|
const named = (names) => names.length <= 1
|
|
21
22
|
? (names[0] ?? '')
|
|
22
23
|
: `${names.slice(0, -1).join(', ')} and ${names[names.length - 1]}`;
|
|
23
|
-
/** The key for an arrival. `useInbox` already keys a
|
|
24
|
+
/** The key for an arrival. `useInbox` already keys a channel; this qualifies it. */
|
|
24
25
|
export const netKey = (arrival) => `net:${arrival.key}`;
|
|
25
26
|
/**
|
|
26
27
|
* Every conversation this reader has been sent, newest first.
|
|
@@ -29,14 +30,14 @@ export const netKey = (arrival) => `net:${arrival.key}`;
|
|
|
29
30
|
* anything of its own, so the list costs no request that was not already made.
|
|
30
31
|
*/
|
|
31
32
|
export function useConversations() {
|
|
32
|
-
const {
|
|
33
|
+
const { channels: arrivals, loading, reload } = useInbox({ limit: 100 });
|
|
33
34
|
const conversations = useMemo(() => arrivals
|
|
34
35
|
.map((arrival) => ({
|
|
35
36
|
key: netKey(arrival),
|
|
36
37
|
// The handle we hold, which is the only thing that tells two senders
|
|
37
38
|
// on one network apart. See Inbox's `speaker`.
|
|
38
|
-
title: arrival.last.sender ? `@${arrival.last.sender}` : arrival.
|
|
39
|
-
|
|
39
|
+
title: arrival.last.sender ? `@${arrival.last.sender}` : arrival.transport,
|
|
40
|
+
transport: arrival.transport,
|
|
40
41
|
lastAt: arrival.lastAt * 1000,
|
|
41
42
|
preview: arrival.last.text,
|
|
42
43
|
arrival,
|
|
@@ -51,17 +52,17 @@ export function conversationOf(all, key) {
|
|
|
51
52
|
}
|
|
52
53
|
// ── Starting one, and when one last named someone ──────────────────────────
|
|
53
54
|
//
|
|
54
|
-
// These came across the rewrite of how
|
|
55
|
+
// These came across the rewrite of how channels are READ, because they are not
|
|
55
56
|
// about reading: `start` opens a conversation with people the directory picked,
|
|
56
57
|
// and `spokenAt` says when one last named a person, which is how the directory
|
|
57
58
|
// sorts. `Member` belongs to the roster now, so they take it from there.
|
|
58
59
|
export const opening = (members) => `With ${named(members.map(label))}`;
|
|
59
60
|
/**
|
|
60
|
-
* Writes the
|
|
61
|
+
* Writes the conversation and answers its id.
|
|
61
62
|
*
|
|
62
63
|
* The agents in it go in AHEAD of the opening line as the roster turn
|
|
63
64
|
* (cast.tsx `roster`), which is how a conversation keeps who is in it: /chat
|
|
64
|
-
* seats
|
|
65
|
+
* seats them when the thread opens and reads each agent's brief fresh.
|
|
65
66
|
* One agent, several, people, or a mix: all open by this one call.
|
|
66
67
|
*/
|
|
67
68
|
export async function start(ai, members) {
|
|
@@ -73,7 +74,7 @@ export async function start(ai, members) {
|
|
|
73
74
|
{ role: 'user', content: opening(members) },
|
|
74
75
|
]);
|
|
75
76
|
// `record` answers "" where the body carried no id, which is a write that did
|
|
76
|
-
// not happen — never a
|
|
77
|
+
// not happen — never a conversation to open.
|
|
77
78
|
if (!id)
|
|
78
79
|
throw new Error('The conversation store answered without an id.');
|
|
79
80
|
return id;
|
package/dist/crew.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Shelf } from './agents.js';
|
|
|
6
6
|
* their own; the event is how a new agent reaches every one of them.
|
|
7
7
|
*/
|
|
8
8
|
export declare function useCrew(): ReturnType<typeof useAgents>;
|
|
9
|
-
/** The house crew's names, which a reply may be split by even after one has left the
|
|
9
|
+
/** The house crew's names, which a reply may be split by even after one has left the conversation. */
|
|
10
10
|
export declare const HOUSE: readonly string[];
|
|
11
11
|
/** Opens the New agent sheet, blank or on its persona list; null shuts it. */
|
|
12
12
|
export declare function make(how: 'new' | 'persona' | null): void;
|
package/dist/crew.js
CHANGED
|
@@ -5,8 +5,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
5
5
|
// The composer's `+` › Agents (`useAgentShelf`) lists the org's agents, the
|
|
6
6
|
// default cast first: the core team hanzoai/personas publishes (team.ts), drawn
|
|
7
7
|
// for an org that keeps no row of its own for a member. Picking one adds it to
|
|
8
|
-
// the conversation that is open, and the reply comes back in each voice in
|
|
9
|
-
//
|
|
8
|
+
// the conversation that is open, and the reply comes back in each voice in
|
|
9
|
+
// it; picking it again lets it out. The page does not move. Create agent and
|
|
10
10
|
// Browse personas open the sheet (`Hire`, mounted once by `AgentMaker`); Manage
|
|
11
11
|
// agents is Dev's Customize › Agents.
|
|
12
12
|
//
|
|
@@ -20,7 +20,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
20
20
|
import { phrase, pieces } from '@hanzo/i18n';
|
|
21
21
|
import { useI18n } from '@hanzo/i18n/react';
|
|
22
22
|
import { Fragment, useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
23
|
-
import {
|
|
23
|
+
import { useHost } from './host.js';
|
|
24
24
|
import { ArrowLeft, Camera, Check, Plus, Sparkles, Upload, Users } from 'lucide-react';
|
|
25
25
|
import { generateImages } from '@hanzo/ai';
|
|
26
26
|
import { useAgents, useModels } from '@hanzo/ai/react';
|
|
@@ -68,7 +68,7 @@ export function useCrew() {
|
|
|
68
68
|
}, [reload]);
|
|
69
69
|
return agents;
|
|
70
70
|
}
|
|
71
|
-
/** The house crew's names, which a reply may be split by even after one has left the
|
|
71
|
+
/** The house crew's names, which a reply may be split by even after one has left the conversation. */
|
|
72
72
|
export const HOUSE = TEAM.map((one) => one.name);
|
|
73
73
|
/** Two names for one agent differ only in case ("Dev" and "dev"). */
|
|
74
74
|
const same = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
@@ -94,11 +94,11 @@ export function make(how) {
|
|
|
94
94
|
*/
|
|
95
95
|
export function AgentMaker() {
|
|
96
96
|
const how = useSyncExternalStore(listen, () => making, () => null);
|
|
97
|
-
const { agents:
|
|
97
|
+
const { agents: cast, openAgent } = useOpen();
|
|
98
98
|
if (!how)
|
|
99
99
|
return null;
|
|
100
100
|
return (_jsx(Hire, { start: how === 'persona', onClose: () => make(null), onMade: (name) => {
|
|
101
|
-
if (!
|
|
101
|
+
if (!cast.some((there) => same(there, name)))
|
|
102
102
|
openAgent(name);
|
|
103
103
|
} }));
|
|
104
104
|
}
|
|
@@ -109,15 +109,15 @@ export function AgentMaker() {
|
|
|
109
109
|
export function useAgentShelf() {
|
|
110
110
|
const { t } = useI18n();
|
|
111
111
|
const { agents, loading, error } = useCrew();
|
|
112
|
-
const { agents:
|
|
113
|
-
const pathed =
|
|
112
|
+
const { agents: cast, openAgent } = useOpen();
|
|
113
|
+
const pathed = useHost().path !== null;
|
|
114
114
|
return {
|
|
115
115
|
rows: ordered(agents).map((one) => ({
|
|
116
116
|
id: one.name,
|
|
117
117
|
label: called(one.name),
|
|
118
118
|
icon: _jsx(Face, { src: one.avatar, emoji: one.emoji, name: one.name, size: 16 }),
|
|
119
119
|
note: member(one.name)?.role ?? one.description,
|
|
120
|
-
on:
|
|
120
|
+
on: cast.some((there) => same(there, one.name)),
|
|
121
121
|
})),
|
|
122
122
|
pick: (id) => openAgent(called(id)),
|
|
123
123
|
loading,
|
|
@@ -138,8 +138,8 @@ export function useAgentShelf() {
|
|
|
138
138
|
export function Crew({ to } = {}) {
|
|
139
139
|
const { t } = useI18n();
|
|
140
140
|
const { agents } = useCrew();
|
|
141
|
-
const { agents:
|
|
142
|
-
const { router, route } =
|
|
141
|
+
const { agents: cast, openAgent, withAgents } = useOpen();
|
|
142
|
+
const { router, route } = useHost();
|
|
143
143
|
const here = route;
|
|
144
144
|
const [hiring, setHiring] = useState(false);
|
|
145
145
|
const talk = (name) => {
|
|
@@ -151,7 +151,7 @@ export function Crew({ to } = {}) {
|
|
|
151
151
|
};
|
|
152
152
|
return (_jsxs(_Fragment, { children: [_jsxs(XStack, { items: "flex-start", flexWrap: "nowrap", overflowX: "auto", overflowY: "hidden", gap: "$2.5", px: "$4", py: "$3", width: "100%", maxW: 820, mx: "auto", "data-slot": "crew", ...bare, role: "group", "aria-label": t('Agents'), children: [ordered(agents).map((one) => {
|
|
153
153
|
const name = called(one.name);
|
|
154
|
-
const on =
|
|
154
|
+
const on = cast.some((there) => there.toLowerCase() === one.name.toLowerCase());
|
|
155
155
|
return (_jsx(Box, { render: "button", onClick: () => talk(name), "aria-pressed": on, "aria-label": t('Chat with {name}', { name }), title: to ? t('Chat with {name}', { name }) : on ? t('Remove {name} from this chat', { name }) : t('Add {name} to this chat', { name }), shrink: 0, children: _jsxs(YStack, { items: "center", gap: "$1.5", width: 68, children: [_jsxs(YStack, { position: "relative", rounded: DISC / 2 + 2, p: 2, borderWidth: 1.5, borderColor: on ? '$ink' : 'transparent', hoverStyle: { borderColor: on ? '$ink' : '$borderColor' }, children: [_jsx(Face, { src: one.avatar, emoji: one.emoji, name: one.name, size: DISC }), on ? (_jsx(YStack, { "aria-hidden": true, position: "absolute", b: -2, insetInlineEnd: -2, width: 18, height: 18, rounded: 9, bg: "$ink", borderWidth: 2, borderColor: "$background", items: "center", justify: "center", children: _jsx(Check, { size: 10, strokeWidth: 3, color: "var(--background)" }) })) : null] }), _jsx(Text, { fontSize: "$1", color: on ? '$ink' : '$soft', numberOfLines: 1, maxW: 68, children: name })] }) }, one.id || one.name));
|
|
156
156
|
}), _jsx(Box, { render: "button", onClick: () => setHiring(true), "aria-label": t('New agent'), "aria-haspopup": "dialog", shrink: 0, children: _jsxs(YStack, { items: "center", gap: "$1.5", width: 68, children: [_jsx(YStack, { width: DISC, height: DISC, rounded: DISC / 2, borderWidth: 1.5, borderStyle: "dashed", borderColor: "$soft", items: "center", justify: "center", hoverStyle: { borderColor: '$ink', bg: '$raised' }, children: _jsx(Plus, { size: 18, "aria-hidden": true }) }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: t('New') })] }) })] }), hiring ? _jsx(Hire, { onClose: () => setHiring(false), onMade: talk }) : null] }));
|
|
157
157
|
}
|
package/dist/dev.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
// each field the way that one does — who is signed in, the organizations they
|
|
6
6
|
// belong to and the one they work in, the theme, where the address is, and how
|
|
7
7
|
// to leave. The name drawn at the top left is Hanzo Dev: this host is the
|
|
8
|
-
// dev agent. Chat, on the
|
|
8
|
+
// dev agent. Chat, on the shell, is Hanzo AI.
|
|
9
9
|
//
|
|
10
10
|
// THE ADDRESS IS A PATH. Dev is /dev, and every place the builder shows is a
|
|
11
11
|
// path under it in the builder's real-path grammar (lib/host.ts `app`, `place`;
|
|
12
12
|
// @hanzo/build/route `href`, `parse`): a run, a screen, a Customize tab, the
|
|
13
13
|
// plans and a project all survive a reload, and Back steps through them. The
|
|
14
|
-
// host hands the
|
|
14
|
+
// host hands the apps the path (`<Host path>`); a move is a native history
|
|
15
15
|
// entry, which the Next router folds into `usePathname`, so reading the address
|
|
16
16
|
// and moving it are one path.
|
|
17
17
|
//
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// pages (lib/host.ts `settings`). A builder section the builder moves to
|
|
20
20
|
// (`go`) and a link it opens (`open`) reach that page through the host's router
|
|
21
21
|
// (`visit`); a pane that asks for Settings (`showSettings`, open.ts) is App's to
|
|
22
|
-
// answer, where the phone's menu is. The
|
|
22
|
+
// answer, where the phone's menu is. The shell draws its own Settings
|
|
23
23
|
// pane; the app has none.
|
|
24
24
|
//
|
|
25
25
|
// THE PLANS ARE THE PAY SITE'S. Every way the app reaches the plans — the
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
// (App.tsx). A page load, at once, not a move inside the app: the pay site is
|
|
31
31
|
// where a plan is bought.
|
|
32
32
|
import { useMemo } from 'react';
|
|
33
|
-
import { useLook,
|
|
33
|
+
import { useLook, useHost } from './host.js';
|
|
34
34
|
import { useIam } from '@hanzo/iam/react';
|
|
35
35
|
import { useSignOut } from './lib/signout.js';
|
|
36
36
|
import { administers, path, route } from '@hanzo/build';
|
|
@@ -77,7 +77,7 @@ const at = (pathname) => {
|
|
|
77
77
|
export function useDevHost() {
|
|
78
78
|
const { user, accessToken } = useIam();
|
|
79
79
|
const logout = useSignOut();
|
|
80
|
-
const { router, path: pathname } =
|
|
80
|
+
const { router, path: pathname } = useHost();
|
|
81
81
|
const here = path(route(at(pathname)));
|
|
82
82
|
const look = useLook();
|
|
83
83
|
// The token's claims change only when the token does: a sign-in, a refresh.
|
|
@@ -109,7 +109,7 @@ export function useDevHost() {
|
|
|
109
109
|
path: here,
|
|
110
110
|
go: (to, how) => (isPlans(to) ? leave('here') : visit(router, app(to), how?.replace)),
|
|
111
111
|
links: LINKS,
|
|
112
|
-
// The sidebar lists Settings' sections and Customize's tabs (
|
|
112
|
+
// The sidebar lists Settings' sections and Customize's tabs (Sidebar.tsx), and Customize › Agents offers the cast.
|
|
113
113
|
sections: true,
|
|
114
114
|
cast: CAST,
|
|
115
115
|
// An address of the app moves the app, another of this site moves in the
|
package/dist/failure.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const refused: (error: unknown) => boolean;
|
|
|
6
6
|
/**
|
|
7
7
|
* A sentence about `subject` — "your drive", "this board" — naming what a
|
|
8
8
|
* reader can do next. Never the caught text: an error written for an operator
|
|
9
|
-
* is not an answer for a reader.
|
|
9
|
+
* is not an answer for a reader. An app passes its `t`, and the subject through
|
|
10
10
|
* it (`say(e, t('this board'), 'read', t)`), so the whole sentence is the reader's.
|
|
11
11
|
*/
|
|
12
12
|
export declare function say(error: unknown, subject: string, act?: 'read' | 'save', t?: Say): string;
|
|
@@ -16,7 +16,7 @@ export declare function say(error: unknown, subject: string, act?: 'read' | 'sav
|
|
|
16
16
|
*
|
|
17
17
|
* A gateway that refuses over credit, a context that ran long, a model nobody
|
|
18
18
|
* serves — each of those is the reader's own situation, stated by the only
|
|
19
|
-
* thing that knows it, and translating them away would leave
|
|
19
|
+
* thing that knows it, and translating them away would leave an app saying
|
|
20
20
|
* nothing where it could have said the one useful thing. A gateway that is not
|
|
21
21
|
* there, or one that refused the account, is the estate talking to itself; that
|
|
22
22
|
* half is replaced.
|
package/dist/failure.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
// What to tell a reader when
|
|
2
|
+
// What to tell a reader when an app's store does not answer.
|
|
3
3
|
//
|
|
4
|
-
// The
|
|
4
|
+
// The apps used to print the error they caught, which on a store that is down
|
|
5
5
|
// reads "mount /v1/s3: no instance running". That says nothing a reader can act
|
|
6
6
|
// on — it names a mount and an instance, neither of which is theirs — and it
|
|
7
7
|
// puts the shape of the estate on a public page. The detail is still in the
|
|
8
8
|
// network tab, where the person who can act on it is looking.
|
|
9
9
|
//
|
|
10
|
-
// ONE FUNCTION, because every
|
|
10
|
+
// ONE FUNCTION, because every app owes the same three answers and three copies
|
|
11
11
|
// would drift into three vocabularies for one event.
|
|
12
12
|
import { refusalOf } from '@hanzo/ui/product/limits';
|
|
13
13
|
import { told } from './lib/reach.js';
|
|
@@ -20,7 +20,7 @@ import { english } from '@hanzo/i18n';
|
|
|
20
20
|
* 0.6.16 added a table answering 503 with "The service is not running right
|
|
21
21
|
* now.", which reads the same to a person and matches none of the patterns
|
|
22
22
|
* below, so every downed store fell through to the flat "Could not read" and
|
|
23
|
-
* the
|
|
23
|
+
* the apps stopped saying that nothing had been lost. Reading the status first
|
|
24
24
|
* is what makes this survive the next rewording.
|
|
25
25
|
*/
|
|
26
26
|
const status = (e) => {
|
|
@@ -50,7 +50,7 @@ export const refused = (error) => {
|
|
|
50
50
|
/**
|
|
51
51
|
* A sentence about `subject` — "your drive", "this board" — naming what a
|
|
52
52
|
* reader can do next. Never the caught text: an error written for an operator
|
|
53
|
-
* is not an answer for a reader.
|
|
53
|
+
* is not an answer for a reader. An app passes its `t`, and the subject through
|
|
54
54
|
* it (`say(e, t('this board'), 'read', t)`), so the whole sentence is the reader's.
|
|
55
55
|
*/
|
|
56
56
|
export function say(error, subject, act = 'read', t = english) {
|
|
@@ -73,7 +73,7 @@ export function say(error, subject, act = 'read', t = english) {
|
|
|
73
73
|
*
|
|
74
74
|
* A gateway that refuses over credit, a context that ran long, a model nobody
|
|
75
75
|
* serves — each of those is the reader's own situation, stated by the only
|
|
76
|
-
* thing that knows it, and translating them away would leave
|
|
76
|
+
* thing that knows it, and translating them away would leave an app saying
|
|
77
77
|
* nothing where it could have said the one useful thing. A gateway that is not
|
|
78
78
|
* there, or one that refused the account, is the estate talking to itself; that
|
|
79
79
|
* half is replaced.
|
package/dist/ground.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* first paper rung's lit edge and drop — the second's 15px drop and the floor's
|
|
7
7
|
* strong glass read as a gradient through a translucent pane, so both stay one
|
|
8
8
|
* rung down. The fill is the caller's rung: `--pane-fill`
|
|
9
|
-
* in the app's frame, `sheet(1)`/`sheet(2)` where a pane lies in
|
|
9
|
+
* in the app's frame, `sheet(1)`/`sheet(2)` where a pane lies in the shell.
|
|
10
10
|
*
|
|
11
11
|
* The drop is a prop and not `sheet(2)`'s `elevation-2` class, whose shadow is
|
|
12
12
|
* `!important`: a Dev run's pane steps aside for the two panes inside it by
|
package/dist/ground.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* first paper rung's lit edge and drop — the second's 15px drop and the floor's
|
|
7
7
|
* strong glass read as a gradient through a translucent pane, so both stay one
|
|
8
8
|
* rung down. The fill is the caller's rung: `--pane-fill`
|
|
9
|
-
* in the app's frame, `sheet(1)`/`sheet(2)` where a pane lies in
|
|
9
|
+
* in the app's frame, `sheet(1)`/`sheet(2)` where a pane lies in the shell.
|
|
10
10
|
*
|
|
11
11
|
* The drop is a prop and not `sheet(2)`'s `elevation-2` class, whose shadow is
|
|
12
12
|
* `!important`: a Dev run's pane steps aside for the two panes inside it by
|
package/dist/help.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface Key {
|
|
|
21
21
|
/**
|
|
22
22
|
* Every key the app answers, in the order a reader looks for them. Each is
|
|
23
23
|
* handled where it acts: App.tsx (⌘K, ⌘, and, in a window, Back and Forward),
|
|
24
|
-
*
|
|
24
|
+
* Account.tsx (⌘/), @hanzo/build's panel (⌘.), the composer (Enter, ⌘U), chord.ts
|
|
25
25
|
* (the conversation's chords, spelled by `said` so the two cannot drift).
|
|
26
26
|
*/
|
|
27
27
|
export declare const KEYS: Key[];
|
package/dist/help.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The Help menu's pages and the app's keys, as data: the account menu (
|
|
1
|
+
// The Help menu's pages and the app's keys, as data: the account menu (Account.tsx)
|
|
2
2
|
// draws both, its shortcuts dialog renders KEYS, and a spec reads them as they
|
|
3
3
|
// are. No React, so a spec reads it as it is.
|
|
4
4
|
import { phrase } from '@hanzo/i18n';
|
|
@@ -27,7 +27,7 @@ export const legal = () => [
|
|
|
27
27
|
/**
|
|
28
28
|
* Every key the app answers, in the order a reader looks for them. Each is
|
|
29
29
|
* handled where it acts: App.tsx (⌘K, ⌘, and, in a window, Back and Forward),
|
|
30
|
-
*
|
|
30
|
+
* Account.tsx (⌘/), @hanzo/build's panel (⌘.), the composer (Enter, ⌘U), chord.ts
|
|
31
31
|
* (the conversation's chords, spelled by `said` so the two cannot drift).
|
|
32
32
|
*/
|
|
33
33
|
export const KEYS = [
|
package/dist/hint.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface HintActions {
|
|
|
12
12
|
* if external, opens in a new tab;
|
|
13
13
|
* if another app route, navigates via go;
|
|
14
14
|
* fallback: submits row title as query.
|
|
15
|
-
* - send / task: submits prompt or title directly into the
|
|
15
|
+
* - send / task: submits prompt or title directly into the conversation.
|
|
16
16
|
* - schedule: books automation or falls back to submitting the prompt.
|
|
17
17
|
*/
|
|
18
18
|
export declare function handleHint(a: Act, row: Hint | undefined, actions: HintActions): void;
|
package/dist/hint.js
CHANGED
|
@@ -6,7 +6,7 @@ import { app, go } from './lib/host.js';
|
|
|
6
6
|
* if external, opens in a new tab;
|
|
7
7
|
* if another app route, navigates via go;
|
|
8
8
|
* fallback: submits row title as query.
|
|
9
|
-
* - send / task: submits prompt or title directly into the
|
|
9
|
+
* - send / task: submits prompt or title directly into the conversation.
|
|
10
10
|
* - schedule: books automation or falls back to submitting the prompt.
|
|
11
11
|
*/
|
|
12
12
|
export function handleHint(a, row, actions) {
|
package/dist/host.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What a host tells the
|
|
2
|
+
* What a host tells the apps.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
4
|
+
* The apps name no framework and no site. Everything that differs between the
|
|
5
5
|
* surfaces that mount them arrives here, in two halves, because two kinds of
|
|
6
6
|
* caller read them:
|
|
7
7
|
*
|
|
8
8
|
* configure({ site: 'https://hanzo.ai', home: '/', signUp: '/start' })
|
|
9
9
|
*
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* </
|
|
10
|
+
* <Host router={useRouter()} path={usePathname()} route={route} Link={Link}>
|
|
11
|
+
* <Shell mode="cal"><CalScheduler /></Shell>
|
|
12
|
+
* </Host>
|
|
13
13
|
*
|
|
14
14
|
* The ADDRESSES — where the app's pages live, which gateway and IAM to talk to,
|
|
15
15
|
* the plan catalogue to paint first — do not change while the page is open, and
|
|
16
16
|
* plain modules (`api()`, `iam()`, `site()`, the plan reads) call them outside
|
|
17
|
-
* any component and on pages the
|
|
17
|
+
* any component and on pages the apps never draw. So the host states them once
|
|
18
18
|
* with `configure()`, in a module its root imports, before anything renders.
|
|
19
19
|
*
|
|
20
20
|
* The ROUTER, the path and the route change as the page moves, so they ride
|
|
21
|
-
* React context, and
|
|
21
|
+
* React context, and an app reads them with `useHost()`.
|
|
22
22
|
*/
|
|
23
23
|
import { type AnchorHTMLAttributes, type ComponentType, type ReactNode } from 'react';
|
|
24
24
|
/** A link the host's router owns: next/link under Next, an anchor elsewhere. */
|
|
@@ -34,18 +34,18 @@ export interface Router {
|
|
|
34
34
|
}
|
|
35
35
|
interface Moving {
|
|
36
36
|
router: Router;
|
|
37
|
-
/** The address's path, for the
|
|
37
|
+
/** The address's path, for the apps that read one (Dev's, under `/dev`). */
|
|
38
38
|
path: string | null;
|
|
39
39
|
route: string;
|
|
40
40
|
Link: Link;
|
|
41
41
|
}
|
|
42
|
-
export interface
|
|
43
|
-
/** Absent where no mounted
|
|
42
|
+
export interface HostProps extends Omit<Moving, 'path'> {
|
|
43
|
+
/** Absent where no mounted app reads the path. */
|
|
44
44
|
path?: string | null;
|
|
45
45
|
children?: ReactNode;
|
|
46
46
|
}
|
|
47
|
-
/** The router, the route and the link the host mounted the
|
|
48
|
-
export declare const
|
|
47
|
+
/** The router, the route and the link the host mounted the apps with. */
|
|
48
|
+
export declare const useHost: () => Moving;
|
|
49
49
|
/** The org in scope, by the id the appearance layers are keyed on. */
|
|
50
50
|
export declare function useOrg(): {
|
|
51
51
|
id?: string;
|
|
@@ -54,7 +54,7 @@ export declare function useOrg(): {
|
|
|
54
54
|
/**
|
|
55
55
|
* The person's appearance — theme, type, spacing, corners, accent — resolved
|
|
56
56
|
* for the org in scope and kept with their IAM account, so a choice made here
|
|
57
|
-
* follows them to every Hanzo origin. Every control that changes how the
|
|
57
|
+
* follows them to every Hanzo origin. Every control that changes how the apps
|
|
58
58
|
* look goes through this, and only this.
|
|
59
59
|
*/
|
|
60
60
|
export declare function useLook(): {
|
|
@@ -68,9 +68,9 @@ export declare function useLook(): {
|
|
|
68
68
|
};
|
|
69
69
|
/**
|
|
70
70
|
* The look, applied: mounted once at the host's root, inside its IamProvider,
|
|
71
|
-
* so every page —
|
|
71
|
+
* so every page — an app or not — opens in the person's theme and accent and
|
|
72
72
|
* keeps their choice in step with IAM.
|
|
73
73
|
*/
|
|
74
74
|
export declare function Look(): any;
|
|
75
|
-
export declare function
|
|
75
|
+
export declare function Host({ router, path, route, Link, children }: HostProps): import("react").JSX.Element;
|
|
76
76
|
export {};
|
package/dist/host.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* What a host tells the
|
|
4
|
+
* What a host tells the apps.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
6
|
+
* The apps name no framework and no site. Everything that differs between the
|
|
7
7
|
* surfaces that mount them arrives here, in two halves, because two kinds of
|
|
8
8
|
* caller read them:
|
|
9
9
|
*
|
|
10
10
|
* configure({ site: 'https://hanzo.ai', home: '/', signUp: '/start' })
|
|
11
11
|
*
|
|
12
|
-
* <
|
|
13
|
-
* <
|
|
14
|
-
* </
|
|
12
|
+
* <Host router={useRouter()} path={usePathname()} route={route} Link={Link}>
|
|
13
|
+
* <Shell mode="cal"><CalScheduler /></Shell>
|
|
14
|
+
* </Host>
|
|
15
15
|
*
|
|
16
16
|
* The ADDRESSES — where the app's pages live, which gateway and IAM to talk to,
|
|
17
17
|
* the plan catalogue to paint first — do not change while the page is open, and
|
|
18
18
|
* plain modules (`api()`, `iam()`, `site()`, the plan reads) call them outside
|
|
19
|
-
* any component and on pages the
|
|
19
|
+
* any component and on pages the apps never draw. So the host states them once
|
|
20
20
|
* with `configure()`, in a module its root imports, before anything renders.
|
|
21
21
|
*
|
|
22
22
|
* The ROUTER, the path and the route change as the page moves, so they ride
|
|
23
|
-
* React context, and
|
|
23
|
+
* React context, and an app reads them with `useHost()`.
|
|
24
24
|
*/
|
|
25
25
|
import { createContext, useContext } from 'react';
|
|
26
26
|
import { useIam, useOrganizations } from '@hanzo/iam/react';
|
|
@@ -38,8 +38,8 @@ const Context = createContext({
|
|
|
38
38
|
route: '/',
|
|
39
39
|
Link: Plain,
|
|
40
40
|
});
|
|
41
|
-
/** The router, the route and the link the host mounted the
|
|
42
|
-
export const
|
|
41
|
+
/** The router, the route and the link the host mounted the apps with. */
|
|
42
|
+
export const useHost = () => useContext(Context);
|
|
43
43
|
/** The org in scope, by the id the appearance layers are keyed on. */
|
|
44
44
|
export function useOrg() {
|
|
45
45
|
const { currentOrg } = useOrganizations();
|
|
@@ -49,14 +49,14 @@ export function useOrg() {
|
|
|
49
49
|
/**
|
|
50
50
|
* The person's appearance — theme, type, spacing, corners, accent — resolved
|
|
51
51
|
* for the org in scope and kept with their IAM account, so a choice made here
|
|
52
|
-
* follows them to every Hanzo origin. Every control that changes how the
|
|
52
|
+
* follows them to every Hanzo origin. Every control that changes how the apps
|
|
53
53
|
* look goes through this, and only this.
|
|
54
54
|
*/
|
|
55
55
|
export function useLook() {
|
|
56
56
|
const { accessToken } = useIam();
|
|
57
57
|
const org = useOrg();
|
|
58
58
|
// Signed out there is no person to ask about, so IAM is not asked: a stranger
|
|
59
|
-
// passing through
|
|
59
|
+
// passing through an app on the way to sign in sends nothing to the issuer.
|
|
60
60
|
return useAppearance({
|
|
61
61
|
org: org.id,
|
|
62
62
|
account: accessToken ? { base: api(), token: accessToken } : undefined,
|
|
@@ -64,13 +64,13 @@ export function useLook() {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* The look, applied: mounted once at the host's root, inside its IamProvider,
|
|
67
|
-
* so every page —
|
|
67
|
+
* so every page — an app or not — opens in the person's theme and accent and
|
|
68
68
|
* keeps their choice in step with IAM.
|
|
69
69
|
*/
|
|
70
70
|
export function Look() {
|
|
71
71
|
useLook();
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
export function
|
|
74
|
+
export function Host({ router, path = null, route, Link, children }) {
|
|
75
75
|
return _jsx(Context.Provider, { value: { router, path, route, Link }, children: children });
|
|
76
76
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hanzo/app — Hanzo's app shell and its apps, once, for every Hanzo surface.
|
|
3
3
|
*
|
|
4
|
-
* import { configure,
|
|
5
|
-
* import {
|
|
4
|
+
* import { configure, Host } from '@hanzo/app'
|
|
5
|
+
* import { Shell } from '@hanzo/app/Shell'
|
|
6
6
|
* import { CalScheduler } from '@hanzo/app/CalScheduler'
|
|
7
7
|
*
|
|
8
|
-
* The root names what a host passes; each
|
|
8
|
+
* The root names what a host passes; each app is its own subpath, so a page
|
|
9
9
|
* loads the apps it draws and no others.
|
|
10
10
|
*/
|
|
11
11
|
export { configure, where, site, brand } from './where.js';
|
|
12
12
|
export type { Addresses } from './where.js';
|
|
13
|
-
export {
|
|
14
|
-
export type { Router, Link,
|
|
13
|
+
export { Host, Look, useHost, useLook, useOrg } from './host.js';
|
|
14
|
+
export type { Router, Link, HostProps } from './host.js';
|
|
15
15
|
export * from './lib/local-fs.js';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hanzo/app — Hanzo's app shell and its apps, once, for every Hanzo surface.
|
|
3
3
|
*
|
|
4
|
-
* import { configure,
|
|
5
|
-
* import {
|
|
4
|
+
* import { configure, Host } from '@hanzo/app'
|
|
5
|
+
* import { Shell } from '@hanzo/app/Shell'
|
|
6
6
|
* import { CalScheduler } from '@hanzo/app/CalScheduler'
|
|
7
7
|
*
|
|
8
|
-
* The root names what a host passes; each
|
|
8
|
+
* The root names what a host passes; each app is its own subpath, so a page
|
|
9
9
|
* loads the apps it draws and no others.
|
|
10
10
|
*/
|
|
11
11
|
export { configure, where, site, brand } from './where.js';
|
|
12
|
-
export {
|
|
12
|
+
export { Host, Look, useHost, useLook, useOrg } from './host.js';
|
|
13
13
|
export * from './lib/local-fs.js';
|
|
14
14
|
// Desktop UI loads through @hanzo/app/WindowControls and @hanzo/app/Editor; keep the root usable
|
|
15
15
|
// by Node tools without loading @hanzo/ui and React Native.
|
package/dist/lib/ai.js
CHANGED
|
@@ -77,7 +77,7 @@ export function useAi() {
|
|
|
77
77
|
// The organization every call is scoped to: the SDK's selection, sent only
|
|
78
78
|
// when the token says the reader belongs to it (`org()`), and followed through
|
|
79
79
|
// the one event a change fires — so the client is rebuilt and every hook on
|
|
80
|
-
// it reads the new organization's
|
|
80
|
+
// it reads the new organization's channels, agents and threads.
|
|
81
81
|
const [scoped, setScoped] = useState(() => org());
|
|
82
82
|
useEffect(() => {
|
|
83
83
|
const on = () => setScoped(org());
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* THE LOCAL CASE IS THE WHOLE POINT. api.hanzo.ai admits an origin by allowlist
|
|
11
11
|
* and by an https, portless DNS proof; localhost satisfies neither, so a
|
|
12
|
-
* credentialed read to an ABSOLUTE address fails its preflight and the
|
|
12
|
+
* credentialed read to an ABSOLUTE address fails its preflight and the app
|
|
13
13
|
* draws as though the org owned nothing. `next.config.mjs` proxies `/v1` for
|
|
14
14
|
* exactly this, but a caller with an absolute default never reaches a rewrite.
|
|
15
15
|
* Same-origin on the dev server is what makes the proxy do its job.
|
package/dist/lib/api.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* THE LOCAL CASE IS THE WHOLE POINT. api.hanzo.ai admits an origin by allowlist
|
|
11
11
|
* and by an https, portless DNS proof; localhost satisfies neither, so a
|
|
12
|
-
* credentialed read to an ABSOLUTE address fails its preflight and the
|
|
12
|
+
* credentialed read to an ABSOLUTE address fails its preflight and the app
|
|
13
13
|
* draws as though the org owned nothing. `next.config.mjs` proxies `/v1` for
|
|
14
14
|
* exactly this, but a caller with an absolute default never reaches a rewrite.
|
|
15
15
|
* Same-origin on the dev server is what makes the proxy do its job.
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* who cleared their storage mid-flight). */
|
|
26
26
|
export declare const DEFAULT_DESTINATION = "/";
|
|
27
27
|
/** Where a sign-in with no page to go back to lands on `hostname`: the app on
|
|
28
|
-
* the apex, and the
|
|
28
|
+
* the apex, and the shell's Home everywhere else. */
|
|
29
29
|
export declare function landing(hostname: string): string;
|
|
30
30
|
/** Write down where we are, immediately before leaving for the issuer.
|
|
31
31
|
*
|
|
@@ -48,7 +48,7 @@ export declare function door(): string;
|
|
|
48
48
|
* Send this reader to sign in, and back to this page after.
|
|
49
49
|
*
|
|
50
50
|
* Every signed-out door into the app is this one call: /chat, /dev and every
|
|
51
|
-
* path under them,
|
|
51
|
+
* path under them, an app. The page is written down, and the browser goes to `to`,
|
|
52
52
|
* which asks IAM for an existing session before it draws a form
|
|
53
53
|
* (components/auth/panel.tsx `Gate`). On a `guest` host the same address is asked for on hanzo.ai instead. With no `to`
|
|
54
54
|
* the page is `door()`'s; a control that says "Sign in" names LOGIN.
|
|
@@ -65,7 +65,7 @@ export declare const CAMPAIGN: readonly ["utm_source", "utm_medium", "utm_campai
|
|
|
65
65
|
* The sign-in address for a reader on `here`: `to`, with `here` as its `next=`
|
|
66
66
|
* when that is a page worth coming back to, and the campaign `here` carries as
|
|
67
67
|
* `to`'s own parameters. The page itself is written in the address too, so the
|
|
68
|
-
* place (
|
|
68
|
+
* place (an app, a prompt in `?q=`) survives what sessionStorage does not: a new
|
|
69
69
|
* tab, a pasted link.
|
|
70
70
|
*/
|
|
71
71
|
export declare function entry(to: string, here: string): string;
|