@hanzo/app 0.2.57 → 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 +18 -15
- 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/network.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
// Which
|
|
3
|
+
// Which transport a message arrived on, as a mark.
|
|
4
4
|
//
|
|
5
|
-
// A message carries `
|
|
5
|
+
// A message carries `transport` — the platform measures it — so this is a fact
|
|
6
6
|
// about the message and not decoration. The mark is what makes an inbox of many
|
|
7
7
|
// transports readable: a name tells you after you read it, a mark tells you
|
|
8
|
-
// before. The
|
|
8
|
+
// before. The Directory's grid asks a different question of the same set — which
|
|
9
9
|
// of these have you connected — so it reads this table too. Two tables would
|
|
10
|
-
// drift, and a
|
|
11
|
-
// two
|
|
10
|
+
// drift, and a transport called one thing in the Inbox and another in the grid
|
|
11
|
+
// is two transports to whoever is reading.
|
|
12
12
|
//
|
|
13
13
|
// NOTHING BELOW IS DRAWN BY US, and that is the whole of the design. A mark
|
|
14
14
|
// approximated by hand is a forgery that happens to be bad at it: it is close
|
|
@@ -113,13 +113,13 @@ const SLACK = `<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns
|
|
|
113
113
|
</clipPath>
|
|
114
114
|
</defs>
|
|
115
115
|
</svg>`;
|
|
116
|
-
/** The ground for a
|
|
116
|
+
/** The ground for a transport nobody has told us the colour of. */
|
|
117
117
|
const NEUTRAL = 'var(--neutral-600)';
|
|
118
118
|
/**
|
|
119
|
-
* The
|
|
119
|
+
* The transports, keyed by what the platform puts in `transport`.
|
|
120
120
|
*
|
|
121
121
|
* Lowercase because that is how it arrives. A key nobody has taught this table
|
|
122
|
-
* still renders — `of()` falls back to the
|
|
122
|
+
* still renders — `of()` falls back to the transport's own name and a neutral
|
|
123
123
|
* ground — so a fifth transport appearing on the server needs no release here.
|
|
124
124
|
*/
|
|
125
125
|
const NETWORK = {
|
|
@@ -154,11 +154,11 @@ const NETWORK = {
|
|
|
154
154
|
yahoo: { name: 'Yahoo' },
|
|
155
155
|
linkedin: { name: 'LinkedIn' },
|
|
156
156
|
};
|
|
157
|
-
/** What we know about a
|
|
158
|
-
* a name and nothing else, and lands on the same initial Yahoo does. */
|
|
159
|
-
export function of(
|
|
160
|
-
const key = (
|
|
161
|
-
return NETWORK[key] ?? { name:
|
|
157
|
+
/** What we know about a transport key, including one nobody taught us — which
|
|
158
|
+
* is a name and nothing else, and lands on the same initial Yahoo does. */
|
|
159
|
+
export function of(transport) {
|
|
160
|
+
const key = (transport || '').trim().toLowerCase();
|
|
161
|
+
return NETWORK[key] ?? { name: transport || 'Network' };
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* WHAT TO CALL THE SPEAKER.
|
|
@@ -166,7 +166,7 @@ export function of(channel) {
|
|
|
166
166
|
* NOTHING THAT ARRIVES HERE CARRIES A NAME. `sender` is the network's own id
|
|
167
167
|
* for the person — "U031THJJ7F1" on Slack, a snowflake on Discord, a GUID on
|
|
168
168
|
* Teams — because that is what every adapter puts there; the envelope declares
|
|
169
|
-
* a `Display` beside it (
|
|
169
|
+
* a `Display` beside it (the transport's envelope) and not one of the
|
|
170
170
|
* five adapters fills it, so no name is stored and none is served.
|
|
171
171
|
* `senderUser` is not the name either: it is the linked account's OIDC `sub`,
|
|
172
172
|
* which IAM mints from a UUID, so it identifies a Hanzo account without saying
|
|
@@ -176,32 +176,32 @@ export function of(channel) {
|
|
|
176
176
|
* "U031THJJ7F1" for what somebody calls themselves. So the id is MARKED as an
|
|
177
177
|
* id — '@' is how every one of these networks writes a handle it has not
|
|
178
178
|
* resolved — and it is kept, because it is the only thing that tells two
|
|
179
|
-
* speakers apart. A
|
|
180
|
-
*
|
|
179
|
+
* speakers apart. A channel holds messages from many people (useInbox groups by
|
|
180
|
+
* transport and channel, never by sender), so dropping it renders every line of a
|
|
181
181
|
* group identically and a reader cannot tell who said what. Only where no id
|
|
182
182
|
* arrived at all is the network the one thing left to say. The day the
|
|
183
183
|
* platform resolves a name, this is where it goes.
|
|
184
184
|
*/
|
|
185
|
-
export const speaker = (
|
|
186
|
-
/** A
|
|
187
|
-
* handle for a DM, the network's
|
|
188
|
-
* where no id arrived. */
|
|
189
|
-
export function
|
|
190
|
-
if (
|
|
191
|
-
return speaker(
|
|
192
|
-
return
|
|
185
|
+
export const speaker = (transport, sender) => sender ? `@${sender}` : `Someone on ${of(transport).name}`;
|
|
186
|
+
/** A channel is named by its own address, not by whoever spoke in it last: the
|
|
187
|
+
* handle for a DM, the network's channel id otherwise, and the transport it is
|
|
188
|
+
* on where no id arrived. */
|
|
189
|
+
export function channelName(channel) {
|
|
190
|
+
if (channel.channelKind === 'dm')
|
|
191
|
+
return speaker(channel.transport, channel.last.sender);
|
|
192
|
+
return channel.channelId ? `#${channel.channelId}` : `A channel on ${of(channel.transport).name}`;
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
|
-
* One
|
|
195
|
+
* One transport's mark, at whatever size the caller has space for.
|
|
196
196
|
*
|
|
197
197
|
* A rounded square rather than a disc, because in the Inbox the face beside it
|
|
198
198
|
* IS a disc and two circles the same size read as two people rather than as a
|
|
199
|
-
* person and where they wrote from. The
|
|
199
|
+
* person and where they wrote from. The Directory's grid draws the same mark at
|
|
200
200
|
* 46px, which is the size the vendor files were cut for and still the size the
|
|
201
201
|
* simple-icons silhouettes were meant to scale to.
|
|
202
202
|
*/
|
|
203
|
-
export function Network({
|
|
204
|
-
const net = of(
|
|
203
|
+
export function Network({ transport, size = 16 }) {
|
|
204
|
+
const net = of(transport);
|
|
205
205
|
// A capability wears no ground and no colour. It is not a product, and a tile
|
|
206
206
|
// in a brand colour is the one thing that would say it was.
|
|
207
207
|
if (net.glyph) {
|
package/dist/open.d.ts
CHANGED
|
@@ -12,22 +12,24 @@ export interface Open {
|
|
|
12
12
|
session: string | null;
|
|
13
13
|
openSession: (id: string | null) => void;
|
|
14
14
|
/**
|
|
15
|
-
* The open
|
|
15
|
+
* The open channel's key — `net:<key>` for one that arrived over a transport
|
|
16
|
+
* (conversations.ts `netKey`), `team:<space>/<id>` for a team channel
|
|
17
|
+
* (channels.ts `teamKey`) — or null for none.
|
|
16
18
|
*
|
|
17
|
-
* A third field for the same reason there is a second: a
|
|
18
|
-
* Slack or iMessage
|
|
19
|
-
* and cannot share the field with one. `useInbox` derives
|
|
20
|
-
* it holds, so
|
|
19
|
+
* A third field for the same reason there is a second: a channel that arrives
|
|
20
|
+
* over Slack or iMessage is keyed by its transport, so it is not a thread id
|
|
21
|
+
* and cannot share the field with one. `useInbox` derives those channels from
|
|
22
|
+
* the page it holds, so such a key is only meaningful against that page.
|
|
21
23
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
channel: string | null;
|
|
25
|
+
openChannel: (key: string | null) => void;
|
|
24
26
|
/** The open drive bucket, or null for the list of them. */
|
|
25
27
|
bucket: string | null;
|
|
26
28
|
openBucket: (name: string | null) => void;
|
|
27
29
|
/** The Settings pane a surface has asked for, or null. */
|
|
28
30
|
settings: string | null;
|
|
29
31
|
showSettings: (pane: string | null) => void;
|
|
30
|
-
/** What is open beside the
|
|
32
|
+
/** What is open beside the pane, by name, or null for nothing. */
|
|
31
33
|
aside: string | null;
|
|
32
34
|
showAside: (pane: string | null) => void;
|
|
33
35
|
/** Who the chat is with, in the order they were pressed; empty for the plain model. */
|
|
@@ -36,46 +38,46 @@ export interface Open {
|
|
|
36
38
|
agent: string | null;
|
|
37
39
|
/** Adds a character to the open conversation, or lets one out who is already in it; null empties it. */
|
|
38
40
|
openAgent: (name: string | null) => void;
|
|
39
|
-
/** The
|
|
41
|
+
/** The cast a stored conversation names, set as it is read back; the conversation stays open. */
|
|
40
42
|
seat: (names: string[]) => void;
|
|
41
|
-
/** The
|
|
43
|
+
/** The cast outright: a roster row opens a chat with that one character. */
|
|
42
44
|
withAgents: (names: string[]) => void;
|
|
43
45
|
/**
|
|
44
|
-
* How many times the
|
|
46
|
+
* How many times the conversation has been emptied.
|
|
45
47
|
*
|
|
46
48
|
* A COUNTER AND NOT A FLAG, because the fact is an EVENT and the state it
|
|
47
|
-
* asks for is one the
|
|
48
|
-
* and on a
|
|
49
|
+
* asks for is one the conversation may already be in. "New chat" nulls the thread,
|
|
50
|
+
* and on a pane whose thread is already null that is not a change — so the
|
|
49
51
|
* pane's effect never re-ran and the button did nothing at all. A number that
|
|
50
52
|
* only ever goes up is the smallest thing two components can agree happened.
|
|
51
53
|
*/
|
|
52
54
|
emptied: number;
|
|
53
55
|
empty: () => void;
|
|
54
56
|
}
|
|
55
|
-
/** Opens a thread, or empties the
|
|
57
|
+
/** Opens a thread, or empties the pane with null. */
|
|
56
58
|
export declare function openThread(id: string | null): void;
|
|
57
59
|
/** Opens a run, or empties the pane with null. */
|
|
58
60
|
export declare function openSession(id: string | null): void;
|
|
59
|
-
/** Opens
|
|
60
|
-
export declare function
|
|
61
|
+
/** Opens a channel, or empties the pane with null. */
|
|
62
|
+
export declare function openChannel(key: string | null): void;
|
|
61
63
|
/** Opens a bucket, or returns to the list of them with null. */
|
|
62
64
|
export declare function openBucket(name: string | null): void;
|
|
63
65
|
/**
|
|
64
66
|
* Adds a character to the open conversation, or lets one out who is already in
|
|
65
|
-
* it; null empties the
|
|
66
|
-
* turn changes for the turns that follow, and Chat records the new
|
|
67
|
+
* it; null empties the cast. The conversation stays open: its system
|
|
68
|
+
* turn changes for the turns that follow, and Chat records the new cast with
|
|
67
69
|
* the thread (`roster` in cast.tsx).
|
|
68
70
|
*/
|
|
69
71
|
export declare function openAgent(name: string | null): void;
|
|
70
|
-
/** The
|
|
72
|
+
/** The cast a stored conversation names, as it is read back. The thread stays open. */
|
|
71
73
|
export declare function seat(names: string[]): void;
|
|
72
|
-
/** The
|
|
74
|
+
/** The cast outright — a roster row opens a chat with that one character. */
|
|
73
75
|
export declare function withAgents(names: string[]): void;
|
|
74
|
-
/** Opens one
|
|
76
|
+
/** Opens one view beside the pane, or shuts the column with null. */
|
|
75
77
|
export declare function showAside(pane: string | null): void;
|
|
76
78
|
/** Asks the shell to open Settings on one pane, or closes it with null. */
|
|
77
79
|
export declare function showSettings(pane: string | null): void;
|
|
78
|
-
/** Empties the
|
|
80
|
+
/** Empties the conversation: no thread, nobody seated, and a fresh count so the pane
|
|
79
81
|
* hears it even when there was nothing to leave. "New chat" is this. */
|
|
80
82
|
export declare function empty(): void;
|
|
81
83
|
export declare function useOpen(): Open;
|
package/dist/open.js
CHANGED
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
// which run.
|
|
4
4
|
//
|
|
5
5
|
// THIS LIVES OUTSIDE REACT, and that is the whole point. The selection used to
|
|
6
|
-
// be `useState` inside `
|
|
7
|
-
// between two
|
|
8
|
-
// reader arrived in an empty
|
|
6
|
+
// be `useState` inside `Shell`, which the router MOUNTS — so `router.push`
|
|
7
|
+
// between two apps unmounted the component holding the selection and the
|
|
8
|
+
// reader arrived in an empty pane. "One level up, where both can reach it" was
|
|
9
9
|
// right about the rail and the pane and one level too low for the router: a
|
|
10
10
|
// value that must outlive a route change cannot be stored inside a component
|
|
11
11
|
// the route change destroys.
|
|
12
12
|
//
|
|
13
13
|
// A module is above every component, so the router cannot reach it. It resets
|
|
14
|
-
// on a real page load, which is correct — a fresh document is a fresh
|
|
14
|
+
// on a real page load, which is correct — a fresh document is a fresh selection.
|
|
15
15
|
import { useSyncExternalStore } from 'react';
|
|
16
16
|
/** The prerender's selection, and the initial one. A stable reference: React
|
|
17
17
|
* compares snapshots by identity, so returning a fresh object every read is an
|
|
18
|
-
* infinite render rather than an empty
|
|
18
|
+
* infinite render rather than an empty pane. */
|
|
19
19
|
const EMPTY = {
|
|
20
20
|
thread: null,
|
|
21
21
|
session: null,
|
|
22
|
-
|
|
22
|
+
channel: null,
|
|
23
23
|
bucket: null,
|
|
24
24
|
emptied: 0,
|
|
25
25
|
settings: null,
|
|
@@ -58,7 +58,7 @@ const readOnServer = () => EMPTY;
|
|
|
58
58
|
function set(next) {
|
|
59
59
|
if (next.thread === selection.thread &&
|
|
60
60
|
next.session === selection.session &&
|
|
61
|
-
next.
|
|
61
|
+
next.channel === selection.channel &&
|
|
62
62
|
next.bucket === selection.bucket &&
|
|
63
63
|
next.emptied === selection.emptied &&
|
|
64
64
|
next.settings === selection.settings &&
|
|
@@ -70,7 +70,7 @@ function set(next) {
|
|
|
70
70
|
for (const listener of listeners)
|
|
71
71
|
listener();
|
|
72
72
|
}
|
|
73
|
-
/** Opens a thread, or empties the
|
|
73
|
+
/** Opens a thread, or empties the pane with null. */
|
|
74
74
|
export function openThread(id) {
|
|
75
75
|
set({ ...selection, thread: id });
|
|
76
76
|
}
|
|
@@ -78,9 +78,9 @@ export function openThread(id) {
|
|
|
78
78
|
export function openSession(id) {
|
|
79
79
|
set({ ...selection, session: id });
|
|
80
80
|
}
|
|
81
|
-
/** Opens
|
|
82
|
-
export function
|
|
83
|
-
set({ ...selection,
|
|
81
|
+
/** Opens a channel, or empties the pane with null. */
|
|
82
|
+
export function openChannel(key) {
|
|
83
|
+
set({ ...selection, channel: key });
|
|
84
84
|
}
|
|
85
85
|
/** Opens a bucket, or returns to the list of them with null. */
|
|
86
86
|
export function openBucket(name) {
|
|
@@ -88,8 +88,8 @@ export function openBucket(name) {
|
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Adds a character to the open conversation, or lets one out who is already in
|
|
91
|
-
* it; null empties the
|
|
92
|
-
* turn changes for the turns that follow, and Chat records the new
|
|
91
|
+
* it; null empties the cast. The conversation stays open: its system
|
|
92
|
+
* turn changes for the turns that follow, and Chat records the new cast with
|
|
93
93
|
* the thread (`roster` in cast.tsx).
|
|
94
94
|
*/
|
|
95
95
|
export function openAgent(name) {
|
|
@@ -100,17 +100,17 @@ export function openAgent(name) {
|
|
|
100
100
|
: [...selection.agents, name];
|
|
101
101
|
set({ ...selection, agents });
|
|
102
102
|
}
|
|
103
|
-
/** The
|
|
103
|
+
/** The cast a stored conversation names, as it is read back. The thread stays open. */
|
|
104
104
|
export function seat(names) {
|
|
105
105
|
set({ ...selection, agents: names.filter((one, i) => names.findIndex((other) => same(other, one)) === i) });
|
|
106
106
|
}
|
|
107
107
|
/** Two handles name one character when they differ only in case ("Des" and "des"). */
|
|
108
108
|
const same = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
109
|
-
/** The
|
|
109
|
+
/** The cast outright — a roster row opens a chat with that one character. */
|
|
110
110
|
export function withAgents(names) {
|
|
111
111
|
set({ ...selection, agents: [...new Set(names)], thread: null, emptied: selection.emptied + 1 });
|
|
112
112
|
}
|
|
113
|
-
/** Opens one
|
|
113
|
+
/** Opens one view beside the pane, or shuts the column with null. */
|
|
114
114
|
export function showAside(pane) {
|
|
115
115
|
set({ ...selection, aside: pane });
|
|
116
116
|
}
|
|
@@ -118,7 +118,7 @@ export function showAside(pane) {
|
|
|
118
118
|
export function showSettings(pane) {
|
|
119
119
|
set({ ...selection, settings: pane });
|
|
120
120
|
}
|
|
121
|
-
/** Empties the
|
|
121
|
+
/** Empties the conversation: no thread, nobody seated, and a fresh count so the pane
|
|
122
122
|
* hears it even when there was nothing to leave. "New chat" is this. */
|
|
123
123
|
export function empty() {
|
|
124
124
|
set({ ...selection, thread: null, agents: [], emptied: selection.emptied + 1 });
|
|
@@ -130,8 +130,8 @@ export function useOpen() {
|
|
|
130
130
|
open: openThread,
|
|
131
131
|
session: current.session,
|
|
132
132
|
openSession,
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
channel: current.channel,
|
|
134
|
+
openChannel,
|
|
135
135
|
bucket: current.bucket,
|
|
136
136
|
openBucket,
|
|
137
137
|
settings: current.settings,
|
package/dist/pane.d.ts
CHANGED
|
@@ -38,13 +38,13 @@ export interface Pane {
|
|
|
38
38
|
* The conversation a pane belongs to.
|
|
39
39
|
*
|
|
40
40
|
* THREE FIELDS AND NOT ONE, because `open.ts` already refuses to conflate them:
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* a channel is keyed by where it lives, a thread is a conversation the org has
|
|
42
|
+
* recorded, and an agent is who you are talking to before a thread exists.
|
|
43
|
+
* Prefixed so a channel called `x` and a thread called `x` cannot land on one
|
|
44
|
+
* entry. `new` is a conversation nobody has spoken in yet.
|
|
45
45
|
*/
|
|
46
|
-
export declare function
|
|
47
|
-
|
|
46
|
+
export declare function conversation(open: {
|
|
47
|
+
channel: string | null;
|
|
48
48
|
thread: string | null;
|
|
49
49
|
agent: string | null;
|
|
50
50
|
}): string;
|
package/dist/pane.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// What a conversation is holding for its next message, PER CONVERSATION: the
|
|
3
3
|
// files on their way to the workspace and why any were refused. The panel's
|
|
4
4
|
// tabs are @hanzo/build's (`useDeck`), kept per conversation under the same key
|
|
5
|
-
// (`
|
|
5
|
+
// (`conversation`).
|
|
6
6
|
//
|
|
7
7
|
// The store lives outside React for the reason `open.ts` gives: the router
|
|
8
|
-
// mounts the
|
|
8
|
+
// mounts the apps, so anything kept inside one is destroyed by a route change.
|
|
9
9
|
// It is NOT written down: a file picked off the reader's own disk is an object
|
|
10
10
|
// URL, which the browser revokes with the document that minted it, so a kept
|
|
11
11
|
// row would come back as a name pointing at nothing.
|
|
12
12
|
//
|
|
13
|
-
// ONE WAY IN FOR A FILE. The composer's paperclip, a drop on the
|
|
13
|
+
// ONE WAY IN FOR A FILE. The composer's paperclip, a drop on the pane, a paste
|
|
14
14
|
// into the field and the Sources tab's `+` all call `hold`, so a file goes up by
|
|
15
15
|
// one road (`lib/files`: straight to the org's workspace, in parts when it is
|
|
16
16
|
// large), shows as a chip over the field and a row under Sources at once, and
|
|
@@ -25,14 +25,14 @@ const BARE = { held: [], refused: null };
|
|
|
25
25
|
* The conversation a pane belongs to.
|
|
26
26
|
*
|
|
27
27
|
* THREE FIELDS AND NOT ONE, because `open.ts` already refuses to conflate them:
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* a channel is keyed by where it lives, a thread is a conversation the org has
|
|
29
|
+
* recorded, and an agent is who you are talking to before a thread exists.
|
|
30
|
+
* Prefixed so a channel called `x` and a thread called `x` cannot land on one
|
|
31
|
+
* entry. `new` is a conversation nobody has spoken in yet.
|
|
32
32
|
*/
|
|
33
|
-
export function
|
|
34
|
-
if (open.
|
|
35
|
-
return `
|
|
33
|
+
export function conversation(open) {
|
|
34
|
+
if (open.channel)
|
|
35
|
+
return `channel:${open.channel}`;
|
|
36
36
|
if (open.thread)
|
|
37
37
|
return `thread:${open.thread}`;
|
|
38
38
|
if (open.agent)
|
package/dist/roster.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** One member of the org: a person, or an agent standing in the
|
|
1
|
+
/** One member of the org: a person, or an agent standing in the channels. */
|
|
2
2
|
export interface Member {
|
|
3
3
|
/** The account a message names as its author. */
|
|
4
4
|
id: string;
|
|
@@ -22,7 +22,7 @@ export declare function useRoster(): {
|
|
|
22
22
|
export declare const memberOf: (members: Member[] | null, id: string) => Member | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* The reader's own account, from the userinfo the session holds. OIDC names it
|
|
25
|
-
* `sub`, and team's account id is that same uuid — so it is the id a
|
|
25
|
+
* `sub`, and team's account id is that same uuid — so it is the id a channel's
|
|
26
26
|
* members list and a message's author carry for this reader.
|
|
27
27
|
*/
|
|
28
28
|
export declare function useMe(): string | null;
|
package/dist/roster.js
CHANGED
|
@@ -60,7 +60,7 @@ export function useRoster() {
|
|
|
60
60
|
export const memberOf = (members, id) => members?.find((one) => one.id === id);
|
|
61
61
|
/**
|
|
62
62
|
* The reader's own account, from the userinfo the session holds. OIDC names it
|
|
63
|
-
* `sub`, and team's account id is that same uuid — so it is the id a
|
|
63
|
+
* `sub`, and team's account id is that same uuid — so it is the id a channel's
|
|
64
64
|
* members list and a message's author carry for this reader.
|
|
65
65
|
*/
|
|
66
66
|
export function useMe() {
|
package/dist/seek.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The palette's decisions (
|
|
1
|
+
// The palette's decisions (Search.tsx draws them): which rows a query keeps,
|
|
2
2
|
// in what order, under which heading, and which key press opens it. No React,
|
|
3
3
|
// so a spec reads them as they are.
|
|
4
4
|
import { phrase } from '@hanzo/i18n';
|
package/dist/slide.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The pane left in sight at the end edge while the menu is open, px: a thumb's 44 and
|
|
1
|
+
/** The pane left in sight at the end edge while the menu is open, px: a thumb's 44 and space around it. */
|
|
2
2
|
export declare const STRIP = 64;
|
|
3
3
|
/** The menu's widest, px: a phone held sideways, or a small tablet, keeps the menu a menu. */
|
|
4
4
|
export declare const REACH = 360;
|
package/dist/slide.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// A drag is measured ALONG the line: positive toward the end, whichever way the
|
|
11
11
|
// line runs, so the same numbers close an LTR drawer pulled left and an RTL one
|
|
12
12
|
// pulled right.
|
|
13
|
-
/** The pane left in sight at the end edge while the menu is open, px: a thumb's 44 and
|
|
13
|
+
/** The pane left in sight at the end edge while the menu is open, px: a thumb's 44 and space around it. */
|
|
14
14
|
export const STRIP = 64;
|
|
15
15
|
/** The menu's widest, px: a phone held sideways, or a small tablet, keeps the menu a menu. */
|
|
16
16
|
export const REACH = 360;
|
package/dist/span.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// `move` writes the property on the element and nothing else; `keep` is where
|
|
11
11
|
// React and storage learn the width, once per drag, key or double-click.
|
|
12
12
|
//
|
|
13
|
-
// Storage is read in a layout effect, not during render: the
|
|
13
|
+
// Storage is read in a layout effect, not during render: the apps are
|
|
14
14
|
// prerendered, and a render that reads storage draws different HTML on the
|
|
15
15
|
// server and the client. A layout effect runs before the browser paints, so a
|
|
16
16
|
// kept width is on screen from the first frame and the column never jumps.
|
package/dist/stars.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** How a
|
|
2
|
-
* One formula, because the header and the sidebar star the same
|
|
1
|
+
/** How a channel is written wherever a person reads it — a sigil and the name.
|
|
2
|
+
* One formula, because the header and the sidebar star the same channel and a
|
|
3
3
|
* second spelling of its title would star two different things. */
|
|
4
4
|
export declare const titleOf: (name: string, direct?: boolean) => string;
|
|
5
5
|
/**
|
|
6
|
-
* The starred
|
|
6
|
+
* The starred channels, and the toggle that sets them.
|
|
7
7
|
*
|
|
8
8
|
* Read in an effect rather than in the initialiser, because storage is a fact
|
|
9
9
|
* only the browser holds and reading it during the render that hydrates is how
|
|
@@ -16,7 +16,7 @@ export declare const titleOf: (name: string, direct?: boolean) => string;
|
|
|
16
16
|
export declare function useStarred(kind?: string): [Set<string>, (id: string) => void];
|
|
17
17
|
/**
|
|
18
18
|
* The conversations starred in this browser before a pin was the server's
|
|
19
|
-
* (
|
|
19
|
+
* (0.1.36 of this package stopped reading the set), made pins once. Each is asked
|
|
20
20
|
* for as a pin through `pin`; once the store has taken any of them the stars
|
|
21
21
|
* are forgotten, and a store that takes none — one without the route yet —
|
|
22
22
|
* leaves them for a later visit. Answers whether they were carried.
|
package/dist/stars.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
// The
|
|
2
|
+
// The channels this reader has starred.
|
|
3
3
|
//
|
|
4
4
|
// It lived inside the channel header, so the star it drew was the only thing in
|
|
5
5
|
// the app that knew about it: you starred a channel and nothing anywhere changed
|
|
@@ -12,16 +12,14 @@
|
|
|
12
12
|
// one would make one person's shortlist everybody's.
|
|
13
13
|
import { useCallback, useEffect, useState } from 'react';
|
|
14
14
|
/**
|
|
15
|
-
* One store, two shortlists. A
|
|
15
|
+
* One store, two shortlists. A channel and a project are both things a reader
|
|
16
16
|
* pins, and they are pinned the same way — but they are not the same list, so
|
|
17
17
|
* the kind names the key rather than the two sets sharing one and colliding on
|
|
18
|
-
* an id that happens to match a
|
|
19
|
-
*
|
|
20
|
-
* `rooms` keeps the key it already had, so nobody's stars move.
|
|
18
|
+
* an id that happens to match a channel's title.
|
|
21
19
|
*/
|
|
22
20
|
const keyOf = (kind) => `hanzo.starred-${kind}`;
|
|
23
|
-
/** How a
|
|
24
|
-
* One formula, because the header and the sidebar star the same
|
|
21
|
+
/** How a channel is written wherever a person reads it — a sigil and the name.
|
|
22
|
+
* One formula, because the header and the sidebar star the same channel and a
|
|
25
23
|
* second spelling of its title would star two different things. */
|
|
26
24
|
export const titleOf = (name, direct) => `${direct ? '@' : '#'} ${name}`;
|
|
27
25
|
const read = (kind) => {
|
|
@@ -33,7 +31,7 @@ const read = (kind) => {
|
|
|
33
31
|
}
|
|
34
32
|
};
|
|
35
33
|
/**
|
|
36
|
-
* The starred
|
|
34
|
+
* The starred channels, and the toggle that sets them.
|
|
37
35
|
*
|
|
38
36
|
* Read in an effect rather than in the initialiser, because storage is a fact
|
|
39
37
|
* only the browser holds and reading it during the render that hydrates is how
|
|
@@ -43,7 +41,7 @@ const read = (kind) => {
|
|
|
43
41
|
* the sidebar in the same tick: two components, one set, no prop threaded
|
|
44
42
|
* between them through the four components that separate them.
|
|
45
43
|
*/
|
|
46
|
-
export function useStarred(kind = '
|
|
44
|
+
export function useStarred(kind = 'channels') {
|
|
47
45
|
const [starred, setStarred] = useState(new Set());
|
|
48
46
|
useEffect(() => {
|
|
49
47
|
setStarred(read(kind));
|
|
@@ -75,7 +73,7 @@ export function useStarred(kind = 'rooms') {
|
|
|
75
73
|
}
|
|
76
74
|
/**
|
|
77
75
|
* The conversations starred in this browser before a pin was the server's
|
|
78
|
-
* (
|
|
76
|
+
* (0.1.36 of this package stopped reading the set), made pins once. Each is asked
|
|
79
77
|
* for as a pin through `pin`; once the store has taken any of them the stars
|
|
80
78
|
* are forgotten, and a store that takes none — one without the route yet —
|
|
81
79
|
* leaves them for a later visit. Answers whether they were carried.
|
package/dist/tabs.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface Tab<Id extends string = string> {
|
|
|
10
10
|
/**
|
|
11
11
|
* A row of tabs and the one you are on.
|
|
12
12
|
*
|
|
13
|
-
* `onPick` is OPTIONAL because a strip can have a single destination — a
|
|
13
|
+
* `onPick` is OPTIONAL because a strip can have a single destination — a channel
|
|
14
14
|
* whose only tab is its conversation — and a tab with nowhere else to go is not
|
|
15
15
|
* a control. Drawn as a button it would take a focus stop to say the thing the
|
|
16
16
|
* label already says. So without a handler these are labels, and the moment
|
package/dist/tabs.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Box, Text, XStack } from '@hanzo/ui';
|
|
|
4
4
|
/**
|
|
5
5
|
* A row of tabs and the one you are on.
|
|
6
6
|
*
|
|
7
|
-
* `onPick` is OPTIONAL because a strip can have a single destination — a
|
|
7
|
+
* `onPick` is OPTIONAL because a strip can have a single destination — a channel
|
|
8
8
|
* whose only tab is its conversation — and a tab with nowhere else to go is not
|
|
9
9
|
* a control. Drawn as a button it would take a focus stop to say the thing the
|
|
10
10
|
* label already says. So without a handler these are labels, and the moment
|
package/dist/team.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Each member's file is who they are and what the model is told, word for word:
|
|
4
4
|
// the front matter names them (`Dev`) and gives their part (`Engineer`), and the
|
|
5
5
|
// body is the system prompt. The files are read from the pinned package at
|
|
6
|
-
// build (scripts/team.mjs), so the
|
|
6
|
+
// build (scripts/team.mjs), so the apps keep no copy of a persona: moving the
|
|
7
7
|
// pin is how a persona changes.
|
|
8
8
|
//
|
|
9
9
|
// Every member the package publishes, in the order the crew is drawn in
|
package/dist/thread.d.ts
CHANGED
|
@@ -22,15 +22,15 @@ export declare function useThreadActions(): {
|
|
|
22
22
|
rename: (t: Thread, title: string) => Promise<boolean>;
|
|
23
23
|
remove: (t: Thread) => Promise<boolean>;
|
|
24
24
|
};
|
|
25
|
-
/** A conversation's own address, whole: the app at `/?chat=<id>` (lib/host `talk`), wherever the
|
|
25
|
+
/** A conversation's own address, whole: the app at `/?chat=<id>` (lib/host `talk`), wherever the apps are drawn. */
|
|
26
26
|
export declare const href: (id: string) => string;
|
|
27
27
|
/**
|
|
28
28
|
* A list of conversations with their menu: a right-click on a row or a
|
|
29
29
|
* long-press opens it at the point, a row's ⋯ hangs it from itself. Its one
|
|
30
30
|
* child holds the rows (`ThreadRow`). `threads` are the list's conversations by
|
|
31
31
|
* id, `active` the one the pane holds (what the keys act on with no menu open),
|
|
32
|
-
* and `onGone` runs after that one is deleted — the
|
|
33
|
-
* defaulting to emptying the
|
|
32
|
+
* and `onGone` runs after that one is deleted — the pane moves to a new chat —
|
|
33
|
+
* defaulting to emptying the pane. `onSchedule`, where the list's host can say
|
|
34
34
|
* what the conversation asks, adds Schedule…: the conversation's question as a
|
|
35
35
|
* task that runs itself.
|
|
36
36
|
*/
|
package/dist/thread.js
CHANGED
|
@@ -135,7 +135,7 @@ export function useThreadActions() {
|
|
|
135
135
|
}
|
|
136
136
|
/** A conversation's title as drawn; `untitled` is the reader's word for none. */
|
|
137
137
|
const titleOf = (t, untitled) => tidy(t.title, 80, untitled);
|
|
138
|
-
/** A conversation's own address, whole: the app at `/?chat=<id>` (lib/host `talk`), wherever the
|
|
138
|
+
/** A conversation's own address, whole: the app at `/?chat=<id>` (lib/host `talk`), wherever the apps are drawn. */
|
|
139
139
|
export const href = (id) => new URL(site(talk(id)), window.location.href).href;
|
|
140
140
|
/** Opens a conversation in a tab of its own. */
|
|
141
141
|
const away = (id) => {
|
|
@@ -192,15 +192,15 @@ const own = (row) => row?.querySelector('[data-slot="sidebar-item"], [role="butt
|
|
|
192
192
|
* long-press opens it at the point, a row's ⋯ hangs it from itself. Its one
|
|
193
193
|
* child holds the rows (`ThreadRow`). `threads` are the list's conversations by
|
|
194
194
|
* id, `active` the one the pane holds (what the keys act on with no menu open),
|
|
195
|
-
* and `onGone` runs after that one is deleted — the
|
|
196
|
-
* defaulting to emptying the
|
|
195
|
+
* and `onGone` runs after that one is deleted — the pane moves to a new chat —
|
|
196
|
+
* defaulting to emptying the pane. `onSchedule`, where the list's host can say
|
|
197
197
|
* what the conversation asks, adds Schedule…: the conversation's question as a
|
|
198
198
|
* task that runs itself.
|
|
199
199
|
*/
|
|
200
200
|
export function ConversationMenu({ threads, active = null, onGone = empty, onSchedule, children, }) {
|
|
201
201
|
const { t } = useI18n();
|
|
202
202
|
const act = useThreadActions();
|
|
203
|
-
// The conversation the pane holds NOW: a delete answered after the reader moved on leaves the
|
|
203
|
+
// The conversation the pane holds NOW: a delete answered after the reader moved on leaves the conversation they moved to.
|
|
204
204
|
const holds = useRef(active);
|
|
205
205
|
holds.current = active;
|
|
206
206
|
// The list's own element, for the row after one deleted.
|
package/dist/ui.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* component that reaches it registers every 'use client' module behind it as a
|
|
6
6
|
* client entry of the route — 81 KB on a model page. Through this module the
|
|
7
7
|
* server sees one client reference, and the client keeps only what is named.
|
|
8
|
-
*
|
|
8
|
+
* Apps are client components and import `@hanzo/ui` directly.
|
|
9
9
|
*/
|
|
10
10
|
export { Text, View } from '@hanzo/ui';
|
package/dist/ui.js
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* component that reaches it registers every 'use client' module behind it as a
|
|
7
7
|
* client entry of the route — 81 KB on a model page. Through this module the
|
|
8
8
|
* server sees one client reference, and the client keeps only what is named.
|
|
9
|
-
*
|
|
9
|
+
* Apps are client components and import `@hanzo/ui` directly.
|
|
10
10
|
*/
|
|
11
11
|
export { Text, View } from '@hanzo/ui';
|