@hanzo/build 0.2.52 → 0.2.53
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 +103 -49
- package/lib/api/billing.d.ts +39 -0
- package/lib/api/billing.js +41 -0
- package/lib/api/coding.d.ts +4 -1
- package/lib/api/coding.js +2 -0
- package/lib/api/environment.d.ts +12 -0
- package/lib/api/environment.js +39 -1
- package/lib/api/github.d.ts +24 -4
- package/lib/api/github.js +60 -16
- package/lib/api/limits.d.ts +69 -0
- package/lib/api/limits.js +86 -0
- package/lib/api/links.d.ts +42 -0
- package/lib/api/links.js +65 -0
- package/lib/api/pref.d.ts +5 -3
- package/lib/api/pref.js +0 -3
- package/lib/api/turn.d.ts +10 -1
- package/lib/api/turn.js +16 -4
- package/lib/api/work.d.ts +75 -38
- package/lib/api/work.js +132 -44
- package/lib/builder.d.ts +0 -10
- package/lib/builder.js +12 -52
- package/lib/choice.d.ts +21 -0
- package/lib/choice.js +40 -1
- package/lib/customize/agents.d.ts +1 -1
- package/lib/customize/agents.js +21 -19
- package/lib/customize/connectors.d.ts +1 -1
- package/lib/customize/connectors.js +80 -31
- package/lib/customize/index.d.ts +2 -0
- package/lib/customize/index.js +23 -19
- package/lib/customize/load.d.ts +9 -0
- package/lib/customize/load.js +22 -0
- package/lib/customize/plugins.d.ts +1 -1
- package/lib/customize/plugins.js +21 -19
- package/lib/customize/say.d.ts +1 -0
- package/lib/customize/say.js +38 -0
- package/lib/customize/skills.d.ts +1 -1
- package/lib/customize/skills.js +23 -17
- package/lib/customize/ui.d.ts +28 -11
- package/lib/customize/ui.js +29 -21
- package/lib/data.d.ts +13 -0
- package/lib/data.js +70 -0
- package/lib/desk.d.ts +6 -1
- package/lib/desk.js +43 -19
- package/lib/environment.d.ts +11 -3
- package/lib/environment.js +53 -13
- package/lib/foot.js +10 -6
- package/lib/forge.js +139 -71
- package/lib/index.d.ts +28 -2
- package/lib/index.js +26 -2
- package/lib/landing.d.ts +0 -10
- package/lib/landing.js +70 -38
- package/lib/merge.d.ts +223 -0
- package/lib/merge.js +380 -0
- package/lib/meter.d.ts +31 -0
- package/lib/meter.js +45 -0
- package/lib/mind.d.ts +60 -0
- package/lib/mind.js +187 -0
- package/lib/nav.d.ts +11 -0
- package/lib/nav.js +75 -0
- package/lib/panel.d.ts +45 -0
- package/lib/panel.js +115 -0
- package/lib/pick.d.ts +8 -0
- package/lib/pick.js +18 -1
- package/lib/plan.d.ts +78 -0
- package/lib/plan.js +133 -0
- package/lib/project.js +16 -6
- package/lib/prompt.d.ts +75 -0
- package/lib/prompt.js +125 -0
- package/lib/prose.js +14 -10
- package/lib/reply.d.ts +36 -0
- package/lib/reply.js +124 -0
- package/lib/route.d.ts +16 -0
- package/lib/route.js +40 -0
- package/lib/run.js +87 -52
- package/lib/section.d.ts +1 -1
- package/lib/section.js +7 -11
- package/lib/settings/billing.js +16 -9
- package/lib/settings/code.js +15 -12
- package/lib/settings/credits.d.ts +9 -0
- package/lib/settings/credits.js +110 -0
- package/lib/settings/plan.d.ts +17 -0
- package/lib/settings/plan.js +108 -0
- package/lib/settings/usage.js +11 -119
- package/lib/shelf.js +3 -3
- package/lib/standing.d.ts +44 -0
- package/lib/standing.js +64 -0
- package/lib/sync.js +22 -8
- package/lib/tabs.d.ts +53 -0
- package/lib/tabs.js +197 -0
- package/lib/tools.d.ts +2 -9
- package/lib/tools.js +20 -25
- package/lib/transcript.d.ts +10 -1
- package/lib/transcript.js +25 -10
- package/lib/voice.d.ts +2 -13
- package/lib/voice.js +7 -73
- package/package.json +20 -3
package/lib/voice.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* by `POST /v1/audio/transcriptions` on the platform, through `@hanzo/voice` —
|
|
6
|
-
* never by a browser's built-in recognizer, which ships the audio to its
|
|
7
|
-
* vendor. Press to record, press again to stop; the words land in the draft.
|
|
8
|
-
* Where there is no microphone or no recorder, `able` is false and the control
|
|
9
|
-
* says so rather than recording into nothing.
|
|
2
|
+
* The language dictation listens in. The microphone itself is the composer's
|
|
3
|
+
* (prompt.tsx, @hanzo/voice): heard by the platform, never by a browser's
|
|
4
|
+
* built-in recognizer, which ships the audio to its vendor.
|
|
10
5
|
*/
|
|
11
|
-
import { speech } from '@hanzo/voice';
|
|
12
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
6
|
import { usePrefs } from './prefs.js';
|
|
14
7
|
export const LANGUAGES = [
|
|
15
8
|
{ id: 'en', label: 'English' },
|
|
@@ -24,67 +17,8 @@ export function spoken() {
|
|
|
24
17
|
const nav = typeof navigator !== 'undefined' ? navigator.language.split('-')[0] : 'en';
|
|
25
18
|
return LANGUAGES.some((l) => l.id === nav) ? nav : 'en';
|
|
26
19
|
}
|
|
27
|
-
/**
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export function useDictation(t, onText, onNote) {
|
|
32
|
-
const [on, setOn] = useState(false);
|
|
33
|
-
const [busy, setBusy] = useState(false);
|
|
34
|
-
const [able, setAble] = useState(false);
|
|
35
|
-
const rec = useRef(null);
|
|
36
|
-
const said = useRef(onText);
|
|
37
|
-
said.current = onText;
|
|
38
|
-
const note = useRef(onNote);
|
|
39
|
-
note.current = onNote;
|
|
40
|
-
// The person's saved language (Settings → General), else this browser's, else English.
|
|
41
|
-
const kept = usePrefs();
|
|
42
|
-
const language = LANGUAGES.some((l) => l.id === kept.prefs.language) ? kept.prefs.language : spoken();
|
|
43
|
-
const setLanguage = useCallback((id) => kept.save({ language: id }).catch((e) => note.current(e.message)), [kept]);
|
|
44
|
-
const ear = useMemo(() => speech({ baseUrl: t.api, token: t.token, ear: 'whisper' }), [t]);
|
|
45
|
-
useEffect(() => setAble(recordable()), []);
|
|
46
|
-
const toggle = useCallback(async () => {
|
|
47
|
-
if (rec.current) {
|
|
48
|
-
rec.current.stop();
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
let stream;
|
|
52
|
-
try {
|
|
53
|
-
stream = await navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: true, noiseSuppression: true } });
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
note.current('The microphone is not available to this page.');
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const chunks = [];
|
|
60
|
-
const r = new MediaRecorder(stream);
|
|
61
|
-
r.ondataavailable = (e) => {
|
|
62
|
-
if (e.data.size)
|
|
63
|
-
chunks.push(e.data);
|
|
64
|
-
};
|
|
65
|
-
r.onstop = () => {
|
|
66
|
-
rec.current = null;
|
|
67
|
-
setOn(false);
|
|
68
|
-
for (const track of stream.getTracks())
|
|
69
|
-
track.stop();
|
|
70
|
-
const audio = new Blob(chunks, { type: r.mimeType || 'audio/webm' });
|
|
71
|
-
if (!audio.size)
|
|
72
|
-
return;
|
|
73
|
-
setBusy(true);
|
|
74
|
-
ear
|
|
75
|
-
.transcribe(audio, { language })
|
|
76
|
-
.then((text) => {
|
|
77
|
-
const words = text.trim();
|
|
78
|
-
if (words)
|
|
79
|
-
said.current(words);
|
|
80
|
-
})
|
|
81
|
-
.catch((e) => note.current(e.message))
|
|
82
|
-
.finally(() => setBusy(false));
|
|
83
|
-
};
|
|
84
|
-
rec.current = r;
|
|
85
|
-
r.start();
|
|
86
|
-
setOn(true);
|
|
87
|
-
}, [ear, language]);
|
|
88
|
-
useEffect(() => () => rec.current?.stop(), []);
|
|
89
|
-
return { on, busy, able, toggle, language, setLanguage, languages: LANGUAGES };
|
|
20
|
+
/** The person's saved language (Settings → General), else this browser's, else English. */
|
|
21
|
+
export function useSpoken() {
|
|
22
|
+
const { prefs } = usePrefs();
|
|
23
|
+
return LANGUAGES.some((l) => l.id === prefs.language) ? prefs.language : spoken();
|
|
90
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.53",
|
|
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 component, mounted by the Hanzo app at hanzo.ai.",
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"node": ">=22.18"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
+
"@hanzo/composer": "0.2.0",
|
|
11
12
|
"@hanzo/font": "1.9.3",
|
|
12
13
|
"@hanzo/gui": "8.3.5",
|
|
13
14
|
"@hanzo/iam": "0.21.28",
|
|
14
15
|
"@hanzo/ui": "8.27.77",
|
|
15
16
|
"@hanzo/vite": "0.1.4",
|
|
16
|
-
"@hanzo/voice": "0.1.
|
|
17
|
+
"@hanzo/voice": "0.1.18",
|
|
17
18
|
"@hanzogui/lucide-icons-2": "8.3.5",
|
|
18
19
|
"@hanzogui/next-theme": "8.3.5",
|
|
19
20
|
"@playwright/test": "1.63.0",
|
|
@@ -38,6 +39,21 @@
|
|
|
38
39
|
"import": "./lib/index.js",
|
|
39
40
|
"default": "./lib/index.js"
|
|
40
41
|
},
|
|
42
|
+
"./plan": {
|
|
43
|
+
"types": "./lib/plan.d.ts",
|
|
44
|
+
"import": "./lib/plan.js",
|
|
45
|
+
"default": "./lib/plan.js"
|
|
46
|
+
},
|
|
47
|
+
"./route": {
|
|
48
|
+
"types": "./lib/route.d.ts",
|
|
49
|
+
"import": "./lib/route.js",
|
|
50
|
+
"default": "./lib/route.js"
|
|
51
|
+
},
|
|
52
|
+
"./mind": {
|
|
53
|
+
"types": "./lib/mind.d.ts",
|
|
54
|
+
"import": "./lib/mind.js",
|
|
55
|
+
"default": "./lib/mind.js"
|
|
56
|
+
},
|
|
41
57
|
"./package.json": "./package.json"
|
|
42
58
|
},
|
|
43
59
|
"files": [
|
|
@@ -59,7 +75,8 @@
|
|
|
59
75
|
"@hanzo/ui": ">=8.27.67",
|
|
60
76
|
"@hanzogui/lucide-icons-2": ">=8.3.5",
|
|
61
77
|
"react": ">=19.2.8",
|
|
62
|
-
"@hanzo/voice": ">=0.1.
|
|
78
|
+
"@hanzo/voice": ">=0.1.16",
|
|
79
|
+
"@hanzo/composer": ">=0.2.0"
|
|
63
80
|
},
|
|
64
81
|
"scripts": {
|
|
65
82
|
"dev": "vite",
|