@hanzo/app 0.2.56 → 0.2.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +4 -1
- package/dist/Board.js +121 -37
- package/dist/Boxes.js +16 -12
- package/dist/CalScheduler.js +81 -40
- package/dist/Chat.js +1 -2
- package/dist/Contents.d.ts +1 -1
- package/dist/Contents.js +1 -2
- package/dist/Drive.js +121 -100
- package/dist/Inbox.js +7 -7
- package/dist/Market.js +15 -10
- package/dist/Meet.js +78 -48
- package/dist/Orgs.js +9 -10
- package/dist/Palette.d.ts +1 -1
- package/dist/Palette.js +1 -2
- package/dist/Schedule.js +15 -11
- package/dist/Settings.d.ts +1 -1
- package/dist/SettingsPane.js +2 -2
- package/dist/Shared.js +16 -11
- package/dist/Talk.js +4 -4
- package/dist/Terminals.js +3 -1
- package/dist/Usage.js +3 -3
- package/dist/WindowControls.js +5 -3
- package/dist/Work.js +51 -28
- package/dist/bots/Bots.js +129 -73
- package/dist/bots/runtime.js +103 -41
- package/dist/cast.d.ts +1 -1
- package/dist/cast.js +1 -1
- package/dist/failure.d.ts +1 -1
- package/dist/failure.js +1 -1
- package/dist/lib/limits.d.ts +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/org.d.ts +3 -3
- package/dist/lib/org.js +4 -5
- package/dist/lib/orgname.d.ts +1 -1
- package/dist/lib/orgname.js +1 -1
- package/dist/lib/pay.d.ts +6 -2
- package/dist/lib/pay.js +15 -2
- package/dist/lib/plans.d.ts +1 -1
- package/dist/lib/plans.js +1 -1
- package/dist/lib/tier.d.ts +2 -2
- package/dist/lib/tier.js +6 -6
- package/dist/look.js +10 -8
- package/dist/recent.d.ts +1 -1
- package/dist/recent.js +1 -2
- package/dist/thread.js +1 -1
- package/package.json +3 -3
- package/dist/say.d.ts +0 -4
- package/dist/say.js +0 -7
package/dist/bots/runtime.js
CHANGED
|
@@ -26,13 +26,46 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
26
26
|
import { Play, Square, X } from 'lucide-react';
|
|
27
27
|
import { useOrganizations } from '@hanzo/iam/react';
|
|
28
28
|
import { useAi } from '../lib/ai.js';
|
|
29
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
29
30
|
import { say } from '../failure.js';
|
|
30
31
|
import { Input, Text, XStack, YStack } from '@hanzo/gui';
|
|
31
32
|
import { Picker } from '@hanzo/ui';
|
|
32
33
|
import { DIM, FAINT, GROUND, INK, LINE } from './ink.js';
|
|
33
34
|
import { BOXED, LABEL, OUT, PICK, TAB } from './kit.js';
|
|
34
|
-
import { answer, answering, call, connectors as readConnectors, disk, grant, projects as readProjects, secrets as readSecrets, tools as readTools, vault, workOn, } from './api.js';
|
|
35
|
+
import { ALWAYS, ONCE, answer, answering, call, connectors as readConnectors, disk, grant, projects as readProjects, secrets as readSecrets, tools as readTools, vault, workOn, } from './api.js';
|
|
36
|
+
/** The platform's word for how a bot runs, as a person reads it. An unknown mode stays a token. */
|
|
37
|
+
function modeName(mode, t) {
|
|
38
|
+
if (mode === ALWAYS)
|
|
39
|
+
return t('long-running');
|
|
40
|
+
if (!mode || mode === ONCE)
|
|
41
|
+
return t('one-shot');
|
|
42
|
+
return mode;
|
|
43
|
+
}
|
|
44
|
+
/** A computer's status, in the reader's words. An unrecognized status stays a token. */
|
|
45
|
+
function boxStatus(status, t) {
|
|
46
|
+
switch (status) {
|
|
47
|
+
case 'running':
|
|
48
|
+
return t('running');
|
|
49
|
+
case 'pending':
|
|
50
|
+
return t('pending');
|
|
51
|
+
case 'error':
|
|
52
|
+
return t('error');
|
|
53
|
+
case 'unknown':
|
|
54
|
+
return t('unknown');
|
|
55
|
+
default:
|
|
56
|
+
return status;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Where a tool was published, and whether the org has turned it on. */
|
|
60
|
+
function toolFrom(from, ready, t) {
|
|
61
|
+
if (from === 'MCP')
|
|
62
|
+
return t(ready ? 'MCP' : 'MCP · not activated');
|
|
63
|
+
if (from === 'skill')
|
|
64
|
+
return t(ready ? 'skill' : 'skill · not activated');
|
|
65
|
+
return t(ready ? 'platform' : 'platform · not activated');
|
|
66
|
+
}
|
|
35
67
|
export function Runtime({ bot }) {
|
|
68
|
+
const { t, locale } = useI18n();
|
|
36
69
|
const { client } = useAi();
|
|
37
70
|
const { currentOrg } = useOrganizations();
|
|
38
71
|
const org = currentOrg?.displayName || currentOrg?.name || '';
|
|
@@ -49,36 +82,46 @@ export function Runtime({ bot }) {
|
|
|
49
82
|
const [repos, setRepos] = useState([]);
|
|
50
83
|
const [why, setWhy] = useState({});
|
|
51
84
|
const blame = useCallback((k, e, subject) => {
|
|
52
|
-
setWhy((w) => ({ ...w, [k]: say(e, subject) }));
|
|
53
|
-
}, []);
|
|
85
|
+
setWhy((w) => ({ ...w, [k]: say(e, subject, 'read', t) }));
|
|
86
|
+
}, [t]);
|
|
54
87
|
const survey = useCallback(async () => {
|
|
55
88
|
if (!client)
|
|
56
89
|
return;
|
|
57
90
|
await Promise.all([
|
|
58
|
-
client.machines.list().then(setMachines).catch((e) => blame('machine', e, 'this org’s machines')),
|
|
59
|
-
client.sandboxes.list({ project }).then(setBoxes).catch((e) => blame('box', e, 'this bot’s computer')),
|
|
60
|
-
client.tools.mcp().then(setServers).catch((e) => blame('mcp', e, 'this org’s MCP servers')),
|
|
61
|
-
client.tools.skills().then((s) => setSkills(s.tools ?? [])).catch((e) => blame('skill', e, 'this org’s skills')),
|
|
91
|
+
client.machines.list().then(setMachines).catch((e) => blame('machine', e, t('this org’s machines'))),
|
|
92
|
+
client.sandboxes.list({ project }).then(setBoxes).catch((e) => blame('box', e, t('this bot’s computer'))),
|
|
93
|
+
client.tools.mcp().then(setServers).catch((e) => blame('mcp', e, t('this org’s MCP servers'))),
|
|
94
|
+
client.tools.skills().then((s) => setSkills(s.tools ?? [])).catch((e) => blame('skill', e, t('this org’s skills'))),
|
|
62
95
|
client.tools.activation().then((a) => setActivated(a.enabled ?? [])).catch(() => setActivated([])),
|
|
63
|
-
readTools(client).then(setPublished).catch((e) => blame('served', e, 'the platform’s tools')),
|
|
64
|
-
readConnectors(client).then(setLinks).catch((e) => blame('link', e, 'your connectors')),
|
|
65
|
-
client.channels.list().then(setRooms).catch((e) => blame('room', e, 'this org’s channels')),
|
|
66
|
-
readSecrets(client, vault(bot.name)).then(setKeys).catch((e) => blame('key', e, 'this bot’s secrets')),
|
|
67
|
-
readProjects(client).then(setRepos).catch((e) => blame('repo', e, 'this org’s repos')),
|
|
96
|
+
readTools(client).then(setPublished).catch((e) => blame('served', e, t('the platform’s tools'))),
|
|
97
|
+
readConnectors(client).then(setLinks).catch((e) => blame('link', e, t('your connectors'))),
|
|
98
|
+
client.channels.list().then(setRooms).catch((e) => blame('room', e, t('this org’s channels'))),
|
|
99
|
+
readSecrets(client, vault(bot.name)).then(setKeys).catch((e) => blame('key', e, t('this bot’s secrets'))),
|
|
100
|
+
readProjects(client).then(setRepos).catch((e) => blame('repo', e, t('this org’s repos'))),
|
|
68
101
|
]);
|
|
69
|
-
}, [client, project, bot.name, blame]);
|
|
102
|
+
}, [client, project, bot.name, blame, t]);
|
|
70
103
|
useEffect(() => {
|
|
71
104
|
void survey();
|
|
72
105
|
}, [survey]);
|
|
73
|
-
return (_jsxs(YStack, { render: "aside", "aria-label":
|
|
106
|
+
return (_jsxs(YStack, { render: "aside", "aria-label": t('{name} runtime', { name: bot.name }), "data-hz": "runtime-pane", width: 360, shrink: 0, overflowY: "auto", borderLeftWidth: 1, borderColor: LINE, bg: GROUND, children: [_jsxs(Part, { title: t('Runtime'), children: [_jsx(Line, { children: t(bot.serviceAccountId
|
|
107
|
+
? '{name} runs for {org} as {id}. Nothing on this panel crosses into another org.'
|
|
108
|
+
: '{name} runs for {org}. Nothing on this panel crosses into another org.', {
|
|
109
|
+
name: bot.name,
|
|
110
|
+
org: _jsx(Text, { color: INK, children: org || t('your org') }),
|
|
111
|
+
id: bot.serviceAccountId ?? '',
|
|
112
|
+
}) }), bot.schedule ? (_jsx(Line, { children: t(bot.executionMode ? 'Wakes on {schedule} ({mode}).' : 'Wakes on {schedule}.', {
|
|
113
|
+
schedule: _jsx(Text, { color: INK, children: bot.schedule }),
|
|
114
|
+
mode: modeName(bot.executionMode, t),
|
|
115
|
+
}) })) : null] }), _jsx(Machine, { bot: bot, machines: machines, why: why.machine }), _jsx(Computer, { bot: bot, box: boxes[0] ?? null, project: project, why: why.box, onChange: survey }), _jsx(Tools, { bot: bot, servers: servers, skills: skills, published: published, activated: activated, why: why.served ?? why.mcp ?? why.skill }), _jsx(Channels, { bot: bot, rooms: rooms, why: why.room }), _jsx(Code, { bot: bot, repos: repos, why: why.repo }), _jsx(Secrets, { bot: bot, keys: keys, why: why.key }), _jsx(Held, { links: links, why: why.link })] }));
|
|
74
116
|
}
|
|
75
117
|
/** The machine this Bot runs on. The list is the org's; the binding is the Bot's. */
|
|
76
118
|
function Machine({ bot, machines, why }) {
|
|
119
|
+
const { t, locale } = useI18n();
|
|
77
120
|
const { client } = useAi();
|
|
78
121
|
const [bound, setBound] = useState(bot.computeRef ?? '');
|
|
79
122
|
const [failed, setFailed] = useState(null);
|
|
80
123
|
useEffect(() => setBound(bot.computeRef ?? ''), [bot.computeRef]);
|
|
81
|
-
return (_jsxs(Part, { title:
|
|
124
|
+
return (_jsxs(Part, { title: t('Machine'), children: [why ? _jsx(Line, { children: why }) : null, !why && machines.length === 0 ? (_jsx(Line, { children: t('No machine is registered to this org, so this bot runs wherever the platform places it.') })) : null, machines.length > 0 ? (_jsxs(Picker, { ...PICK, value: bound, "aria-label": t('Machine'), onChange: async (e) => {
|
|
82
125
|
const id = e.target.value;
|
|
83
126
|
setBound(id);
|
|
84
127
|
if (!client)
|
|
@@ -88,9 +131,14 @@ function Machine({ bot, machines, why }) {
|
|
|
88
131
|
setFailed(null);
|
|
89
132
|
}
|
|
90
133
|
catch (err) {
|
|
91
|
-
setFailed(say(err, 'this bot', 'save'));
|
|
134
|
+
setFailed(say(err, t('this bot'), 'save', t));
|
|
92
135
|
}
|
|
93
|
-
}, children: [_jsx("option", { value: "", children:
|
|
136
|
+
}, children: [_jsx("option", { value: "", children: t('Unbound') }), machines.map((m) => (_jsx("option", { value: m.id, children: m.status
|
|
137
|
+
? t('{name} — {status}', {
|
|
138
|
+
name: m.label || m.host || m.id,
|
|
139
|
+
status: m.status === 'online' ? t('online') : m.status,
|
|
140
|
+
})
|
|
141
|
+
: m.label || m.host || m.id }, m.id)))] })) : null, failed ? _jsx(Line, { children: failed }) : null] }));
|
|
94
142
|
}
|
|
95
143
|
/**
|
|
96
144
|
* This Bot's computer.
|
|
@@ -107,6 +155,7 @@ function Machine({ bot, machines, why }) {
|
|
|
107
155
|
* what this section can honestly show until the pool comes back.
|
|
108
156
|
*/
|
|
109
157
|
function Computer({ bot, box, project, why, onChange, }) {
|
|
158
|
+
const { t, locale } = useI18n();
|
|
110
159
|
const { client } = useAi();
|
|
111
160
|
const [busy, setBusy] = useState(false);
|
|
112
161
|
const [failed, setFailed] = useState(null);
|
|
@@ -124,38 +173,44 @@ function Computer({ bot, box, project, why, onChange, }) {
|
|
|
124
173
|
catch (e) {
|
|
125
174
|
// The fleet's own words. A sandbox that will not start is the reader's
|
|
126
175
|
// situation and only the fleet knows why, so it is not translated away.
|
|
127
|
-
|
|
176
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
177
|
+
setFailed(t('{what}: {message}', { what, message }));
|
|
128
178
|
}
|
|
129
179
|
finally {
|
|
130
180
|
setBusy(false);
|
|
131
181
|
}
|
|
132
|
-
}, [client, busy]);
|
|
133
|
-
const open = (kind) => attempt(
|
|
182
|
+
}, [client, busy, t]);
|
|
183
|
+
const open = (kind) => attempt(t(kind === 'terminal' ? 'Could not open the terminal' : 'Could not open the screen'), async () => {
|
|
134
184
|
if (!client || !box)
|
|
135
185
|
return;
|
|
136
186
|
const g = await grant(client, box.id, kind);
|
|
137
187
|
if (!g.url)
|
|
138
|
-
throw new Error('the platform minted no address');
|
|
188
|
+
throw new Error(t('the platform minted no address'));
|
|
139
189
|
setWindow({ kind, url: g.url });
|
|
140
190
|
});
|
|
141
|
-
return (_jsxs(Part, { title:
|
|
191
|
+
return (_jsxs(Part, { title: t('Computer'), children: [_jsx(Line, { children: t('Its own disk, {project}. A lease on this project finds the same disk every time, so what this bot writes outlives the lease.', {
|
|
192
|
+
project: _jsx(Text, { render: "code", fontSize: "$1", color: INK, children: project }),
|
|
193
|
+
}) }), why ? _jsx(Line, { children: why }) : null, box ? (_jsxs(_Fragment, { children: [_jsxs(Row, { children: [_jsx(Text, { fontSize: "$2", color: INK, "data-hz": "box", children: t('{class} · {status}', {
|
|
194
|
+
class: box.class ?? t('sandbox'),
|
|
195
|
+
status: box.status ? boxStatus(box.status, t) : t('unknown'),
|
|
196
|
+
}) }), _jsx(Text, { fontSize: "$1", color: FAINT, children: box.id.slice(0, 14) })] }), box.status === 'pending' ? (_jsx(Line, { children: t('Waiting for the fleet to place it. Nothing can be opened on it until it is running.') })) : null, box.status === 'error' ? _jsx(Line, { children: box.error || t('The fleet could not start it.') }) : null, _jsxs(XStack, { gap: 6, flexWrap: "wrap", children: [box.status === 'running' ? (_jsx(Text, { ...TAB, onClick: () => open('terminal'), disabled: busy, children: t('Terminal') })) : null, box.status === 'running' && box.class === 'desktop' ? (_jsx(Text, { ...TAB, onClick: () => open('screen'), disabled: busy, children: t('Screen') })) : null, _jsxs(Text, { ...TAB, disabled: busy, onClick: () => attempt(t('Could not stop it'), async () => {
|
|
142
197
|
await client.sandboxes.stop({ id: box.id });
|
|
143
|
-
}), children: [_jsx(Square, { size: 11, "aria-hidden": true }),
|
|
198
|
+
}), children: [_jsx(Square, { size: 11, "aria-hidden": true }), t('Stop')] }), _jsxs(Text, { ...TAB, disabled: busy, onClick: () => attempt(t('Could not end the lease'), async () => {
|
|
144
199
|
await client.sandboxes.end({ id: box.id });
|
|
145
200
|
setWindow(null);
|
|
146
201
|
await onChange();
|
|
147
|
-
}), children: [_jsx(X, { size: 11, "aria-hidden": true }),
|
|
202
|
+
}), children: [_jsx(X, { size: 11, "aria-hidden": true }), t('End')] })] }), window ? (_jsx(YStack, { render: "iframe", src: window.url, title: t(window.kind === 'terminal' ? '{name} terminal' : '{name} screen', { name: bot.name }), width: "100%", height: 240, borderWidth: 1, borderColor: LINE, rounded: 8, bg: GROUND })) : null, _jsxs(XStack, { render: "form", onSubmit: (e) => {
|
|
148
203
|
e.preventDefault();
|
|
149
|
-
void attempt('Could not run it', async () => {
|
|
204
|
+
void attempt(t('Could not run it'), async () => {
|
|
150
205
|
setRan(await client.sandboxes.run({ id: box.id, command }));
|
|
151
206
|
});
|
|
152
|
-
}, display: box.status === 'running' ? 'flex' : 'none', gap: 6, children: [_jsx(Input, { ...BOXED, flex: 1, minW: 0, value: command, onChange: (e) => setCommand(e.target.value), placeholder:
|
|
207
|
+
}, display: box.status === 'running' ? 'flex' : 'none', gap: 6, children: [_jsx(Input, { ...BOXED, flex: 1, minW: 0, value: command, onChange: (e) => setCommand(e.target.value), placeholder: t('Command'), "aria-label": t("Command to run in this bot's computer") }), _jsxs(Text, { ...TAB, type: 'submit', disabled: busy || !command.trim(), children: [_jsx(Play, { size: 11, "aria-hidden": true }), t('Run')] })] }), ran ? (_jsxs(Text, { ...OUT, children: [(ran.stdout ?? '') + (ran.stderr ?? ''), `\n${t('exit {code}', { code: ran.exitCode ?? 0 })}`] })) : null] })) : (_jsxs(_Fragment, { children: [_jsx(Line, { children: t('No computer is leased. A lease is what a terminal, a screen and a command all hang off, so until one starts there is nothing here to open.') }), _jsxs(XStack, { gap: 6, flexWrap: "wrap", children: [_jsx(Text, { ...TAB, "data-hz": "lease", disabled: busy, onClick: () => attempt(t('Could not lease a computer'), async () => {
|
|
153
208
|
await client.sandboxes.lease({ class: 'dev', project });
|
|
154
209
|
await onChange();
|
|
155
|
-
}), children: busy ? 'Leasing…' : 'Lease a computer' }), _jsx(Text, { ...TAB, "data-hz": "lease-desktop", disabled: busy, onClick: () => attempt('Could not lease a screen', async () => {
|
|
210
|
+
}), children: t(busy ? 'Leasing…' : 'Lease a computer') }), _jsx(Text, { ...TAB, "data-hz": "lease-desktop", disabled: busy, onClick: () => attempt(t('Could not lease a screen'), async () => {
|
|
156
211
|
await client.sandboxes.lease({ class: 'desktop', project });
|
|
157
212
|
await onChange();
|
|
158
|
-
}), children: busy ? 'Leasing…' : 'Lease a screen' })] })] })), failed ? _jsx(Line, { "data-hz": "computer-failed", children: failed }) : null] }));
|
|
213
|
+
}), children: t(busy ? 'Leasing…' : 'Lease a screen') })] })] })), failed ? _jsx(Line, { "data-hz": "computer-failed", children: failed }) : null] }));
|
|
159
214
|
}
|
|
160
215
|
/**
|
|
161
216
|
* What this Bot may call, and calling one.
|
|
@@ -180,6 +235,7 @@ function Computer({ bot, box, project, why, onChange, }) {
|
|
|
180
235
|
* the record.
|
|
181
236
|
*/
|
|
182
237
|
function Tools({ bot, servers, skills, published, activated, why, }) {
|
|
238
|
+
const { t, locale } = useI18n();
|
|
183
239
|
const { client } = useAi();
|
|
184
240
|
const [held, setHeld] = useState(bot.tools ?? []);
|
|
185
241
|
const [failed, setFailed] = useState(null);
|
|
@@ -190,7 +246,7 @@ function Tools({ bot, servers, skills, published, activated, why, }) {
|
|
|
190
246
|
useEffect(() => setHeld(bot.tools ?? []), [bot.tools, bot.name]);
|
|
191
247
|
useEffect(() => setPick((p) => (held.includes(p) ? p : (held[0] ?? ''))), [held]);
|
|
192
248
|
const offered = [
|
|
193
|
-
...published.map((
|
|
249
|
+
...published.map((tool) => ({ name: tool.name, from: 'platform', ready: true })),
|
|
194
250
|
...servers.map((s) => ({ name: s.name || s.id, from: 'MCP', ready: activated.includes(s.name || s.id) })),
|
|
195
251
|
...skills.map((s) => ({ name: s.name, from: 'skill', ready: activated.includes(s.name) })),
|
|
196
252
|
];
|
|
@@ -204,10 +260,10 @@ function Tools({ bot, servers, skills, published, activated, why, }) {
|
|
|
204
260
|
setFailed(null);
|
|
205
261
|
}
|
|
206
262
|
catch (e) {
|
|
207
|
-
setFailed(say(e, 'this bot', 'save'));
|
|
263
|
+
setFailed(say(e, t('this bot'), 'save', t));
|
|
208
264
|
}
|
|
209
265
|
};
|
|
210
|
-
return (_jsxs(Part, { title:
|
|
266
|
+
return (_jsxs(Part, { title: t('Tools'), children: [why ? _jsx(Line, { children: why }) : null, offered.length === 0 && !why ? (_jsx(Line, { children: t('Nothing publishes a tool for this org yet, so there is nothing to grant.') })) : null, _jsx(YStack, { "data-hz": "tools", maxH: 200, overflowY: "auto", gap: 4, children: offered.map((tool) => (_jsxs(XStack, { render: "label", items: "center", justify: "space-between", gap: 8, cursor: "pointer", children: [_jsx("input", { type: "checkbox", checked: held.includes(tool.name), onChange: () => flip(tool.name), "aria-label": tool.name }), _jsx(Text, { flex: 1, fontSize: "$2", color: INK, children: tool.name }), _jsx(Text, { fontSize: "$1", color: FAINT, children: toolFrom(tool.from, tool.ready, t) })] }, `${tool.from}-${tool.name}`))) }), held.length > 0 ? (_jsxs(YStack, { render: "form", onSubmit: async (e) => {
|
|
211
267
|
e.preventDefault();
|
|
212
268
|
if (!client || busy || !pick || !op.trim())
|
|
213
269
|
return;
|
|
@@ -221,7 +277,7 @@ function Tools({ bot, servers, skills, published, activated, why, }) {
|
|
|
221
277
|
finally {
|
|
222
278
|
setBusy(false);
|
|
223
279
|
}
|
|
224
|
-
}, gap: 6, children: [_jsx(Picker, { ...PICK, value: pick, onChange: (e) => setPick(e.target.value), "aria-label":
|
|
280
|
+
}, gap: 6, children: [_jsx(Picker, { ...PICK, value: pick, onChange: (e) => setPick(e.target.value), "aria-label": t('Tool to call'), children: held.map((h) => (_jsx("option", { value: h, children: h }, h))) }), _jsxs(XStack, { gap: 6, children: [_jsx(Input, { ...BOXED, flex: 1, minW: 0, "data-hz": "op", value: op, onChange: (e) => setOp(e.target.value), placeholder: t('Operation'), "aria-label": t('Operation to run') }), _jsx(Text, { ...TAB, type: 'submit', "data-hz": "call", disabled: busy || !op.trim(), children: t(busy ? 'Calling…' : 'Call') })] })] })) : null, ran ? _jsx(Text, { ...OUT, "data-hz": "called", children: ran }) : null, failed ? _jsx(Line, { children: failed }) : null] }));
|
|
225
281
|
}
|
|
226
282
|
/**
|
|
227
283
|
* The rooms this Bot answers.
|
|
@@ -231,6 +287,7 @@ function Tools({ bot, servers, skills, published, activated, why, }) {
|
|
|
231
287
|
* Answer here moves that channel from whichever bot holds it to this one.
|
|
232
288
|
*/
|
|
233
289
|
function Channels({ bot, rooms, why }) {
|
|
290
|
+
const { t, locale } = useI18n();
|
|
234
291
|
const { client } = useAi();
|
|
235
292
|
const [bound, setBound] = useState({});
|
|
236
293
|
const [failed, setFailed] = useState(null);
|
|
@@ -250,9 +307,9 @@ function Channels({ bot, rooms, why }) {
|
|
|
250
307
|
useEffect(() => {
|
|
251
308
|
void read();
|
|
252
309
|
}, [read]);
|
|
253
|
-
return (_jsxs(Part, { title:
|
|
310
|
+
return (_jsxs(Part, { title: t('Channels'), children: [why ? _jsx(Line, { children: why }) : null, rooms.length === 0 && !why ? _jsx(Line, { children: t('This org has no channels.') }) : null, rooms.map((r) => {
|
|
254
311
|
const mine = bound[r.id] === bot.name;
|
|
255
|
-
return (_jsxs(Row, { children: [_jsx(Text, { fontSize: "$2", color: INK, children: r.id }), _jsxs(XStack, { items: "center", gap: 8, children: [_jsx(Text, { fontSize: "$1", color: FAINT, children: r.connected ? bound[r.id] || 'unbound' : 'not connected' }), _jsx(Text, { ...TAB, opacity: mine ? 0.5 : 1, disabled: mine, onClick: async () => {
|
|
312
|
+
return (_jsxs(Row, { children: [_jsx(Text, { fontSize: "$2", color: INK, children: r.id }), _jsxs(XStack, { items: "center", gap: 8, children: [_jsx(Text, { fontSize: "$1", color: FAINT, children: r.connected ? bound[r.id] || t('unbound') : t('not connected') }), _jsx(Text, { ...TAB, opacity: mine ? 0.5 : 1, disabled: mine, onClick: async () => {
|
|
256
313
|
if (!client)
|
|
257
314
|
return;
|
|
258
315
|
try {
|
|
@@ -261,9 +318,9 @@ function Channels({ bot, rooms, why }) {
|
|
|
261
318
|
await read();
|
|
262
319
|
}
|
|
263
320
|
catch (e) {
|
|
264
|
-
setFailed(say(e, 'this channel', 'save'));
|
|
321
|
+
setFailed(say(e, t('this channel'), 'save', t));
|
|
265
322
|
}
|
|
266
|
-
}, children: mine ? 'Answers' : 'Answer' })] })] }, r.id));
|
|
323
|
+
}, children: t(mine ? 'Answers' : 'Answer') })] })] }, r.id));
|
|
267
324
|
}), failed ? _jsx(Line, { children: failed }) : null] }));
|
|
268
325
|
}
|
|
269
326
|
/**
|
|
@@ -275,6 +332,7 @@ function Channels({ bot, rooms, why }) {
|
|
|
275
332
|
* set is refused by the platform naming it, and the refusal is what is shown.
|
|
276
333
|
*/
|
|
277
334
|
function Code({ bot, repos, why }) {
|
|
335
|
+
const { t, locale } = useI18n();
|
|
278
336
|
const { client } = useAi();
|
|
279
337
|
const withRepo = repos.filter((p) => p.repo?.url);
|
|
280
338
|
const [repo, setRepo] = useState('');
|
|
@@ -285,7 +343,7 @@ function Code({ bot, repos, why }) {
|
|
|
285
343
|
if (!repo && withRepo[0])
|
|
286
344
|
setRepo(withRepo[0].slug);
|
|
287
345
|
}, [repo, withRepo]);
|
|
288
|
-
return (_jsxs(Part, { title:
|
|
346
|
+
return (_jsxs(Part, { title: t('Code'), children: [why ? _jsx(Line, { children: why }) : null, withRepo.length === 0 && !why ? (_jsx(Line, { children: t('No project in this org names a repo, so there is nothing for this bot to work on.') })) : (_jsxs(YStack, { render: "form", onSubmit: async (e) => {
|
|
289
347
|
e.preventDefault();
|
|
290
348
|
if (!client || busy || !repo || !task.trim())
|
|
291
349
|
return;
|
|
@@ -293,7 +351,7 @@ function Code({ bot, repos, why }) {
|
|
|
293
351
|
setSaid(null);
|
|
294
352
|
try {
|
|
295
353
|
const started = await workOn(client, { repo, prompt: task.trim(), agentRef: bot.name, project: repo });
|
|
296
|
-
setSaid(
|
|
354
|
+
setSaid(t('Started {run} on {repo}.', { run: started.sessionId || started.id || t('a run'), repo }));
|
|
297
355
|
setTask('');
|
|
298
356
|
}
|
|
299
357
|
catch (err) {
|
|
@@ -302,11 +360,14 @@ function Code({ bot, repos, why }) {
|
|
|
302
360
|
finally {
|
|
303
361
|
setBusy(false);
|
|
304
362
|
}
|
|
305
|
-
}, gap: 6, children: [_jsx(Picker, { ...PICK, value: repo, onChange: (e) => setRepo(e.target.value), "aria-label":
|
|
363
|
+
}, gap: 6, children: [_jsx(Picker, { ...PICK, value: repo, onChange: (e) => setRepo(e.target.value), "aria-label": t('Repo'), children: withRepo.map((p) => (_jsx("option", { value: p.slug, children: p.slug }, p.id))) }), _jsx(Input, { ...BOXED, "data-hz": "task", value: task, onChange: (e) => setTask(e.target.value), placeholder: t('What to change'), "aria-label": t('What to change') }), _jsx(Text, { ...TAB, type: 'submit', "data-hz": "code", self: "flex-start", disabled: busy || !task.trim(), children: t(busy ? 'Starting…' : 'Work on it') })] })), said ? _jsx(Line, { children: said }) : null] }));
|
|
306
364
|
}
|
|
307
365
|
/** The names under this Bot's KMS prefix. The values stay in KMS. */
|
|
308
366
|
function Secrets({ bot, keys, why }) {
|
|
309
|
-
|
|
367
|
+
const { t, locale } = useI18n();
|
|
368
|
+
return (_jsxs(Part, { title: t('Secrets'), children: [_jsx(Line, { children: t('Held under {path} in KMS. Names are readable here; values are not, by KMS and not by this screen.', {
|
|
369
|
+
path: _jsx(Text, { render: "code", fontSize: "$1", color: INK, children: vault(bot.name) }),
|
|
370
|
+
}) }), why ? _jsx(Line, { children: why }) : null, keys.length === 0 && !why ? _jsx(Line, { children: t('None yet.') }) : null, keys.map((k) => (_jsxs(Row, { children: [_jsx(Text, { fontSize: "$2", color: INK, children: k.name }), _jsx(Text, { fontSize: "$1", color: FAINT, children: k.env })] }, `${k.path}/${k.name}`)))] }));
|
|
310
371
|
}
|
|
311
372
|
/**
|
|
312
373
|
* The one thing that is NOT this Bot's.
|
|
@@ -317,7 +378,8 @@ function Secrets({ bot, keys, why }) {
|
|
|
317
378
|
* there is no switch to press.
|
|
318
379
|
*/
|
|
319
380
|
function Held({ links, why }) {
|
|
320
|
-
|
|
381
|
+
const { t, locale } = useI18n();
|
|
382
|
+
return (_jsxs(Part, { title: t('Your connectors'), children: [_jsx(Line, { children: t('Signed in by you, reachable by every bot in this org. The platform publishes no per-bot binding for a connector, so nothing here is scoped down to this one.') }), why ? _jsx(Line, { children: why }) : null, links.length === 0 && !why ? _jsx(Line, { children: t('None connected.') }) : null, links.map((l) => (_jsxs(Row, { children: [_jsx(Text, { fontSize: "$1", color: DIM, children: l.label || l.provider }), _jsx(Text, { fontSize: "$1", color: FAINT, children: l.account })] }, l.id)))] }));
|
|
321
383
|
}
|
|
322
384
|
function Part({ title, children }) {
|
|
323
385
|
return (_jsxs(YStack, { render: "section", px: 16, py: 14, borderBottomWidth: 1, borderColor: LINE, gap: 8, children: [_jsx(Text, { ...LABEL, children: title }), children] }));
|
package/dist/cast.d.ts
CHANGED
package/dist/cast.js
CHANGED
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
// a person is never cast and shows their own picture or initials.
|
|
15
15
|
import { useEffect, useState } from 'react';
|
|
16
16
|
import { Text, Tooltip, TooltipContent, TooltipTrigger, View, XStack } from '@hanzo/ui';
|
|
17
|
-
import { english } from '
|
|
17
|
+
import { english } from '@hanzo/i18n';
|
|
18
18
|
import { member } from './team.js';
|
|
19
19
|
/** The named crew, keyed by the persona's @-handle. */
|
|
20
20
|
export const CAST = {
|
package/dist/failure.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Refusal } from '@hanzo/ui/product/limits';
|
|
2
|
-
import { type Say } from '
|
|
2
|
+
import { type Say } from '@hanzo/i18n';
|
|
3
3
|
/** Whether the store answered and the answer was no — exported so a surface can
|
|
4
4
|
* offer the way past a refusal rather than only describing it. */
|
|
5
5
|
export declare const refused: (error: unknown) => boolean;
|
package/dist/failure.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
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';
|
|
14
|
-
import { english } from '
|
|
14
|
+
import { english } from '@hanzo/i18n';
|
|
15
15
|
/**
|
|
16
16
|
* THE STATUS, WHERE THE FAILURE CARRIES ONE.
|
|
17
17
|
*
|
package/dist/lib/limits.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UseLimits } from '@hanzo/ui/product/useLimits';
|
|
2
2
|
import { paidPlan, type LimitAction, type LimitNotice } from '@hanzo/ui/product/limits';
|
|
3
|
-
import { type Say } from '
|
|
3
|
+
import { type Say } from '@hanzo/i18n';
|
|
4
4
|
/** Reads the limits as whoever holds the bearer, in this browser's organization. */
|
|
5
5
|
export declare function readLimits(signal: AbortSignal): Promise<unknown>;
|
|
6
6
|
/**
|
package/dist/lib/limits.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { label, said, spent, ways, when } from '@hanzo/build/plan';
|
|
11
11
|
import { useLimits as useHeld } from '@hanzo/ui/product/useLimits';
|
|
12
12
|
import { paidPlan } from '@hanzo/ui/product/limits';
|
|
13
|
-
import { english } from '
|
|
13
|
+
import { english } from '@hanzo/i18n';
|
|
14
14
|
import { api } from './api.js';
|
|
15
15
|
import { scope } from './session.js';
|
|
16
16
|
/** Reads the limits as whoever holds the bearer, in this browser's organization. */
|
package/dist/lib/org.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* do what: every request carries the reader's bearer and organization (`scope`),
|
|
16
16
|
* the server answers, and a refusal comes back as the server's own sentence.
|
|
17
17
|
*/
|
|
18
|
-
import { type Say } from '
|
|
18
|
+
import { type Say } from '@hanzo/i18n';
|
|
19
19
|
/**
|
|
20
20
|
* A refusal, with the status it came under and the server's words. One this
|
|
21
21
|
* module words itself keeps its English source and arguments (`source`,
|
|
@@ -124,5 +124,5 @@ export interface Invoice {
|
|
|
124
124
|
paidAt?: string;
|
|
125
125
|
}
|
|
126
126
|
export declare function invoices(): Promise<Invoice[]>;
|
|
127
|
-
/** Whole cents as money
|
|
128
|
-
export declare function cents(n: number, currency?: string): string;
|
|
127
|
+
/** Whole cents as money. English is `$1,234.56`; another locale follows its own currency format. */
|
|
128
|
+
export declare function cents(n: number, currency?: string, locale?: string): string;
|
package/dist/lib/org.js
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* do what: every request carries the reader's bearer and organization (`scope`),
|
|
16
16
|
* the server answers, and a refusal comes back as the server's own sentence.
|
|
17
17
|
*/
|
|
18
|
-
import { phrase } from '@hanzo/i18n';
|
|
19
|
-
import { english } from '../say.js';
|
|
18
|
+
import { phrase, english } from '@hanzo/i18n';
|
|
20
19
|
import { scope } from './session.js';
|
|
21
20
|
import { api } from './api.js';
|
|
22
21
|
import { list } from './list.js';
|
|
@@ -154,7 +153,7 @@ export async function methods() {
|
|
|
154
153
|
export async function invoices() {
|
|
155
154
|
return list((await ask('/v1/billing/invoices')).invoices);
|
|
156
155
|
}
|
|
157
|
-
/** Whole cents as money
|
|
158
|
-
export function cents(n, currency = 'usd') {
|
|
159
|
-
return new Intl.NumberFormat(
|
|
156
|
+
/** Whole cents as money. English is `$1,234.56`; another locale follows its own currency format. */
|
|
157
|
+
export function cents(n, currency = 'usd', locale = 'en-US') {
|
|
158
|
+
return new Intl.NumberFormat(locale, { style: 'currency', currency: currency.toUpperCase() }).format(n / 100);
|
|
160
159
|
}
|
package/dist/lib/orgname.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* IAM's own onboarding does it (internal/oidc/onboard.go `slugifyOrg`), so the
|
|
9
9
|
* slug shown is the slug IAM makes of the same name.
|
|
10
10
|
*/
|
|
11
|
-
import { type Say } from '
|
|
11
|
+
import { type Say } from '@hanzo/i18n';
|
|
12
12
|
/** The longest organization name IAM takes. */
|
|
13
13
|
export declare const LONGEST = 55;
|
|
14
14
|
/**
|
package/dist/lib/orgname.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* IAM's own onboarding does it (internal/oidc/onboard.go `slugifyOrg`), so the
|
|
9
9
|
* slug shown is the slug IAM makes of the same name.
|
|
10
10
|
*/
|
|
11
|
-
import { english } from '
|
|
11
|
+
import { english } from '@hanzo/i18n';
|
|
12
12
|
/** The longest organization name IAM takes. */
|
|
13
13
|
export const LONGEST = 55;
|
|
14
14
|
/**
|
package/dist/lib/pay.d.ts
CHANGED
|
@@ -49,5 +49,9 @@ export declare function payPage(path?: string): string;
|
|
|
49
49
|
/** The pay address with its query, written in one place for both callers above. */
|
|
50
50
|
export declare function payUrl(path: string, query: Record<string, string | null | undefined>): string;
|
|
51
51
|
export declare const dollars: (n: number) => string;
|
|
52
|
-
/**
|
|
53
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Money as a sentence says it. English stays `$20` or `$16.67`. Any other
|
|
54
|
+
* locale uses that locale's currency format for USD, so grouping and the
|
|
55
|
+
* currency mark follow the language the reader chose.
|
|
56
|
+
*/
|
|
57
|
+
export declare const money: (n: number, locale?: string) => string;
|
package/dist/lib/pay.js
CHANGED
|
@@ -67,5 +67,18 @@ export function payUrl(path, query) {
|
|
|
67
67
|
return `${at}${path}${s ? `?${s}` : ""}`;
|
|
68
68
|
}
|
|
69
69
|
export const dollars = (n) => `$${n.toFixed(2)}`;
|
|
70
|
-
/**
|
|
71
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Money as a sentence says it. English stays `$20` or `$16.67`. Any other
|
|
72
|
+
* locale uses that locale's currency format for USD, so grouping and the
|
|
73
|
+
* currency mark follow the language the reader chose.
|
|
74
|
+
*/
|
|
75
|
+
export const money = (n, locale = "en-US") => {
|
|
76
|
+
if (locale === "en-US")
|
|
77
|
+
return Number.isInteger(n) ? `$${n.toLocaleString("en-US")}` : dollars(n);
|
|
78
|
+
return new Intl.NumberFormat(locale, {
|
|
79
|
+
style: "currency",
|
|
80
|
+
currency: "USD",
|
|
81
|
+
minimumFractionDigits: Number.isInteger(n) ? 0 : 2,
|
|
82
|
+
maximumFractionDigits: Number.isInteger(n) ? 0 : 2,
|
|
83
|
+
}).format(n);
|
|
84
|
+
};
|
package/dist/lib/plans.d.ts
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* read. No price in this repo is typed, and no plan's name: a slug is named by
|
|
30
30
|
* @hanzo/build's `label` (`max-20x` reads Max, with 20x beside it).
|
|
31
31
|
*/
|
|
32
|
-
import { type Say } from "
|
|
32
|
+
import { type Say } from "@hanzo/i18n";
|
|
33
33
|
/** A row exactly as GET /v1/billing/plans returns it. */
|
|
34
34
|
export interface BillingPlan {
|
|
35
35
|
slug: string;
|
package/dist/lib/plans.js
CHANGED
|
@@ -33,7 +33,7 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
33
33
|
import { where } from "../where.js";
|
|
34
34
|
import { api } from "./api.js";
|
|
35
35
|
import { billing, checkoutUrl, dollars, money, payUrl } from "./pay.js";
|
|
36
|
-
import { english } from "
|
|
36
|
+
import { english } from "@hanzo/i18n";
|
|
37
37
|
/**
|
|
38
38
|
* The checkout a plan's CTA opens.
|
|
39
39
|
*
|
package/dist/lib/tier.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Say } from '
|
|
1
|
+
import { type Say } from '@hanzo/i18n';
|
|
2
2
|
/** The plan, as billing names it. */
|
|
3
3
|
export interface TierLimits {
|
|
4
4
|
name: string;
|
|
@@ -83,7 +83,7 @@ export declare function readSubscription(signal?: AbortSignal): Promise<Subscrip
|
|
|
83
83
|
* price is per seat, so it is the seats times it; a cancelled term ends rather
|
|
84
84
|
* than renews.
|
|
85
85
|
*/
|
|
86
|
-
export declare function renewal(s: Subscription, t?: Say): string;
|
|
86
|
+
export declare function renewal(s: Subscription, t?: Say, locale?: string): string;
|
|
87
87
|
/** The live subscription, held: null while unknown, refused, or on no plan. */
|
|
88
88
|
export declare function useSubscription(enabled?: boolean, org?: string | null): Subscription | null;
|
|
89
89
|
/**
|
package/dist/lib/tier.js
CHANGED
|
@@ -26,11 +26,11 @@ import { api } from './api.js';
|
|
|
26
26
|
import { bearer, org, orgs, scope } from './session.js';
|
|
27
27
|
import { list } from './list.js';
|
|
28
28
|
import { money } from './pay.js';
|
|
29
|
-
import { english } from '
|
|
29
|
+
import { english } from '@hanzo/i18n';
|
|
30
30
|
/** A period's end as a sentence states it — "Oct 30, 2026" — or '' for none. Periods end on UTC days. */
|
|
31
|
-
function date(iso) {
|
|
31
|
+
function date(iso, locale = 'en-US') {
|
|
32
32
|
const t = iso ? Date.parse(iso) : NaN;
|
|
33
|
-
return Number.isNaN(t) ? '' : new Date(t).toLocaleDateString(
|
|
33
|
+
return Number.isNaN(t) ? '' : new Date(t).toLocaleDateString(locale, { timeZone: 'UTC', year: 'numeric', month: 'short', day: 'numeric' });
|
|
34
34
|
}
|
|
35
35
|
/** An error that names the status, for `say()` to turn into a sentence. */
|
|
36
36
|
const refusal = (status, message) => Object.assign(new Error(message), { status });
|
|
@@ -92,9 +92,9 @@ export async function readSubscription(signal) {
|
|
|
92
92
|
* price is per seat, so it is the seats times it; a cancelled term ends rather
|
|
93
93
|
* than renews.
|
|
94
94
|
*/
|
|
95
|
-
export function renewal(s, t = english) {
|
|
96
|
-
const each = money((s.plan.price * Math.max(1, s.quantity || 1)) / 100);
|
|
97
|
-
const when = date(s.currentPeriodEnd);
|
|
95
|
+
export function renewal(s, t = english, locale = 'en-US') {
|
|
96
|
+
const each = money((s.plan.price * Math.max(1, s.quantity || 1)) / 100, locale);
|
|
97
|
+
const when = date(s.currentPeriodEnd, locale);
|
|
98
98
|
const interval = s.plan.interval || 'month';
|
|
99
99
|
// A term the catalogue names other than a month or a year is drawn as it names it.
|
|
100
100
|
const price = interval === 'month' ? t('{price}/month', { price: each }) : interval === 'year' ? t('{price}/year', { price: each }) : `${each}/${interval}`;
|
package/dist/look.js
CHANGED
|
@@ -7,7 +7,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* and organization theme mods — stored and resolved for the organization in scope.
|
|
8
8
|
*/
|
|
9
9
|
import { useState } from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { phrase } from '@hanzo/i18n';
|
|
11
|
+
import { LanguagePicker } from '@hanzo/i18n/react';
|
|
12
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
11
13
|
import { Box, Button, Input, Separator, Text, XStack, YStack } from '@hanzo/ui';
|
|
12
14
|
import { Appearance } from '@hanzo/appearance';
|
|
13
15
|
import { useIam } from '@hanzo/iam/react';
|
|
@@ -21,12 +23,12 @@ import { brand } from './where.js';
|
|
|
21
23
|
import { tap } from './lib/tap.js';
|
|
22
24
|
const CHOICE = { rounded: 8, borderWidth: 1, borderStyle: 'solid', cursor: 'pointer' };
|
|
23
25
|
const PLATFORM_OPTIONS = [
|
|
24
|
-
{ id: 'auto', label: 'Auto (System OS)', note: 'Automatically detects your device operating system' },
|
|
25
|
-
{ id: 'ios', label: 'Apple iOS (Liquid Glass)', note: 'Continuous squircles, specular liquid glass, SF Pro typography' },
|
|
26
|
-
{ id: 'android', label: 'Android (Material 3)', note: 'Material 3 tonal elevations and Google Sans geometry' },
|
|
27
|
-
{ id: 'macos', label: 'Apple macOS (Vibrant)', note: 'Translucent glass sidebars and compact desktop density' },
|
|
28
|
-
{ id: 'windows', label: 'Windows (Mica Fluent)', note: 'Fluent Design acrylic Mica and Segoe UI Variable' },
|
|
29
|
-
{ id: 'linux', label: 'Linux (Clean System)', note: 'Crisp system geometry and flat modern edges' },
|
|
26
|
+
{ id: 'auto', label: phrase('Auto (System OS)'), note: phrase('Automatically detects your device operating system') },
|
|
27
|
+
{ id: 'ios', label: phrase('Apple iOS (Liquid Glass)'), note: phrase('Continuous squircles, specular liquid glass, SF Pro typography') },
|
|
28
|
+
{ id: 'android', label: phrase('Android (Material 3)'), note: phrase('Material 3 tonal elevations and Google Sans geometry') },
|
|
29
|
+
{ id: 'macos', label: phrase('Apple macOS (Vibrant)'), note: phrase('Translucent glass sidebars and compact desktop density') },
|
|
30
|
+
{ id: 'windows', label: phrase('Windows (Mica Fluent)'), note: phrase('Fluent Design acrylic Mica and Segoe UI Variable') },
|
|
31
|
+
{ id: 'linux', label: phrase('Linux (Clean System)'), note: phrase('Crisp system geometry and flat modern edges') },
|
|
30
32
|
];
|
|
31
33
|
export function Look() {
|
|
32
34
|
const { t } = useI18n();
|
|
@@ -84,7 +86,7 @@ export function Look() {
|
|
|
84
86
|
};
|
|
85
87
|
return (_jsxs(YStack, { gap: "$5", maxW: 540, children: [_jsx(Text, { fontSize: "$3", color: "$soft", children: t('Customized per organization and kept with your account across all Hanzo surfaces.') }), _jsx(Appearance, { org: org.id, orgName: org.name || brand(), account: { base: api(), token: accessToken ?? undefined } }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2.5", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Smartphone, { size: 16, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Native Platform Look & Feel') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Adaptive styling tailored to your OS: iOS Liquid Glass, Material 3, macOS Vibrant, or Windows Mica.') }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: PLATFORM_OPTIONS.map((opt) => {
|
|
86
88
|
const active = activePlatform === opt.id;
|
|
87
|
-
return (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => handlePlatformChange(opt.id), ...CHOICE, p: "$2.5", bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { gap: "$0.5", children: [_jsx(Text, { fontSize: "$3", fontWeight: active ? '600' : '500', color: active ? '$ink' : '$ink', children: opt.label }), _jsx(Text, { fontSize: "$1", color: "$soft", children: opt.note })] }), active ? _jsx(Check, { size: 16, color: "var(--primary)", "aria-hidden": true }) : null] }) }, opt.id));
|
|
89
|
+
return (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => handlePlatformChange(opt.id), ...CHOICE, p: "$2.5", bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { gap: "$0.5", children: [_jsx(Text, { fontSize: "$3", fontWeight: active ? '600' : '500', color: active ? '$ink' : '$ink', children: t(opt.label) }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t(opt.note) })] }), active ? _jsx(Check, { size: 16, color: "var(--primary)", "aria-hidden": true }) : null] }) }, opt.id));
|
|
88
90
|
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Palette, { size: 16, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Organization Theme Mods (@hanzo/mod)') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Select or fork designer themes for custom organization branding.') }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", children: BUILTIN_MODS.map((mod) => (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => applyMod(mod), ...CHOICE, py: 6, px: 12, bg: "transparent", borderColor: "var(--white-10)", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$2", color: "$ink", children: mod.name }) }, mod.id))) }), _jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Type, { size: 15, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Custom Typography') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Enter a font family name (e.g. "Geist", "Inter", "Cabinet Grotesk") or a webfont stylesheet URL.') }), _jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(Input, { flex: 1, size: "sm", value: customFont, onChange: (e) => setCustomFont(e.target.value), placeholder: "e.g. Cabinet Grotesk or https://fonts.googleapis.com/..." }), _jsx(Button, { size: "sm", onClick: handleApplyFont, children: fontApplied ? t('Applied!') : t('Apply Font') })] })] }), _jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Fork & Share Theme Mods') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Export current mod configuration or paste a mod JSON to import.') }), _jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(Input, { flex: 1, size: "sm", value: modJson, onChange: (e) => setModJson(e.target.value), placeholder: t('Paste mod JSON here to import') }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handleImportMod, children: [_jsx(Upload, { size: 13, "aria-hidden": true }), t('Import')] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => handleExportMod(BUILTIN_MODS[0]), children: [_jsx(Download, { size: 13, "aria-hidden": true }), copiedMod ? t('Copied!') : t('Export JSON')] })] })] })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Language') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('The language Hanzo is shown in, on every Hanzo surface you sign in to.') }), _jsx(XStack, { pt: "$1", children: _jsx(LanguagePicker, {}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", "data-slot": "settings-approval-mode", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Tool & Action Approval') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Control whether tools, connectors, and actions execute automatically or require manual approval first.') }), _jsx(XStack, { gap: "$2", pt: "$1", children: [
|
|
89
91
|
{ id: 'auto', label: t('Auto'), note: t('Runs tools on its own; pauses only for anything risky.') },
|
|
90
92
|
{ id: 'manual', label: t('Manual'), note: t('Asks before each tool, connector or site it opens.') },
|