@hanzo/build 0.2.10 → 0.2.11
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 +97 -25
- package/lib/api/agents.d.ts +80 -0
- package/lib/api/agents.js +148 -0
- package/lib/api/billing.d.ts +205 -0
- package/lib/api/billing.js +300 -0
- package/lib/api/call.d.ts +6 -0
- package/lib/api/call.js +11 -0
- package/lib/api/capabilities.d.ts +25 -0
- package/lib/api/capabilities.js +40 -0
- package/lib/api/coding.d.ts +31 -1
- package/lib/api/coding.js +50 -1
- package/lib/api/connectors.d.ts +90 -0
- package/lib/api/connectors.js +109 -0
- package/lib/api/consent.d.ts +22 -0
- package/lib/api/consent.js +28 -0
- package/lib/api/github.d.ts +13 -0
- package/lib/api/github.js +9 -0
- package/lib/api/harness.d.ts +44 -0
- package/lib/api/harness.js +348 -0
- package/lib/api/keys.d.ts +41 -0
- package/lib/api/keys.js +55 -0
- package/lib/api/machines.d.ts +56 -0
- package/lib/api/machines.js +84 -0
- package/lib/api/members.d.ts +47 -0
- package/lib/api/members.js +88 -0
- package/lib/api/memory.d.ts +25 -0
- package/lib/api/memory.js +34 -0
- package/lib/api/places.d.ts +2 -2
- package/lib/api/places.js +3 -26
- package/lib/api/plugins.d.ts +55 -0
- package/lib/api/plugins.js +62 -0
- package/lib/api/pref.d.ts +49 -0
- package/lib/api/pref.js +68 -0
- package/lib/api/profile.d.ts +21 -0
- package/lib/api/profile.js +40 -0
- package/lib/api/projects.d.ts +19 -2
- package/lib/api/projects.js +29 -4
- package/lib/api/provider.d.ts +42 -0
- package/lib/api/provider.js +58 -0
- package/lib/api/sessions.d.ts +32 -4
- package/lib/api/sessions.js +42 -6
- package/lib/api/skills.d.ts +70 -0
- package/lib/api/skills.js +90 -0
- package/lib/api/tools.d.ts +34 -0
- package/lib/api/tools.js +37 -0
- package/lib/api/turn.d.ts +84 -16
- package/lib/api/turn.js +221 -4
- package/lib/api/webhooks.d.ts +60 -0
- package/lib/api/webhooks.js +81 -0
- package/lib/ask.d.ts +18 -0
- package/lib/ask.js +69 -0
- package/lib/builder.js +39 -19
- package/lib/customize/agents.d.ts +2 -0
- package/lib/customize/agents.js +125 -0
- package/lib/customize/connectors.d.ts +2 -0
- package/lib/customize/connectors.js +197 -0
- package/lib/customize/index.d.ts +6 -0
- package/lib/customize/index.js +50 -0
- package/lib/customize/plugins.d.ts +2 -0
- package/lib/customize/plugins.js +93 -0
- package/lib/customize/skills.d.ts +2 -0
- package/lib/customize/skills.js +125 -0
- package/lib/customize/ui.d.ts +110 -0
- package/lib/customize/ui.js +99 -0
- package/lib/desk.d.ts +4 -1
- package/lib/desk.js +3 -16
- package/lib/find.d.ts +7 -0
- package/lib/find.js +77 -0
- package/lib/foot.d.ts +16 -0
- package/lib/foot.js +36 -0
- package/lib/forge.js +4 -4
- package/lib/git.d.ts +4 -0
- package/lib/git.js +6 -2
- package/lib/host.d.ts +5 -0
- package/lib/landing.d.ts +10 -0
- package/lib/landing.js +30 -14
- package/lib/markdown.d.ts +49 -0
- package/lib/markdown.js +123 -0
- package/lib/plans.d.ts +1 -0
- package/lib/plans.js +113 -0
- package/lib/prefs.d.ts +30 -0
- package/lib/prefs.js +83 -0
- package/lib/prose.d.ts +4 -0
- package/lib/prose.js +53 -0
- package/lib/route.d.ts +16 -1
- package/lib/route.js +32 -1
- package/lib/run.js +184 -32
- package/lib/section.js +2 -2
- package/lib/settings/account.d.ts +5 -0
- package/lib/settings/account.js +111 -0
- package/lib/settings/billing.d.ts +1 -0
- package/lib/settings/billing.js +104 -0
- package/lib/settings/capabilities.d.ts +1 -0
- package/lib/settings/capabilities.js +55 -0
- package/lib/settings/card.d.ts +31 -0
- package/lib/settings/card.js +105 -0
- package/lib/settings/code.d.ts +1 -0
- package/lib/settings/code.js +51 -0
- package/lib/settings/environments.d.ts +1 -0
- package/lib/settings/environments.js +53 -0
- package/lib/settings/general.d.ts +1 -0
- package/lib/settings/general.js +44 -0
- package/lib/settings/index.d.ts +4 -0
- package/lib/settings/index.js +22 -0
- package/lib/settings/integrations.d.ts +1 -0
- package/lib/settings/integrations.js +81 -0
- package/lib/settings/keys.d.ts +1 -0
- package/lib/settings/keys.js +102 -0
- package/lib/settings/machines.d.ts +1 -0
- package/lib/settings/machines.js +118 -0
- package/lib/settings/members.d.ts +1 -0
- package/lib/settings/members.js +67 -0
- package/lib/settings/memory.d.ts +1 -0
- package/lib/settings/memory.js +56 -0
- package/lib/settings/notifications.d.ts +1 -0
- package/lib/settings/notifications.js +97 -0
- package/lib/settings/privacy.d.ts +1 -0
- package/lib/settings/privacy.js +63 -0
- package/lib/settings/sections.d.ts +16 -0
- package/lib/settings/sections.js +32 -0
- package/lib/settings/ui.d.ts +49 -0
- package/lib/settings/ui.js +47 -0
- package/lib/settings/usage.d.ts +1 -0
- package/lib/settings/usage.js +114 -0
- package/lib/shelf.d.ts +6 -0
- package/lib/shelf.js +86 -16
- package/lib/switch.js +1 -2
- package/lib/transcript.d.ts +12 -0
- package/lib/transcript.js +56 -0
- package/lib/voice.d.ts +3 -1
- package/lib/voice.js +10 -4
- package/package.json +1 -1
- package/lib/account.d.ts +0 -14
- package/lib/account.js +0 -38
- package/lib/mcp.d.ts +0 -1
- package/lib/mcp.js +0 -28
package/lib/voice.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { speech } from '@hanzo/voice';
|
|
12
12
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
|
+
import { usePrefs } from './prefs.js';
|
|
13
14
|
export const LANGUAGES = [
|
|
14
15
|
{ id: 'en', label: 'English' },
|
|
15
16
|
{ id: 'es', label: 'Español' },
|
|
@@ -18,6 +19,11 @@ export const LANGUAGES = [
|
|
|
18
19
|
{ id: 'ja', label: '日本語' },
|
|
19
20
|
{ id: 'zh', label: '中文' },
|
|
20
21
|
];
|
|
22
|
+
/** The language this browser is set to, when it is one dictation offers; English otherwise. */
|
|
23
|
+
export function spoken() {
|
|
24
|
+
const nav = typeof navigator !== 'undefined' ? navigator.language.split('-')[0] : 'en';
|
|
25
|
+
return LANGUAGES.some((l) => l.id === nav) ? nav : 'en';
|
|
26
|
+
}
|
|
21
27
|
/** Whether this browser can record the microphone at all. */
|
|
22
28
|
function recordable() {
|
|
23
29
|
if (typeof window === 'undefined' || typeof navigator === 'undefined')
|
|
@@ -28,15 +34,15 @@ export function useDictation(t, onText, onNote) {
|
|
|
28
34
|
const [on, setOn] = useState(false);
|
|
29
35
|
const [busy, setBusy] = useState(false);
|
|
30
36
|
const [able, setAble] = useState(false);
|
|
31
|
-
const [language, setLanguage] = useState(() => {
|
|
32
|
-
const nav = typeof navigator !== 'undefined' ? navigator.language.split('-')[0] : 'en';
|
|
33
|
-
return LANGUAGES.some((l) => l.id === nav) ? nav : 'en';
|
|
34
|
-
});
|
|
35
37
|
const rec = useRef(null);
|
|
36
38
|
const said = useRef(onText);
|
|
37
39
|
said.current = onText;
|
|
38
40
|
const note = useRef(onNote);
|
|
39
41
|
note.current = onNote;
|
|
42
|
+
// The person's saved language (Settings → General), else this browser's, else English.
|
|
43
|
+
const kept = usePrefs();
|
|
44
|
+
const language = LANGUAGES.some((l) => l.id === kept.prefs.language) ? kept.prefs.language : spoken();
|
|
45
|
+
const setLanguage = useCallback((id) => kept.save({ language: id }).catch((e) => note.current(e instanceof Error ? e.message : 'The language was not saved.')), [kept]);
|
|
40
46
|
const ear = useMemo(() => speech({ baseUrl: t.api, token: t.token, ear: 'whisper' }), [t]);
|
|
41
47
|
useEffect(() => setAble(recordable()), []);
|
|
42
48
|
const toggle = useCallback(async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"description": "Hanzo Build — say what you want, watch it built, deployed and running. The builder as a page (hanzo.build) and as a component (hanzo.ai/dev).",
|
package/lib/account.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RailSession } from '@hanzo/ui/chat';
|
|
2
|
-
/** The builder listens, so a settings control on this page opens the account dialog. */
|
|
3
|
-
export declare function onAccount(fn: () => void): () => void;
|
|
4
|
-
export declare function revealAccount(): void;
|
|
5
|
-
export declare function Account({ open, onOpenChange }: {
|
|
6
|
-
open: boolean;
|
|
7
|
-
onOpenChange: (o: boolean) => void;
|
|
8
|
-
}): import("react").JSX.Element;
|
|
9
|
-
export declare function Find({ open, onOpenChange, recents, onOpen, }: {
|
|
10
|
-
open: boolean;
|
|
11
|
-
onOpenChange: (o: boolean) => void;
|
|
12
|
-
recents: RailSession[];
|
|
13
|
-
onOpen: (id: string) => void;
|
|
14
|
-
}): import("react").JSX.Element;
|
package/lib/account.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* The rail's two small dialogs: the account (the caret by the email), and
|
|
4
|
-
* finding a run by name (the search icon).
|
|
5
|
-
*/
|
|
6
|
-
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
7
|
-
import { LogOut } from '@hanzogui/lucide-icons-2';
|
|
8
|
-
import { Button, Dialog, DialogContent, DialogTitle, Input } from '@hanzo/ui';
|
|
9
|
-
import { useMemo, useState } from 'react';
|
|
10
|
-
import { useHost } from './host.js';
|
|
11
|
-
let reveal = null;
|
|
12
|
-
/** The builder listens, so a settings control on this page opens the account dialog. */
|
|
13
|
-
export function onAccount(fn) {
|
|
14
|
-
reveal = fn;
|
|
15
|
-
return () => {
|
|
16
|
-
if (reveal === fn)
|
|
17
|
-
reveal = null;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export function revealAccount() {
|
|
21
|
-
reveal?.();
|
|
22
|
-
}
|
|
23
|
-
export function Account({ open, onOpenChange }) {
|
|
24
|
-
const host = useHost();
|
|
25
|
-
const who = host.person;
|
|
26
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW: 360, children: [_jsx(DialogTitle, { children: "Account" }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$3", color: "$ink", numberOfLines: 1, children: who?.name || who?.email || 'Signed out' }), who?.email && who.name ? (_jsx(SizableText, { size: "$2", color: "$soft", numberOfLines: 1, children: who.email })) : null, host.org ? (_jsxs(SizableText, { size: "$1", color: "$soft", children: ["Organization: ", host.org] })) : null] }), _jsx(XStack, { gap: "$2", justify: "flex-end", flexWrap: "wrap", children: host.signOut ? (_jsxs(Button, { variant: "outline", size: "sm", onPress: () => host.signOut?.(), children: [_jsx(LogOut, { size: 14 }), " Sign out"] })) : null })] }) }));
|
|
27
|
-
}
|
|
28
|
-
export function Find({ open, onOpenChange, recents, onOpen, }) {
|
|
29
|
-
const [q, setQ] = useState('');
|
|
30
|
-
const hits = useMemo(() => {
|
|
31
|
-
const n = q.trim().toLowerCase();
|
|
32
|
-
return (n ? recents.filter((r) => r.title.toLowerCase().includes(n)) : recents).slice(0, 12);
|
|
33
|
-
}, [q, recents]);
|
|
34
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW: 480, children: [_jsx(DialogTitle, { children: "Find a run" }), _jsx(Input, { autoFocus: true, value: q, onChangeText: setQ, placeholder: "Search runs\u2026", "aria-label": "Search runs", onKeyDown: (e) => {
|
|
35
|
-
if ((e.key ?? e.nativeEvent?.key) === 'Enter' && hits[0])
|
|
36
|
-
onOpen(hits[0].id);
|
|
37
|
-
} }), _jsx(YStack, { gap: "$1", role: "list", children: hits.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: "No run matches." })) : (hits.map((r) => (_jsx(XStack, { role: "listitem", render: "button", onPress: () => onOpen(r.id), px: "$2", py: "$1.5", rounded: "$3", hoverStyle: { bg: '$hover' }, children: _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: r.title }) }, r.id)))) })] }) }));
|
|
38
|
-
}
|
package/lib/mcp.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Servers(): import("react").JSX.Element;
|
package/lib/mcp.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* The fleet's native MCP servers.
|
|
4
|
-
*
|
|
5
|
-
* The list is the MCP server's own tools/list. A server starts when a run
|
|
6
|
-
* calls it and stays up afterwards, so this pane lists them rather than
|
|
7
|
-
* starting them.
|
|
8
|
-
*/
|
|
9
|
-
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
10
|
-
import { ChevronDown } from '@hanzogui/lucide-icons-2';
|
|
11
|
-
import { Input } from '@hanzo/ui';
|
|
12
|
-
import { useState } from 'react';
|
|
13
|
-
import { natives } from './api/mcp.js';
|
|
14
|
-
import { useRead } from './data.js';
|
|
15
|
-
import { useTarget } from './host.js';
|
|
16
|
-
export function Servers() {
|
|
17
|
-
const t = useTarget();
|
|
18
|
-
const list = useRead(() => natives(t), [], [t]);
|
|
19
|
-
const [q, setQ] = useState('');
|
|
20
|
-
const [open, setOpen] = useState(null);
|
|
21
|
-
const needle = q.trim().toLowerCase();
|
|
22
|
-
const shown = list.value.filter((s) => !needle || s.name.toLowerCase().includes(needle) || s.ops.some((op) => op.toLowerCase().includes(needle)));
|
|
23
|
-
const ops = shown.reduce((n, s) => n + s.ops.length, 0);
|
|
24
|
-
return (_jsx(YStack, { flex: 1, minH: 0, overflow: "scroll", px: "$6", py: "$6", children: _jsxs(YStack, { width: "100%", maxW: 1040, mx: "auto", gap: "$4", children: [_jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { render: "h1", size: "$6", color: "$ink", children: "MCP" }), _jsx(SizableText, { size: "$2", color: "$soft", children: "Native servers. A run starts one when it calls it, and the server stays up afterwards." })] }), _jsx(Input, { value: q, onChangeText: setQ, placeholder: "Find a server or an operation\u2026", "aria-label": "Find a server" }), list.loading && list.value.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: "Reading the servers\u2026" })) : list.error && list.value.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: list.error.message })) : shown.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: list.value.length === 0 ? 'The MCP server listed no native servers.' : 'No server matches.' })) : (_jsxs(YStack, { gap: "$1", children: [_jsxs(SizableText, { size: "$1", color: "$soft", children: [shown.length, " servers \u00B7 ", ops, " operations"] }), shown.map((s) => {
|
|
25
|
-
const on = open === s.name;
|
|
26
|
-
return (_jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: [_jsxs(XStack, { render: "button", "aria-expanded": on, "aria-label": s.name, items: "center", gap: "$3", px: "$3", py: "$2.5", hoverStyle: { bg: '$hover' }, onPress: () => setOpen(on ? null : s.name), children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { size: "$3", color: "$ink", children: s.name }), s.description ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: on ? undefined : 2, children: s.description })) : null] }), _jsx(SizableText, { size: "$1", color: "$soft", children: s.ops.length }), _jsx(ChevronDown, { size: 14, style: { transform: on ? 'rotate(180deg)' : undefined } })] }), on ? (_jsx(YStack, { px: "$3", py: "$2", gap: "$1", borderTopWidth: 1, borderColor: "$borderColor", children: s.ops.length === 0 ? (_jsx(SizableText, { size: "$1", color: "$soft", children: "This server named no operations." })) : (s.ops.map((op) => (_jsx(SizableText, { size: "$1", color: "$ink", children: op }, op)))) })) : null] }, s.name));
|
|
27
|
-
})] }))] }) }));
|
|
28
|
-
}
|