@hanzo/build 0.2.122 → 0.2.123
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/lib/api/cli.d.ts +59 -0
- package/lib/api/cli.js +133 -0
- package/lib/api/sessions.d.ts +13 -0
- package/lib/api/sessions.js +23 -2
- package/lib/api/talk.d.ts +44 -0
- package/lib/api/talk.js +71 -0
- package/lib/api/turn.d.ts +29 -3
- package/lib/api/turn.js +121 -5
- package/lib/builder.js +2 -2
- package/lib/data.d.ts +4 -2
- package/lib/data.js +20 -7
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/landing.js +15 -14
- package/lib/mind.d.ts +2 -0
- package/lib/mind.js +28 -1
- package/lib/project.js +4 -1
- package/lib/run.d.ts +1 -0
- package/lib/run.js +30 -5
- package/lib/section.d.ts +5 -0
- package/lib/section.js +7 -1
- package/lib/talk.d.ts +5 -0
- package/lib/talk.js +104 -0
- package/lib/transcript.d.ts +5 -1
- package/lib/transcript.js +15 -4
- package/package.json +1 -1
package/lib/data.js
CHANGED
|
@@ -11,6 +11,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
11
11
|
import { places } from './api/places.js';
|
|
12
12
|
import { projects } from './api/projects.js';
|
|
13
13
|
import { get, list, watch } from './api/sessions.js';
|
|
14
|
+
import { TALK } from './api/talk.js';
|
|
14
15
|
import { merge } from './api/turn.js';
|
|
15
16
|
/** Run `load` whenever `key` changes (and on `reload`), keeping the last good value. */
|
|
16
17
|
export function useRead(load, initial, key) {
|
|
@@ -117,15 +118,22 @@ export function useCached(key, load, initial, wait = WAIT) {
|
|
|
117
118
|
/** Last coding runs read per `api\norg`, so mounting another rail or switching tabs starts warm. */
|
|
118
119
|
const recentRuns = new Map();
|
|
119
120
|
/**
|
|
120
|
-
* The org's coding runs, newest first, kept current by the
|
|
121
|
-
* stream: a status that moves moves its dot, and
|
|
121
|
+
* The org's conversations and coding runs, newest first, kept current by the
|
|
122
|
+
* org's own session stream: a status that moves moves its dot, and one started
|
|
123
|
+
* anywhere appears. A conversation's own coding runs are in its tree, not here:
|
|
124
|
+
* the platform lists roots.
|
|
122
125
|
*/
|
|
123
126
|
export function useRecents(t, signed) {
|
|
124
127
|
const scope = signed ? `${t.api}\n${t.org ?? ''}` : null;
|
|
125
128
|
const warm = scope !== null ? recentRuns.get(scope) : undefined;
|
|
126
129
|
const read = useRead(signed
|
|
127
130
|
? async () => {
|
|
128
|
-
const
|
|
131
|
+
const [runs, talked] = await Promise.all([list(t, { kind: 'coding', limit: 50 }), list(t, { channel: TALK, limit: 50 })]);
|
|
132
|
+
const seen = new Set();
|
|
133
|
+
const next = [...runs, ...talked]
|
|
134
|
+
.filter((s) => !seen.has(s.id) && Boolean(seen.add(s.id)))
|
|
135
|
+
.sort((a, b) => b.createdAt.localeCompare(a.createdAt))
|
|
136
|
+
.slice(0, 50);
|
|
129
137
|
if (scope !== null)
|
|
130
138
|
recentRuns.set(scope, next);
|
|
131
139
|
return next;
|
|
@@ -221,14 +229,17 @@ export function useRun(t, id) {
|
|
|
221
229
|
const [refused, setRefused] = useState('');
|
|
222
230
|
const reload = useRef(detail.reload);
|
|
223
231
|
reload.current = detail.reload;
|
|
232
|
+
// The stream is followed by the run's tree: a conversation's coding run is in the
|
|
233
|
+
// conversation's (talk.ts), and its frames carry that root.
|
|
234
|
+
const root = (detail.value?.id === id && detail.value.root) || id;
|
|
224
235
|
useEffect(() => {
|
|
225
236
|
setLive([]);
|
|
226
237
|
setPushed(null);
|
|
227
238
|
setRefused('');
|
|
228
|
-
if (!id)
|
|
239
|
+
if (!id || !root)
|
|
229
240
|
return;
|
|
230
241
|
const ctl = new AbortController();
|
|
231
|
-
void watch(t,
|
|
242
|
+
void watch(t, root, {
|
|
232
243
|
// A frame from a stream this run has already left is not this run's.
|
|
233
244
|
event: (e) => {
|
|
234
245
|
if (!ctl.signal.aborted && e.sessionId === id)
|
|
@@ -238,13 +249,15 @@ export function useRun(t, id) {
|
|
|
238
249
|
if (!ctl.signal.aborted && s.id === id)
|
|
239
250
|
setPushed(s);
|
|
240
251
|
},
|
|
252
|
+
// A reconnect may have missed frames, and so may the move to the run's
|
|
253
|
+
// own tree once its read named one: either is read again.
|
|
241
254
|
open: (n) => {
|
|
242
|
-
if (n > 0)
|
|
255
|
+
if (n > 0 || root !== id)
|
|
243
256
|
reload.current();
|
|
244
257
|
},
|
|
245
258
|
}, ctl.signal).catch((e) => setRefused(e.message));
|
|
246
259
|
return () => ctl.abort();
|
|
247
|
-
}, [t, id]);
|
|
260
|
+
}, [t, id, root]);
|
|
248
261
|
// The read and the frames describe THIS run or nothing: a read kept from the
|
|
249
262
|
// run before (it stays until the next one lands, or forever if it fails) must
|
|
250
263
|
// not lend this run its pull request.
|
package/lib/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export { Editor } from './automations.tsx';
|
|
|
28
28
|
export { library, nav, NEW, own, sections, tabs, useScheduled, type Group } from './nav.tsx';
|
|
29
29
|
export { MARKS, type Icon, type Mark } from './marks.tsx';
|
|
30
30
|
export { useFunds, type Funds } from './mind.ts';
|
|
31
|
-
export { DevSection, DOTS, useSessions } from './section.tsx';
|
|
31
|
+
export { DevSection, dot, DOTS, useSessions } from './section.tsx';
|
|
32
32
|
export { HostProvider } from './host.tsx';
|
|
33
33
|
export { Slack, useWho, Who } from './foot.tsx';
|
|
34
34
|
export { Grip, type GripProps } from '@hanzo/ui';
|
|
@@ -43,6 +43,7 @@ export type { Limits } from './api/limits.ts';
|
|
|
43
43
|
export type { Target } from './api/call.ts';
|
|
44
44
|
export type { Browse, Browser, Host, Person, Shown } from './host.tsx';
|
|
45
45
|
export type { Session, Status } from './api/sessions.ts';
|
|
46
|
+
export { talks } from './api/talk.ts';
|
|
46
47
|
export type { Read } from './data.ts';
|
|
47
48
|
export { href, parse, path, PLACES, route, SESSION, SLUG, type Route, type Screen } from './route.ts';
|
|
48
49
|
/**
|
package/lib/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export { Editor } from './automations.js';
|
|
|
28
28
|
export { library, nav, NEW, own, sections, tabs, useScheduled } from './nav.js';
|
|
29
29
|
export { MARKS } from './marks.js';
|
|
30
30
|
export { useFunds } from './mind.js';
|
|
31
|
-
export { DevSection, DOTS, useSessions } from './section.js';
|
|
31
|
+
export { DevSection, dot, DOTS, useSessions } from './section.js';
|
|
32
32
|
export { HostProvider } from './host.js';
|
|
33
33
|
export { Slack, useWho, Who } from './foot.js';
|
|
34
34
|
export { Grip } from '@hanzo/ui';
|
|
@@ -39,6 +39,7 @@ export { Plan } from './settings/plan.js';
|
|
|
39
39
|
export { Credits, SEPARATE } from './settings/credits.js';
|
|
40
40
|
export { useStanding, rows, left } from './standing.js';
|
|
41
41
|
export { kind, label, said, share, spent, ways, when } from './plan.js';
|
|
42
|
+
export { talks } from './api/talk.js';
|
|
42
43
|
export { href, parse, path, PLACES, route, SESSION, SLUG } from './route.js';
|
|
43
44
|
/**
|
|
44
45
|
* What Chat draws the same way (@hanzo/rooms imports these): the model and
|
package/lib/landing.js
CHANGED
|
@@ -7,10 +7,11 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
* composer Chat draws too (@hanzo/ui/chat): Dev hands it the three pills, the
|
|
8
8
|
* chips that go to its repositories, issues and templates, and its commands.
|
|
9
9
|
*
|
|
10
|
-
* Sending
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Sending opens a conversation (api/talk.ts) and goes to it: the agent answers,
|
|
11
|
+
* and decides for itself when the ask needs a sandbox or a coding run — on the
|
|
12
|
+
* repository, branch and machine chosen here, and only planning when Plan is on.
|
|
13
|
+
* A run on one of the org's machines needs a repository, so an ask with none
|
|
14
|
+
* chosen there opens the picker rather than making a project up from its words. The choices a person made here are kept in this
|
|
14
15
|
* browser, per org, so the next New starts where the last one did — and a kept
|
|
15
16
|
* repository New can no longer offer is let go, so the next run is not sent
|
|
16
17
|
* back to it. A repository can also be given by its address (Use a git URL).
|
|
@@ -29,6 +30,7 @@ import { useLimits } from '@hanzo/ui/product/useLimits';
|
|
|
29
30
|
import { useDictation, useTalk, useVoice } from '@hanzo/voice';
|
|
30
31
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
31
32
|
import { start, unhonoured } from './api/coding.js';
|
|
33
|
+
import { say } from './api/talk.js';
|
|
32
34
|
import { asRepo, chosen, codebases, one } from './api/codebases.js';
|
|
33
35
|
import { heard, repos as githubRepos } from './api/github.js';
|
|
34
36
|
import { plain, read, SETUP, unset } from './api/environment.js';
|
|
@@ -272,19 +274,18 @@ export function Landing({ onStarted }) {
|
|
|
272
274
|
setNote(prepped.reply.split('```')[0].trim());
|
|
273
275
|
return;
|
|
274
276
|
}
|
|
275
|
-
//
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const run = await start(target, {
|
|
281
|
-
prompt: compose([said.trim(), carry.text, prepped.system ?? ''].filter(Boolean).join('\n\n---\n'), files),
|
|
277
|
+
// The first thing said opens a conversation (api/talk.ts) and starts nothing:
|
|
278
|
+
// the agent answers, and leases a sandbox or starts a coding run only when the
|
|
279
|
+
// ask needs one — on the repository, branch, machine and Plan chosen here.
|
|
280
|
+
const sent = await say(target, {
|
|
281
|
+
input: compose([said.trim(), carry.text, prepped.system ?? ''].filter(Boolean).join('\n\n---\n'), files),
|
|
282
282
|
// The name alone. The org rides the request, and a slash is not a repo name.
|
|
283
283
|
// An empty base or place is not sent: the default branch, and the sandbox.
|
|
284
284
|
repo: repo?.name ?? hub?.full_name,
|
|
285
285
|
base: repo ? kept.branch : hub ? kept.branch || hub.default_branch : undefined,
|
|
286
|
-
|
|
287
|
-
mode,
|
|
286
|
+
target: place.id,
|
|
287
|
+
// The mode the composer shows: Auto starts a build, Manual asks first, Plan only plans.
|
|
288
|
+
mode: carry.mode.value === 'manual' ? 'manual' : mode === 'plan' ? 'plan' : 'auto',
|
|
288
289
|
model: mind.model,
|
|
289
290
|
effort: level(mind.effort),
|
|
290
291
|
issue,
|
|
@@ -292,7 +293,7 @@ export function Landing({ onStarted }) {
|
|
|
292
293
|
setDraft('');
|
|
293
294
|
setFiles([]);
|
|
294
295
|
setIssue(0);
|
|
295
|
-
onStarted(
|
|
296
|
+
onStarted(sent.session);
|
|
296
297
|
}
|
|
297
298
|
catch (e) {
|
|
298
299
|
setNote(plain(e, repo?.name ?? hub?.full_name ?? t('a new project'), 'run', t));
|
package/lib/mind.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface Choice {
|
|
|
38
38
|
export declare const FIRST: Choice;
|
|
39
39
|
/** Whether a plan grants only Enso Auto. An unknown plan is not taken for Free. */
|
|
40
40
|
export declare const isFree: (plan: string | null | undefined) => boolean;
|
|
41
|
+
/** Whether third-party cloud models are enabled in Settings → Preferences (off by default). */
|
|
42
|
+
export declare function allowThirdPartyModels(): boolean;
|
|
41
43
|
/** The kept choice, Enso and Auto where nothing is kept. Stable while the stored text is. Low and Medium, offered once, read as Auto. */
|
|
42
44
|
export declare function kept(): Choice;
|
|
43
45
|
/** Keep a change, in this browser, for every surface that reads it. */
|
package/lib/mind.js
CHANGED
|
@@ -14,6 +14,31 @@ export const FIRST = { model: ENSO, effort: 'auto' };
|
|
|
14
14
|
export const isFree = (plan) => plan === 'free';
|
|
15
15
|
const KEY = 'hanzo.mind';
|
|
16
16
|
const CHANGE = 'hanzo:mind';
|
|
17
|
+
const PREFS_KEY = 'hanzo.chat.preferences';
|
|
18
|
+
const PREFS_EVENT = 'hanzo:chat:preferences';
|
|
19
|
+
/** Whether third-party cloud models are enabled in Settings → Preferences (off by default). */
|
|
20
|
+
export function allowThirdPartyModels() {
|
|
21
|
+
try {
|
|
22
|
+
const v = JSON.parse(store()?.getItem(PREFS_KEY) ?? 'null');
|
|
23
|
+
return v?.thirdPartyChosen ? Boolean(v.allowThirdPartyModels) : v?.allowThirdPartyModels === true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function useAllowThirdPartyModels() {
|
|
30
|
+
const [allowed, setAllowed] = useState(allowThirdPartyModels);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const sync = () => setAllowed(allowThirdPartyModels());
|
|
33
|
+
window.addEventListener(PREFS_EVENT, sync);
|
|
34
|
+
window.addEventListener('storage', sync);
|
|
35
|
+
return () => {
|
|
36
|
+
window.removeEventListener(PREFS_EVENT, sync);
|
|
37
|
+
window.removeEventListener('storage', sync);
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
return allowed;
|
|
41
|
+
}
|
|
17
42
|
/** An effort kept, read back: one the ladder still offers, XHigh (which Max replaced) as Max, else Auto. */
|
|
18
43
|
const effortOf = (v) => (v === 'xhigh' ? 'max' : EFFORTS.some((e) => e.id === v) ? v : FIRST.effort);
|
|
19
44
|
/** The store, or null where the browser gives none (a server render, blocked site data). */
|
|
@@ -233,6 +258,7 @@ function settleReturn() {
|
|
|
233
258
|
export function useMind(t, plan, topUp) {
|
|
234
259
|
const [choice, change] = useChoice();
|
|
235
260
|
const { models, list, loading, error, note } = useCatalog(t);
|
|
261
|
+
const allowThirdParty = useAllowThirdPartyModels();
|
|
236
262
|
const free = isFree(plan);
|
|
237
263
|
const [picked, pick] = usePick(choice.model, (id) => change({ model: id }), list);
|
|
238
264
|
// Another maker's model is paid from the balance on any plan; Hanzo's own follow the plan.
|
|
@@ -240,6 +266,7 @@ export function useMind(t, plan, topUp) {
|
|
|
240
266
|
const cents = funds.cents;
|
|
241
267
|
const may = (id) => sendable(free, models, cents, id);
|
|
242
268
|
const model = may(picked) ? picked : ENSO;
|
|
269
|
+
const listed = allowThirdParty ? models : models.filter((m) => !thirdParty(m) || m.id === model);
|
|
243
270
|
// A top-up returns to this address with the model it was for: pick it once the balance can pay.
|
|
244
271
|
const [back] = useState(returned);
|
|
245
272
|
useEffect(() => {
|
|
@@ -254,7 +281,7 @@ export function useMind(t, plan, topUp) {
|
|
|
254
281
|
return {
|
|
255
282
|
model,
|
|
256
283
|
effort: choice.effort,
|
|
257
|
-
models,
|
|
284
|
+
models: listed,
|
|
258
285
|
loading,
|
|
259
286
|
error,
|
|
260
287
|
note,
|
package/lib/project.js
CHANGED
|
@@ -49,12 +49,14 @@ import { Attachments, CHAT, Console, DEVICES, Feedback, FileTabs, FileTree, Page
|
|
|
49
49
|
import { Composer, Message } from '@hanzo/ui/chat';
|
|
50
50
|
import { Button, Dialog, DialogContent, DialogTitle } from '@hanzo/ui';
|
|
51
51
|
import { HanzoMark } from '@hanzo/ui/product';
|
|
52
|
+
import { useLimits } from '@hanzo/ui/product/useLimits';
|
|
52
53
|
import { useDictation, useVoice } from '@hanzo/voice';
|
|
53
54
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
54
55
|
import { read as pushed } from './api/changes.js';
|
|
55
56
|
import { codebases, one } from './api/codebases.js';
|
|
56
57
|
import { start } from './api/coding.js';
|
|
57
58
|
import { blob, tree } from './api/git.js';
|
|
59
|
+
import { limits as readLimits } from './api/models.js';
|
|
58
60
|
import { declare } from './api/platform.js';
|
|
59
61
|
import { address, deployments, name as repoName, ours, templates } from './api/projects.js';
|
|
60
62
|
import { list, message, stop } from './api/sessions.js';
|
|
@@ -206,7 +208,8 @@ export function Project({ at }) {
|
|
|
206
208
|
const [picked, setPicked] = useState([]);
|
|
207
209
|
const [attached, setAttached] = useState([]);
|
|
208
210
|
// The model and effort Chat and New share, and dictation into the ask.
|
|
209
|
-
const
|
|
211
|
+
const { limits } = useLimits(signed ? (signal) => readLimits(target, signal) : null, target);
|
|
212
|
+
const mind = useMind(target, limits?.plan, host.topUp);
|
|
210
213
|
const voice = useVoice({ speech: useEar(target), language: useSpoken(), ...useDictation(draft, setDraft) });
|
|
211
214
|
const [bridge, setBridge] = useState(false);
|
|
212
215
|
const [editing, setEditing] = useState(false);
|
package/lib/run.d.ts
CHANGED
package/lib/run.js
CHANGED
|
@@ -39,6 +39,7 @@ import { approve, followUp, headline, retry, start, steer } from './api/coding.j
|
|
|
39
39
|
import { limits as readLimits } from './api/models.js';
|
|
40
40
|
import { list, message, pause, publish, rename, resume, stop, story, took } from './api/sessions.js';
|
|
41
41
|
import { answer, cards, followed, outcome, pull, settled, steps } from './api/turn.js';
|
|
42
|
+
import { answer as reply, say as talk, talks } from './api/talk.js';
|
|
42
43
|
import { verdict } from './api/verdict.js';
|
|
43
44
|
import { useKept, useProjects, useRead, useRun } from './data.js';
|
|
44
45
|
import { Desk, SEED } from './desk.js';
|
|
@@ -54,6 +55,7 @@ import { schedule } from './scheduled.js';
|
|
|
54
55
|
import { SideProvider, useSplit } from './side.js';
|
|
55
56
|
import { PAGE, useDeck, useKey, usePanel } from './tabs.js';
|
|
56
57
|
import { carrying, compose, pick } from './tools.js';
|
|
58
|
+
import { Talk } from './talk.js';
|
|
57
59
|
import { Transcript } from './transcript.js';
|
|
58
60
|
const LIVE = new Set(['running', 'paused', '']);
|
|
59
61
|
/** A run's status as the line under its title says it; one the service adds later is drawn as it comes. */
|
|
@@ -64,13 +66,20 @@ const STATUS = {
|
|
|
64
66
|
error: phrase('error'),
|
|
65
67
|
stopped: phrase('stopped'),
|
|
66
68
|
};
|
|
69
|
+
/** One session's page: a conversation (talk.tsx) or one run, as its record says. */
|
|
67
70
|
export function Run({ id }) {
|
|
68
|
-
const { t: say } = useI18n();
|
|
69
71
|
const host = useHost();
|
|
70
72
|
const t = useTarget();
|
|
71
73
|
// Signed out, there is nothing to read: the gateway answers a bare run with a refusal.
|
|
74
|
+
const state = useRun(t, host.person ? id : null);
|
|
75
|
+
return talks(state.record) ? _jsx(Talk, { id: id, state: state }) : _jsx(Job, { id: id, state: state });
|
|
76
|
+
}
|
|
77
|
+
function Job({ id, state: read }) {
|
|
78
|
+
const { t: say } = useI18n();
|
|
79
|
+
const host = useHost();
|
|
80
|
+
const t = useTarget();
|
|
72
81
|
const signed = Boolean(host.person);
|
|
73
|
-
const { detail, record, events, status, refused } =
|
|
82
|
+
const { detail, record, events, status, refused } = read;
|
|
74
83
|
const [draft, setDraft] = useState('');
|
|
75
84
|
const [files, setFiles] = useState([]);
|
|
76
85
|
const [note, setNote] = useState('');
|
|
@@ -100,8 +109,8 @@ export function Run({ id }) {
|
|
|
100
109
|
const wakeLockRef = useRef(null);
|
|
101
110
|
const [nowMs, setNowMs] = useState(() => Date.now());
|
|
102
111
|
// The model and effort a run started here uses: the one choice Chat and New share.
|
|
103
|
-
const mind = useMind(t);
|
|
104
112
|
const { limits } = useLimits(signed ? (signal) => readLimits(t, signal) : null, t);
|
|
113
|
+
const mind = useMind(t, limits?.plan, host.topUp);
|
|
105
114
|
const voice = useVoice({ speech: useEar(t), language: useSpoken(), ...useDictation(draft, setDraft) });
|
|
106
115
|
const listen = useMemo(() => speaker(t), [t]);
|
|
107
116
|
const mode = record?.mode ?? '';
|
|
@@ -240,6 +249,18 @@ export function Run({ id }) {
|
|
|
240
249
|
throw new Error(say('This run is still being read'));
|
|
241
250
|
if (paused)
|
|
242
251
|
await stop(t, id, 'Continued in a follow-up run').catch(() => undefined);
|
|
252
|
+
// A run a conversation started is carried on by the conversation (talk.ts): the
|
|
253
|
+
// words go there, in its session, and so does the reader.
|
|
254
|
+
if (record?.parent) {
|
|
255
|
+
const words = how === 'approve' ? `Carry out this plan:\n\n${said.trim()}` : said.trim() || 'Continue where the run left off.';
|
|
256
|
+
// Approving the plan is going ahead: the conversation leaves Plan for Auto, so
|
|
257
|
+
// the run it starts builds.
|
|
258
|
+
await talk(t, { session: record.parent, input: words, model: mind.model, effort: level(mind.effort), ...(how === 'approve' ? { mode: 'auto' } : {}) });
|
|
259
|
+
setDraft('');
|
|
260
|
+
setFiles([]);
|
|
261
|
+
host.go(record.parent);
|
|
262
|
+
return '';
|
|
263
|
+
}
|
|
243
264
|
const ask = how === 'approve' ? approve(earlier, said) : how === 'retry' ? retry(earlier, said) : followUp(earlier, said);
|
|
244
265
|
const run = await start(t, tuned(ask));
|
|
245
266
|
setDraft('');
|
|
@@ -461,7 +482,9 @@ export function Run({ id }) {
|
|
|
461
482
|
? say('Add a follow up for the setup agent')
|
|
462
483
|
: say('Add a follow up')
|
|
463
484
|
: finished
|
|
464
|
-
?
|
|
485
|
+
? record?.parent
|
|
486
|
+
? say('Follow up — continues the conversation')
|
|
487
|
+
: say('Follow up — continues in a new run')
|
|
465
488
|
: say('Reading this run…');
|
|
466
489
|
const desk_ = (sheet) => (_jsx(Desk, { id: id, repo: record?.repo ?? '', branch: record?.branch ?? '', base: record?.base ?? '', environment: record?.environment ?? '', mode: mode, pr: pr, title: title, project: record?.project ?? '', sandbox: record?.sandbox ?? '', site: site, published: end.published, events: events, live: running, menu: [...manage, ...sharing], refused: signed ? refused || (detail.error ? say(detail.error.message) : '') : say('Sign in to follow this run.'), retry: signed ? say('Retry') : say('Sign in'), onRetry: signed ? detail.reload : () => host.signIn?.(), side: side, sheet: sheet, onHide: () => setDesk(false), envColumn: envColumn, splitPanes: splitPanes, onCloseSplitPane: (pid) => setSplitPanes((prev) => prev.filter((k) => k !== pid)), onExpandSplitPane: (pid) => {
|
|
467
490
|
setSplitPanes([]);
|
|
@@ -528,7 +551,9 @@ export function Run({ id }) {
|
|
|
528
551
|
? `${say('This run stopped with an error.')} ${say('Its work so far is on its branch.')}`
|
|
529
552
|
: `${say('This run stopped with an error.')} ${say('It saved nothing to its branch, so Try again starts over.')}` })) : null,
|
|
530
553
|
// A paused run's agent was stopped where it stood; what it was running is cut off.
|
|
531
|
-
live: running && !paused, header: hidden ? (_jsx(SizableText, { size: "$1", color: "$soft", children: `${hidden === 1 ? say('{n} earlier turn is not shown.', { n: hidden }) : say('{n} earlier turns are not shown.', { n: hidden })} ${say('The run’s Git tab has everything it pushed.')}` })) : null, onApprove: planned && earlier ? (p) => void act(() => carry(p, 'approve')) : undefined,
|
|
554
|
+
live: running && !paused, header: hidden ? (_jsx(SizableText, { size: "$1", color: "$soft", children: `${hidden === 1 ? say('{n} earlier turn is not shown.', { n: hidden }) : say('{n} earlier turns are not shown.', { n: hidden })} ${say('The run’s Git tab has everything it pushed.')}` })) : null, onApprove: planned && earlier ? (p) => void act(() => carry(p, 'approve')) : undefined,
|
|
555
|
+
// What dev asks its person while it works (its ask tool), answered here.
|
|
556
|
+
onAnswer: signed ? (q, label) => void act(async () => (await reply(t, id, q, label, true), '')) : undefined, approving: busy, onVerdict: (v) => verdict(t, id, record?.project ?? '', v), empty: signed ? (_jsx(SizableText, { size: "$2", color: "$soft", children: detail.error
|
|
532
557
|
? say(detail.error.message)
|
|
533
558
|
: detail.loading
|
|
534
559
|
? say('Reading this run…')
|
package/lib/section.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import { type Read } from './data.ts';
|
|
|
5
5
|
import type { Host } from './host.tsx';
|
|
6
6
|
/** A run's status, as the rail's dot draws it. Anything else is idle. */
|
|
7
7
|
export declare const DOTS: Record<string, SessionStatus>;
|
|
8
|
+
/**
|
|
9
|
+
* The dot a row draws. A conversation rests paused between turns (api/talk.ts):
|
|
10
|
+
* it has answered and waits for the person, which reads as done, not as a run held.
|
|
11
|
+
*/
|
|
12
|
+
export declare const dot: (s: Pick<Session, 'status' | 'channel' | 'parent'>) => SessionStatus;
|
|
8
13
|
/** The org's coding runs, newest first, kept live by the org's feed. */
|
|
9
14
|
export declare function useSessions(host: Host): Read<Session[]>;
|
|
10
15
|
/**
|
package/lib/section.js
CHANGED
|
@@ -14,6 +14,7 @@ import { SizableText } from '@hanzo/gui';
|
|
|
14
14
|
import { useI18n } from '@hanzo/i18n/react';
|
|
15
15
|
import { SidebarItem, SidebarSection, StatusDot } from '@hanzo/ui/chat';
|
|
16
16
|
import { useMemo } from 'react';
|
|
17
|
+
import { talks } from './api/talk.js';
|
|
17
18
|
import { useRecents } from './data.js';
|
|
18
19
|
import { nav } from './nav.js';
|
|
19
20
|
import { route } from './route.js';
|
|
@@ -25,6 +26,11 @@ export const DOTS = {
|
|
|
25
26
|
stopped: 'stopped',
|
|
26
27
|
error: 'error',
|
|
27
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* The dot a row draws. A conversation rests paused between turns (api/talk.ts):
|
|
31
|
+
* it has answered and waits for the person, which reads as done, not as a run held.
|
|
32
|
+
*/
|
|
33
|
+
export const dot = (s) => talks(s) && s.status === 'paused' ? 'done' : (DOTS[s.status] ?? 'idle');
|
|
28
34
|
/** The org's coding runs, newest first, kept live by the org's feed. */
|
|
29
35
|
export function useSessions(host) {
|
|
30
36
|
const t = useMemo(() => ({ api: host.api, token: host.token, org: host.org }), [host.api, host.token, host.org]);
|
|
@@ -46,7 +52,7 @@ export function DevSection({ host, onPick, label, children, }) {
|
|
|
46
52
|
press?.();
|
|
47
53
|
onPick?.();
|
|
48
54
|
};
|
|
49
|
-
return (_jsxs(_Fragment, { children: [nav(host, host.go, t).map((g) => (_jsx(SidebarSection, { label: g.label, children: g.links.map((l) => (_jsx(SidebarItem, { icon: l.icon, active: l.active, onPress: then(l.onPress), children: l.label }, l.id))) }, g.id))), children, _jsx(SidebarSection, { label: label ?? t('Runs'), children: !host.person ? (_jsx(Note, { children: t('Sign in to see your runs.') })) : sessions.value.length ? (sessions.value.map((s) => (_jsx(SidebarItem, { icon: _jsx(StatusDot, { status:
|
|
55
|
+
return (_jsxs(_Fragment, { children: [nav(host, host.go, t).map((g) => (_jsx(SidebarSection, { label: g.label, children: g.links.map((l) => (_jsx(SidebarItem, { icon: l.icon, active: l.active, onPress: then(l.onPress), children: l.label }, l.id))) }, g.id))), children, _jsx(SidebarSection, { label: label ?? t('Runs'), children: !host.person ? (_jsx(Note, { children: t('Sign in to see your runs.') })) : sessions.value.length ? (sessions.value.map((s) => (_jsx(SidebarItem, { icon: _jsx(StatusDot, { status: dot(s) }), active: r.kind === 'run' && r.id === s.id, onPress: then(() => host.go(s.id)), children: s.title || t('Untitled run') }, s.id)))) : (_jsx(Note, { children: sessions.error
|
|
50
56
|
? t(sessions.error.message)
|
|
51
57
|
: sessions.loading
|
|
52
58
|
? t('Reading…')
|
package/lib/talk.d.ts
ADDED
package/lib/talk.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A conversation in Dev (api/talk.ts): what the person said and what the agent
|
|
4
|
+
* answered, at one address however many turns it takes — the way Chat reads.
|
|
5
|
+
*
|
|
6
|
+
* Every send continues the same session. While a turn works, what is said is that
|
|
7
|
+
* turn's next input; once it has answered, the next turn. A build is never steered
|
|
8
|
+
* from here — the words are the conversation's, and a build is steered from its
|
|
9
|
+
* own page, which its card opens. The agent decides what a turn needs: an answer,
|
|
10
|
+
* a sandbox (leased on first use and kept for the conversation), or a coding run,
|
|
11
|
+
* whose outcome is said here when it ends. A question a turn asks — in Manual,
|
|
12
|
+
* whether a build may start — is answered on its card. The line under the
|
|
13
|
+
* transcript is what the turn is doing now, from its own progress. The mode pill
|
|
14
|
+
* is the conversation's: Plan, Auto or Manual, kept from the turn it is sent with.
|
|
15
|
+
*/
|
|
16
|
+
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
17
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
18
|
+
import { Steer } from '@hanzo/ui/agents';
|
|
19
|
+
import { Composer, measure } from '@hanzo/ui/chat';
|
|
20
|
+
import { useLimits } from '@hanzo/ui/product/useLimits';
|
|
21
|
+
import { useMemo, useState } from 'react';
|
|
22
|
+
import { DEV_MODES, MODES } from './gear.js';
|
|
23
|
+
import { Refusal } from './api/call.js';
|
|
24
|
+
import { limits as readLimits } from './api/models.js';
|
|
25
|
+
import { log, message, stop } from './api/sessions.js';
|
|
26
|
+
import { answer, now, say as talk } from './api/talk.js';
|
|
27
|
+
import { cards, merge } from './api/turn.js';
|
|
28
|
+
import { verdict } from './api/verdict.js';
|
|
29
|
+
import { useRead } from './data.js';
|
|
30
|
+
import { useHost, useTarget } from './host.js';
|
|
31
|
+
import { level, useMind } from './mind.js';
|
|
32
|
+
import { pane } from './pane.js';
|
|
33
|
+
import { speaker } from './reply.js';
|
|
34
|
+
import { carrying, compose, pick } from './tools.js';
|
|
35
|
+
import { Transcript } from './transcript.js';
|
|
36
|
+
export function Talk({ id, state }) {
|
|
37
|
+
const { t: say } = useI18n();
|
|
38
|
+
const host = useHost();
|
|
39
|
+
const t = useTarget();
|
|
40
|
+
const signed = Boolean(host.person);
|
|
41
|
+
const { detail, record, status, refused } = state;
|
|
42
|
+
// The whole conversation from its first word: the detail carries the latest
|
|
43
|
+
// fifty events, and a turn that builds says many. Live frames are added to it.
|
|
44
|
+
const whole = useRead(signed ? () => log(t, id) : null, [], [t, id, signed]);
|
|
45
|
+
const events = useMemo(() => merge(whole.value, state.events), [whole.value, state.events]);
|
|
46
|
+
const [draft, setDraft] = useState('');
|
|
47
|
+
const [files, setFiles] = useState([]);
|
|
48
|
+
const [note, setNote] = useState('');
|
|
49
|
+
const [busy, setBusy] = useState(false);
|
|
50
|
+
const { limits } = useLimits(signed ? (signal) => readLimits(t, signal) : null, t);
|
|
51
|
+
const mind = useMind(t, limits?.plan, host.topUp);
|
|
52
|
+
const listen = useMemo(() => speaker(t), [t]);
|
|
53
|
+
const shown = useMemo(() => cards(events, '', say), [events, say]);
|
|
54
|
+
const working = status === 'running';
|
|
55
|
+
const doing = useMemo(() => now(events), [events]);
|
|
56
|
+
// The conversation's mode, as it keeps it until the person picks another: what
|
|
57
|
+
// they pick is sent with what they say next, and kept for every turn after.
|
|
58
|
+
const [picked, setPicked] = useState(null);
|
|
59
|
+
const mode = picked ?? (DEV_MODES.includes(record?.mode) ? record?.mode : 'auto');
|
|
60
|
+
/** One act at a time; what it answers, or the reason it was refused, is the note. */
|
|
61
|
+
const act = async (work) => {
|
|
62
|
+
if (busy)
|
|
63
|
+
return;
|
|
64
|
+
setBusy(true);
|
|
65
|
+
setNote('');
|
|
66
|
+
try {
|
|
67
|
+
setNote(await work());
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
setNote(e.message);
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
setBusy(false);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const send = () => {
|
|
77
|
+
const words = compose(draft.trim(), files);
|
|
78
|
+
if (!words)
|
|
79
|
+
return;
|
|
80
|
+
const next = () => talk(t, { session: id, input: words, model: mind.model, effort: level(mind.effort), ...(picked ? { mode: picked } : {}) });
|
|
81
|
+
void act(async () => {
|
|
82
|
+
if (!working)
|
|
83
|
+
await next();
|
|
84
|
+
else
|
|
85
|
+
try {
|
|
86
|
+
await message(t, id, words);
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
// The turn answered as the words were sent: they are the next turn.
|
|
90
|
+
if (!(e instanceof Refusal) || e.status !== 409)
|
|
91
|
+
throw e;
|
|
92
|
+
await next();
|
|
93
|
+
}
|
|
94
|
+
setDraft('');
|
|
95
|
+
setFiles([]);
|
|
96
|
+
return '';
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const empty = (_jsx(SizableText, { size: "$2", color: "$soft", children: !signed ? say('Sign in to follow this conversation.') : detail.error ? say(detail.error.message) : detail.loading ? say('Reading this conversation…') : say('Thinking…') }));
|
|
100
|
+
return (_jsxs(YStack, { "data-slot": "talk", ...pane, display: "grid", gridTemplateRows: "auto minmax(0, 1fr) auto", width: "100%", height: "100%", minH: 0, minW: 0, children: [_jsx(XStack, { px: "$4", pt: "$3", pb: "$2", items: "center", minH: 44, children: _jsx(SizableText, { size: "$4", color: "$ink", numberOfLines: 1, children: record?.title || say('New conversation') }) }), _jsx(Transcript, { cards: shown, live: working, empty: empty, listen: signed ? listen : undefined, onVerdict: (v) => verdict(t, id, '', v), onRun: (session) => host.go(session), onAnswer: (question, label) => void act(async () => (await answer(t, id, question, label, true), '')) }), _jsxs(YStack, { pb: "$3", pt: "$2", gap: "$2", children: [_jsxs(YStack, { ...measure, gap: "$2", children: [note || (signed && refused) ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note || refused })) : null, working ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$2", color: "$soft", flex: 1, minW: 0, numberOfLines: 1, role: "status", children: doing || say('Thinking…') }), _jsx(Steer, { onCommand: (c) => {
|
|
101
|
+
if (c === 'stop')
|
|
102
|
+
void act(async () => (await stop(t, id), say('Stopped')));
|
|
103
|
+
}, withhold: ['pause', 'resume', ...(busy ? ['stop'] : [])] })] })) : null] }), _jsx(Composer, { column: true, value: draft, onChange: setDraft, onSend: send, ready: Boolean(draft.trim()), disabled: !signed || busy || !record, placeholder: !signed ? say('Sign in to reply') : working ? say('Add to what it is doing') : say('Reply'), label: say('Reply to this conversation'), plus: { upload: () => pick(files, setFiles, setNote, say) }, carried: carrying(files, setFiles), mind: signed && !working ? mind : null, mode: signed && !working ? { value: mode, set: (m) => setPicked(m), items: MODES.filter((m) => DEV_MODES.includes(m.id)) } : null })] })] }));
|
|
104
|
+
}
|
package/lib/transcript.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface QueuedMessage {
|
|
|
7
7
|
text: string;
|
|
8
8
|
}
|
|
9
9
|
export type TranscriptView = 'normal' | 'thinking' | 'verbose';
|
|
10
|
-
export declare function Transcript({ cards, live, empty, header, onApprove, approving, onVerdict, onOpen, onDiff, listen, end, view, queued, onSendQueued, }: {
|
|
10
|
+
export declare function Transcript({ cards, live, empty, header, onApprove, approving, onVerdict, onOpen, onDiff, listen, end, view, queued, onSendQueued, onRun, onAnswer, }: {
|
|
11
11
|
cards: Card[];
|
|
12
12
|
/** The run is still working: a card still running shows it; otherwise it was cut off. */
|
|
13
13
|
live: boolean;
|
|
@@ -32,4 +32,8 @@ export declare function Transcript({ cards, live, empty, header, onApprove, appr
|
|
|
32
32
|
queued?: QueuedMessage[];
|
|
33
33
|
/** Send a queued message immediately. */
|
|
34
34
|
onSendQueued?: (id: string) => void;
|
|
35
|
+
/** Open a coding run a conversation started, on its own page. */
|
|
36
|
+
onRun?: (session: string) => void;
|
|
37
|
+
/** Answer a question the run asked with one of its options. Absent, a question has no buttons. */
|
|
38
|
+
onAnswer?: (question: string, label: string) => void;
|
|
35
39
|
}): import("react").JSX.Element;
|
package/lib/transcript.js
CHANGED
|
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
* A run's transcript, drawn by what each part is (turn.ts `cards`): what the
|
|
4
4
|
* agent said as markdown, its reasoning folded, each command it ran as a card
|
|
5
5
|
* that opens onto its output, the files it changed, its plan as a checklist, the
|
|
6
|
-
* run's own steps,
|
|
6
|
+
* run's own steps, a plan run's plan with the button that builds it, and in a
|
|
7
|
+
* conversation the coding runs its turns started, each opening on its own page.
|
|
7
8
|
* What the agent said, and its plan, can be copied and judged, as a reply on
|
|
8
9
|
* claude.ai can: a thumb pressed again takes the verdict back.
|
|
9
10
|
*
|
|
@@ -22,6 +23,7 @@ import { Button } from '@hanzo/ui';
|
|
|
22
23
|
import { Feedback } from '@hanzo/ui/agents';
|
|
23
24
|
import { Code, GAP, MEASURE, Message, Step, Thread } from '@hanzo/ui/chat';
|
|
24
25
|
import { useState } from 'react';
|
|
26
|
+
import { counted, edited, explored } from './api/cli.js';
|
|
25
27
|
import { Prose } from './prose.js';
|
|
26
28
|
import { artifacts, lead, Reply } from './reply.js';
|
|
27
29
|
/** A card's output, its tail: what a command said last is why it stopped. */
|
|
@@ -36,7 +38,7 @@ function UserSaid({ text }) {
|
|
|
36
38
|
const long = text.length > 180 || text.includes('\n');
|
|
37
39
|
return (_jsxs(YStack, { gap: "$1", children: [_jsx(YStack, { ...(long && !open ? { maxHeight: 72, overflow: 'hidden' } : null), children: _jsx(Prose, { text: text }) }), long ? (_jsx(XStack, { render: "button", "aria-expanded": open, onPress: () => setOpen((v) => !v), self: "flex-start", px: "$2", py: "$1", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsx(SizableText, { size: "$1", color: "$soft", children: open ? t('Show less') : t('Show more') }) })) : null] }));
|
|
38
40
|
}
|
|
39
|
-
export function Transcript({ cards, live, empty, header, onApprove, approving = false, onVerdict, onOpen, onDiff, listen, end, view = 'normal', queued = [], onSendQueued, }) {
|
|
41
|
+
export function Transcript({ cards, live, empty, header, onApprove, approving = false, onVerdict, onOpen, onDiff, listen, end, view = 'normal', queued = [], onSendQueued, onRun, onAnswer, }) {
|
|
40
42
|
const { t } = useI18n();
|
|
41
43
|
// A card the run never finished is cut off once the run has ended, not still going.
|
|
42
44
|
const state = (ran) => (ran === 'running' && !live ? 'cancelled' : ran);
|
|
@@ -58,13 +60,22 @@ export function Transcript({ cards, live, empty, header, onApprove, approving =
|
|
|
58
60
|
case 'todo':
|
|
59
61
|
return (_jsx(YStack, { gap: "$1", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "aria-label": t('Plan checklist'), children: c.items.map((x, i) => (_jsxs(XStack, { gap: "$2", items: "flex-start", children: [_jsx(SizableText, { size: "$2", color: x.done ? '$ink' : '$soft', children: x.done ? '✓' : '○' }), _jsx(SizableText, { flex: 1, size: "$2", color: x.done ? '$soft' : '$ink', children: x.text })] }, i))) }, c.key));
|
|
60
62
|
case 'shell':
|
|
61
|
-
|
|
63
|
+
// The CLI's words: Ran (Running while it works), the command as the shell got it, its output under it.
|
|
64
|
+
return (_jsx(Step, { name: state(c.ran) === 'running' ? t('Running') : t('Ran'), detail: c.command, status: state(c.ran), defaultOpen: expandVerbose, "aria-label": t('Command {command}', { command: c.command }), children: _jsx(Code, { language: "shell", value: c.output || t('(no output)'), children: c.output ? tail(c.output.replace(/\n+$/, '')) : t('(no output)') }) }, `${c.key}:${view}`));
|
|
65
|
+
case 'explore':
|
|
66
|
+
// The CLI's Explored block: one line an action, consecutive reads on one line (cli.ts explored).
|
|
67
|
+
return (_jsxs(YStack, { gap: "$1", "aria-label": state(c.ran) === 'running' ? t('Exploring') : t('Explored'), children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "600", children: state(c.ran) === 'running' ? t('Exploring') : t('Explored') }), explored(c.calls).map((l, i) => (_jsxs(XStack, { gap: "$2", pl: "$3", children: [_jsx(SizableText, { size: "$2", color: "$soft", shrink: 0, children: t(l.title) }), _jsx(SizableText, { size: "$2", color: "$ink", style: { ...mono, overflowWrap: 'anywhere' }, children: l.text })] }, i)))] }, c.key));
|
|
62
68
|
case 'edit':
|
|
63
|
-
|
|
69
|
+
// The CLI's patch header: Added / Deleted / Edited a file, or Edited N files, with the lines added and removed.
|
|
70
|
+
return (_jsx(Step, { name: !c.files.length ? t('Edited files') : c.files.length > 1 ? `Edited ${c.files.length} files` : edited(c.files).split(' ')[0], detail: !c.files.length ? '' : c.files.length > 1 ? edited(c.files).split(' ').slice(3).join(' ') : edited(c.files).split(' ').slice(1).join(' '), status: state(c.ran), defaultOpen: expandVerbose, "aria-label": c.files.length ? edited(c.files) : t('Edited files'), children: _jsxs(YStack, { gap: "$2", items: "flex-start", children: [_jsx(SizableText, { size: "$1", color: "$soft", style: { whiteSpace: 'pre-wrap' }, children: c.files.length ? c.files.map((f) => `${f.path} ${counted(f)}`.trimEnd()).join('\n') : t('The agent named no files.') }), onDiff ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onDiff, children: t('Open the diff') })) : null] }) }, `${c.key}:${view}`));
|
|
64
71
|
case 'step':
|
|
65
72
|
return (_jsx(Step, { name: t(c.name), detail: c.detail, status: state(c.ran), defaultOpen: c.name === 'Error' || expandVerbose, "aria-label": `${t(c.name)} ${c.detail}`.trim(), children: c.name === 'Error' ? (_jsx(SizableText, { size: "$2", color: "$ink", style: { ...mono, whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: c.output })) : c.output.trim() ? (_jsx(Code, { language: "output", value: c.output, children: tail(c.output.replace(/\n+$/, '')) })) : undefined }, `${c.key}:${view}`));
|
|
66
73
|
case 'note':
|
|
67
74
|
return (_jsx(SizableText, { size: "$1", color: "$soft", role: "note", children: t(c.text) }, c.key));
|
|
75
|
+
case 'run':
|
|
76
|
+
return (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "aria-label": t('Coding run'), children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", numberOfLines: 1, children: t('Coding run') }), onRun ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => onRun(c.session), children: t('Open the run') })) : null] }, c.key));
|
|
77
|
+
case 'ask':
|
|
78
|
+
return (_jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "aria-label": t('Question'), children: [_jsx(Prose, { text: c.text }), c.answer ? (_jsx(SizableText, { size: "$2", color: "$soft", children: `✓ ${c.answer}` })) : (_jsx(XStack, { gap: "$2", flexWrap: "wrap", children: c.options.map((label) => (_jsx(Button, { size: "sm", variant: "outline", disabled: !onAnswer, onPress: () => onAnswer?.(c.question, label), children: label }, label))) }))] }, c.key));
|
|
68
79
|
case 'plan':
|
|
69
80
|
return (_jsxs(YStack, { gap: "$3", p: "$4", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", "aria-label": t('Plan'), children: [_jsx(SizableText, { size: "$2", color: "$soft", children: t('Plan') }), _jsx(Prose, { text: c.text }), _jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Reply, { text: c.text, listen: listen }), onApprove ? (_jsx(Button, { size: "sm", disabled: approving, onPress: () => onApprove(c.text), children: approving ? t('Starting the build…') : t('Approve and build') })) : null, _jsx(Judge, { onVerdict: onVerdict })] })] }, c.key));
|
|
70
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.123",
|
|
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.",
|