@hanzo/build 0.2.123 → 0.2.124
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/coding.d.ts +7 -1
- package/lib/api/coding.js +33 -6
- package/lib/api/sessions.d.ts +13 -4
- package/lib/api/sessions.js +58 -20
- package/lib/api/talk.d.ts +4 -0
- package/lib/api/talk.js +11 -1
- package/lib/data.js +18 -3
- package/lib/landing.js +10 -14
- package/lib/run.js +2 -2
- package/package.json +1 -1
package/lib/api/coding.d.ts
CHANGED
|
@@ -26,6 +26,12 @@ export interface Ask {
|
|
|
26
26
|
effort?: string;
|
|
27
27
|
/** The number of the issue on `repo` this run resolves: its pull request says `Closes #<n>`. */
|
|
28
28
|
issue?: number;
|
|
29
|
+
/** Client-generated idempotency key so retries never duplicate a run. */
|
|
30
|
+
requestId?: string;
|
|
31
|
+
/** Out-of-band instructions (skills, memories) kept separate from `prompt`. */
|
|
32
|
+
instructions?: string;
|
|
33
|
+
/** Explicit alias for `instructions` passed via `-c developer_instructions=...`. */
|
|
34
|
+
developerInstructions?: string;
|
|
29
35
|
}
|
|
30
36
|
export interface Run {
|
|
31
37
|
session: string;
|
|
@@ -48,7 +54,7 @@ export declare function start(t: Target, ask: Ask): Promise<Run>;
|
|
|
48
54
|
* with the words; the follow-up's session arrives on this run's own stream as
|
|
49
55
|
* its `followed` status (turn.ts `followed`).
|
|
50
56
|
*/
|
|
51
|
-
export declare function steer(t: Target, session: string, text: string): Promise<void>;
|
|
57
|
+
export declare function steer(t: Target, session: string, text: string, requestId?: string): Promise<void>;
|
|
52
58
|
/** A run a follow-up continues, as its record states it. */
|
|
53
59
|
export interface Earlier {
|
|
54
60
|
id: string;
|
package/lib/api/coding.js
CHANGED
|
@@ -40,6 +40,14 @@ export const unhonoured = (mode, target, t = english) => !target?.trim()
|
|
|
40
40
|
: mode === 'setup'
|
|
41
41
|
? t('A setup runs in the Hanzo sandbox: a machine clones and pushes with its own credential. Choose Cloud, or switch to Build.')
|
|
42
42
|
: '';
|
|
43
|
+
let reqSeq = 0;
|
|
44
|
+
function newRequestId() {
|
|
45
|
+
const uuid = globalThis.crypto?.randomUUID?.();
|
|
46
|
+
if (uuid)
|
|
47
|
+
return uuid;
|
|
48
|
+
reqSeq += 1;
|
|
49
|
+
return `req_${Date.now().toString(36)}_${reqSeq.toString(36)}`;
|
|
50
|
+
}
|
|
43
51
|
/**
|
|
44
52
|
* The request body: only what was asked, with no empty strings sent as values.
|
|
45
53
|
* A run in the sandbox asks for one with a desktop, so its Desktop tab has a
|
|
@@ -47,7 +55,19 @@ export const unhonoured = (mode, target, t = english) => !target?.trim()
|
|
|
47
55
|
*/
|
|
48
56
|
export function body(ask) {
|
|
49
57
|
const out = { prompt: ask.prompt.trim() };
|
|
50
|
-
for (const k of [
|
|
58
|
+
for (const k of [
|
|
59
|
+
'repo',
|
|
60
|
+
'base',
|
|
61
|
+
'targetId',
|
|
62
|
+
'project',
|
|
63
|
+
'after',
|
|
64
|
+
'mode',
|
|
65
|
+
'model',
|
|
66
|
+
'effort',
|
|
67
|
+
'requestId',
|
|
68
|
+
'instructions',
|
|
69
|
+
'developerInstructions',
|
|
70
|
+
]) {
|
|
51
71
|
const v = ask[k]?.trim();
|
|
52
72
|
if (v)
|
|
53
73
|
out[k] = v;
|
|
@@ -64,7 +84,7 @@ export async function start(t, ask) {
|
|
|
64
84
|
const why = unhonoured(ask.mode, ask.targetId);
|
|
65
85
|
if (why)
|
|
66
86
|
throw new Refusal(400, why);
|
|
67
|
-
const r = await call(t, 'POST', '/v1/agent/coding', body(ask));
|
|
87
|
+
const r = await call(t, 'POST', '/v1/agent/coding', body({ ...ask, requestId: ask.requestId?.trim() || newRequestId() }));
|
|
68
88
|
const s = (k) => (typeof r?.[k] === 'string' ? r[k] : '');
|
|
69
89
|
if (!s('sessionId'))
|
|
70
90
|
throw new Refusal(502, phrase('The run was admitted but named no session'));
|
|
@@ -83,11 +103,14 @@ export async function start(t, ask) {
|
|
|
83
103
|
* with the words; the follow-up's session arrives on this run's own stream as
|
|
84
104
|
* its `followed` status (turn.ts `followed`).
|
|
85
105
|
*/
|
|
86
|
-
export async function steer(t, session, text) {
|
|
106
|
+
export async function steer(t, session, text, requestId) {
|
|
87
107
|
const words = text.trim();
|
|
88
108
|
if (!words)
|
|
89
109
|
throw new Refusal(400, phrase('Say something to the run'));
|
|
90
|
-
await call(t, 'POST', `/v1/agent/coding/${seg(session)}/steer`, {
|
|
110
|
+
await call(t, 'POST', `/v1/agent/coding/${seg(session)}/steer`, {
|
|
111
|
+
text: words,
|
|
112
|
+
requestId: requestId?.trim() || newRequestId(),
|
|
113
|
+
});
|
|
91
114
|
}
|
|
92
115
|
/**
|
|
93
116
|
* The earlier run's ask, without the codebase its title leads with (`universe:
|
|
@@ -127,10 +150,14 @@ const modeOf = (m) => (m === 'plan' || m === 'setup' ? m : 'build');
|
|
|
127
150
|
* when it carries a paused run on (apps/coding steer.go followUp).
|
|
128
151
|
*/
|
|
129
152
|
export function followUp(e, said) {
|
|
153
|
+
const next = from(e);
|
|
130
154
|
const head = headline(e.title, e.repo);
|
|
131
155
|
const words = said.trim();
|
|
132
156
|
let prompt;
|
|
133
|
-
if (
|
|
157
|
+
if (next.after) {
|
|
158
|
+
prompt = words || 'Continue where the earlier run left off.';
|
|
159
|
+
}
|
|
160
|
+
else if (words) {
|
|
134
161
|
const was = head ? `This follows an earlier run on this codebase: “${head}”.` : 'This follows an earlier run on this codebase.';
|
|
135
162
|
prompt = `${words}\n\n${was}${e.pushed ? ' Its work so far is on this branch; build on it.' : ''}`;
|
|
136
163
|
}
|
|
@@ -138,7 +165,7 @@ export function followUp(e, said) {
|
|
|
138
165
|
const kept = e.pushed ? 'An earlier run already worked on this; its work so far is on this branch. Build on it. ' : '';
|
|
139
166
|
prompt = `${head}\n\n${kept}Continue where the earlier run left off.`.trim();
|
|
140
167
|
}
|
|
141
|
-
return { ...
|
|
168
|
+
return { ...next, prompt, mode: modeOf(e.mode) };
|
|
142
169
|
}
|
|
143
170
|
/** A build of what a plan run answered: its ask as the title, and the plan to carry out. */
|
|
144
171
|
export function approve(e, plan) {
|
package/lib/api/sessions.d.ts
CHANGED
|
@@ -75,7 +75,11 @@ export interface Page {
|
|
|
75
75
|
}
|
|
76
76
|
export declare function page(t: Target, q?: ListQuery): Promise<Page>;
|
|
77
77
|
export declare function list(t: Target, q?: ListQuery): Promise<Session[]>;
|
|
78
|
-
export
|
|
78
|
+
export interface GetOptions {
|
|
79
|
+
limit?: number;
|
|
80
|
+
after?: number;
|
|
81
|
+
}
|
|
82
|
+
export declare function get(t: Target, id: string, opts?: GetOptions): Promise<Detail>;
|
|
79
83
|
/**
|
|
80
84
|
* A session's whole log, oldest first, read a page at a time — what a conversation
|
|
81
85
|
* draws from its first word, where the detail carries only the latest fifty.
|
|
@@ -101,8 +105,13 @@ export interface Watch {
|
|
|
101
105
|
/** Each (re)connect. The first is 0; a later one means frames may have been missed. */
|
|
102
106
|
open?: (attempt: number) => void;
|
|
103
107
|
}
|
|
108
|
+
export interface WatchOptions {
|
|
109
|
+
/** Resume replaying missed events strictly after this sequence number. */
|
|
110
|
+
after?: number;
|
|
111
|
+
}
|
|
104
112
|
/**
|
|
105
|
-
* Follow one run's tree until `signal` aborts. Reconnects with a capped backoff
|
|
106
|
-
*
|
|
113
|
+
* Follow one run's tree until `signal` aborts. Reconnects with a capped backoff
|
|
114
|
+
* and replays missed frames via `?after=<lastSeq>` + `Last-Event-ID`; a refusal
|
|
115
|
+
* (401/403) ends it, because retrying a no is not recovery.
|
|
107
116
|
*/
|
|
108
|
-
export declare function watch(t: Target, root: string, on: Watch, signal: AbortSignal): Promise<void>;
|
|
117
|
+
export declare function watch(t: Target, root: string, on: Watch, signal: AbortSignal, opts?: WatchOptions): Promise<void>;
|
package/lib/api/sessions.js
CHANGED
|
@@ -89,21 +89,45 @@ export async function page(t, q = {}) {
|
|
|
89
89
|
export async function list(t, q = {}) {
|
|
90
90
|
return (await page(t, q)).sessions;
|
|
91
91
|
}
|
|
92
|
-
export async function get(t, id) {
|
|
93
|
-
const raw = obj(await call(t, 'GET', `/v1/agent/sessions/${seg(id)}`));
|
|
92
|
+
export async function get(t, id, opts) {
|
|
93
|
+
const raw = obj(await call(t, 'GET', `/v1/agent/sessions/${seg(id)}${query({ limit: opts?.limit, after: opts?.after })}`));
|
|
94
94
|
let recent = (Array.isArray(raw.recentEvents) ? raw.recentEvents : []).map(event);
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
// When `limit` is explicitly requested (e.g. Run's initial 500-event load) and a
|
|
96
|
+
// long coding run still exceeds one page (`recent[0].seq > 1`), page forward from
|
|
97
|
+
// seq 0 so middle history is never dropped. Without `opts`, keep the lightweight
|
|
98
|
+
// 2-event head fetch so short summary callers stay single-hop.
|
|
99
|
+
if (recent.length > 0 && recent[0].seq > 1 && opts?.after === undefined) {
|
|
100
|
+
const tailFloor = recent[0].seq;
|
|
101
|
+
if (opts?.limit && opts.limit > 50) {
|
|
102
|
+
try {
|
|
103
|
+
const earlier = [];
|
|
104
|
+
let cursor = 0;
|
|
105
|
+
for (let page = 0; page < 6 && cursor < tailFloor - 1; page++) {
|
|
106
|
+
const chunk = obj(await call(t, 'GET', `/v1/agent/sessions/${seg(id)}/events${query({ after: cursor || undefined, limit: Math.min(1000, opts.limit) })}`));
|
|
107
|
+
const rows = (Array.isArray(chunk.events) ? chunk.events : []).map(event);
|
|
108
|
+
earlier.push(...rows.filter((e) => e.seq > 0 && e.seq < tailFloor));
|
|
109
|
+
const next = num(chunk.next);
|
|
110
|
+
if (next <= cursor || next >= tailFloor - 1)
|
|
111
|
+
break;
|
|
112
|
+
cursor = next;
|
|
113
|
+
}
|
|
114
|
+
const have = new Set(recent.map((e) => e.seq));
|
|
115
|
+
recent = [...earlier.filter((e) => !have.has(e.seq)), ...recent].sort((a, b) => a.seq - b.seq);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
/* keep the tail */
|
|
119
|
+
}
|
|
104
120
|
}
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
else {
|
|
122
|
+
try {
|
|
123
|
+
const head = obj(await call(t, 'GET', `/v1/agent/sessions/${seg(id)}/events?limit=2`));
|
|
124
|
+
const first = (Array.isArray(head.events) ? head.events : []).map(event);
|
|
125
|
+
const have = new Set(recent.map((e) => e.seq));
|
|
126
|
+
recent = [...first.filter((e) => e.seq > 0 && !have.has(e.seq)), ...recent].sort((a, b) => a.seq - b.seq);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
/* keep the tail */
|
|
130
|
+
}
|
|
107
131
|
}
|
|
108
132
|
}
|
|
109
133
|
return {
|
|
@@ -162,16 +186,21 @@ export async function publish(t, id, on) {
|
|
|
162
186
|
/** Where anyone can read a published run's story: the public build route, by org and project. '' without both. */
|
|
163
187
|
export const story = (t, org, project) => org && project ? `${t.api}/v1/agent/builds/${seg(org)}/${seg(project)}` : '';
|
|
164
188
|
/**
|
|
165
|
-
* Follow one run's tree until `signal` aborts. Reconnects with a capped backoff
|
|
166
|
-
*
|
|
189
|
+
* Follow one run's tree until `signal` aborts. Reconnects with a capped backoff
|
|
190
|
+
* and replays missed frames via `?after=<lastSeq>` + `Last-Event-ID`; a refusal
|
|
191
|
+
* (401/403) ends it, because retrying a no is not recovery.
|
|
167
192
|
*/
|
|
168
|
-
export async function watch(t, root, on, signal) {
|
|
193
|
+
export async function watch(t, root, on, signal, opts) {
|
|
169
194
|
let opened = 0;
|
|
170
195
|
let fails = 0;
|
|
196
|
+
let lastSeq = opts?.after && Number.isFinite(opts.after) && opts.after > 0 ? Math.floor(opts.after) : 0;
|
|
171
197
|
while (!signal.aborted) {
|
|
172
198
|
try {
|
|
173
|
-
const
|
|
174
|
-
|
|
199
|
+
const extra = { Accept: 'text/event-stream' };
|
|
200
|
+
if (lastSeq > 0)
|
|
201
|
+
extra['Last-Event-ID'] = String(lastSeq);
|
|
202
|
+
const res = await fetch(`${t.api}/v1/agent/sessions/stream${query({ root, after: lastSeq > 0 ? lastSeq : undefined })}`, {
|
|
203
|
+
headers: headers(t, extra),
|
|
175
204
|
cache: 'no-store',
|
|
176
205
|
signal,
|
|
177
206
|
});
|
|
@@ -191,8 +220,17 @@ export async function watch(t, root, on, signal) {
|
|
|
191
220
|
}
|
|
192
221
|
if (f.event === 'session')
|
|
193
222
|
on.session?.(session(obj(data).session));
|
|
194
|
-
else if (f.event === 'event')
|
|
195
|
-
|
|
223
|
+
else if (f.event === 'event') {
|
|
224
|
+
const ev = event(obj(data).event);
|
|
225
|
+
if (!root || !ev.sessionId || ev.sessionId === root) {
|
|
226
|
+
const fid = Number(f.id);
|
|
227
|
+
if (Number.isInteger(fid) && fid > lastSeq)
|
|
228
|
+
lastSeq = fid;
|
|
229
|
+
if (ev.seq > lastSeq)
|
|
230
|
+
lastSeq = ev.seq;
|
|
231
|
+
}
|
|
232
|
+
on.event?.(ev);
|
|
233
|
+
}
|
|
196
234
|
}, signal);
|
|
197
235
|
}
|
|
198
236
|
catch (e) {
|
package/lib/api/talk.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export interface Say {
|
|
|
27
27
|
effort?: string;
|
|
28
28
|
/** The issue on `repo` a coding run resolves. */
|
|
29
29
|
issue?: number;
|
|
30
|
+
/** Out-of-band instructions (skills, memories) kept separate from `input`. */
|
|
31
|
+
instructions?: string;
|
|
32
|
+
/** Explicit alias for `instructions` forwarded to turns and coding runs. */
|
|
33
|
+
developerInstructions?: string;
|
|
30
34
|
}
|
|
31
35
|
export interface Said {
|
|
32
36
|
/** The conversation: the same id on every turn. */
|
package/lib/api/talk.js
CHANGED
|
@@ -34,7 +34,17 @@ export const talks = (s) => s?.channel === TALK && !s.parent;
|
|
|
34
34
|
/** The request body: only what was said, with no empty values sent. */
|
|
35
35
|
export function body(s) {
|
|
36
36
|
const out = { input: s.input.trim() };
|
|
37
|
-
for (const k of [
|
|
37
|
+
for (const k of [
|
|
38
|
+
'session',
|
|
39
|
+
'model',
|
|
40
|
+
'effort',
|
|
41
|
+
'repo',
|
|
42
|
+
'base',
|
|
43
|
+
'target',
|
|
44
|
+
'mode',
|
|
45
|
+
'instructions',
|
|
46
|
+
'developerInstructions',
|
|
47
|
+
]) {
|
|
38
48
|
const v = s[k]?.trim();
|
|
39
49
|
if (v)
|
|
40
50
|
out[k] = v;
|
package/lib/data.js
CHANGED
|
@@ -223,12 +223,24 @@ export function useKept(key, initial) {
|
|
|
223
223
|
* the record. `id` null reads nothing.
|
|
224
224
|
*/
|
|
225
225
|
export function useRun(t, id) {
|
|
226
|
-
const detail = useRead(id ? () => get(t, id) : null, null, [t, id]);
|
|
226
|
+
const detail = useRead(id ? () => get(t, id, { limit: 500 }) : null, null, [t, id]);
|
|
227
227
|
const [live, setLive] = useState([]);
|
|
228
228
|
const [pushed, setPushed] = useState(null);
|
|
229
229
|
const [refused, setRefused] = useState('');
|
|
230
230
|
const reload = useRef(detail.reload);
|
|
231
231
|
reload.current = detail.reload;
|
|
232
|
+
const seenId = useRef(null);
|
|
233
|
+
const highestSeq = useRef(0);
|
|
234
|
+
if (seenId.current !== id) {
|
|
235
|
+
seenId.current = id;
|
|
236
|
+
highestSeq.current = 0;
|
|
237
|
+
}
|
|
238
|
+
if (detail.value && detail.value.id === id) {
|
|
239
|
+
for (const e of detail.value.recent) {
|
|
240
|
+
if (e.sessionId === id && e.seq > highestSeq.current)
|
|
241
|
+
highestSeq.current = e.seq;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
232
244
|
// The stream is followed by the run's tree: a conversation's coding run is in the
|
|
233
245
|
// conversation's (talk.ts), and its frames carry that root.
|
|
234
246
|
const root = (detail.value?.id === id && detail.value.root) || id;
|
|
@@ -242,8 +254,11 @@ export function useRun(t, id) {
|
|
|
242
254
|
void watch(t, root, {
|
|
243
255
|
// A frame from a stream this run has already left is not this run's.
|
|
244
256
|
event: (e) => {
|
|
245
|
-
if (!ctl.signal.aborted && e.sessionId === id)
|
|
257
|
+
if (!ctl.signal.aborted && e.sessionId === id) {
|
|
258
|
+
if (e.seq > highestSeq.current)
|
|
259
|
+
highestSeq.current = e.seq;
|
|
246
260
|
setLive((prev) => [...prev, e]);
|
|
261
|
+
}
|
|
247
262
|
},
|
|
248
263
|
session: (s) => {
|
|
249
264
|
if (!ctl.signal.aborted && s.id === id)
|
|
@@ -255,7 +270,7 @@ export function useRun(t, id) {
|
|
|
255
270
|
if (n > 0 || root !== id)
|
|
256
271
|
reload.current();
|
|
257
272
|
},
|
|
258
|
-
}, ctl.signal).catch((e) => setRefused(e.message));
|
|
273
|
+
}, ctl.signal, { after: root === id ? highestSeq.current : 0 }).catch((e) => setRefused(e.message));
|
|
259
274
|
return () => ctl.abort();
|
|
260
275
|
}, [t, id, root]);
|
|
261
276
|
// The read and the frames describe THIS run or nothing: a read kept from the
|
package/lib/landing.js
CHANGED
|
@@ -22,7 +22,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
22
22
|
import { SizableText, useMedia, XStack, YStack } from '@hanzo/gui';
|
|
23
23
|
import { phrase } from '@hanzo/i18n';
|
|
24
24
|
import { useI18n } from '@hanzo/i18n/react';
|
|
25
|
-
import { CircleDot, Cloud, Code,
|
|
25
|
+
import { CircleDot, Cloud, Code, GitBranch, LayoutTemplate, Link2, Monitor, Play } from '@hanzogui/lucide-icons-2';
|
|
26
26
|
import { Button } from '@hanzo/ui';
|
|
27
27
|
import { Composer, MEASURE } from '@hanzo/ui/chat';
|
|
28
28
|
import { BranchSelect, ChipSelect, FooterLink, RepoSelect } from '@hanzo/ui/product';
|
|
@@ -112,13 +112,9 @@ export function Landing({ onStarted }) {
|
|
|
112
112
|
const [note, setNote] = useState('');
|
|
113
113
|
const [adding, setAdding] = useState(null);
|
|
114
114
|
const [offering, setOffering] = useState(false);
|
|
115
|
-
const [forgetful, setForgetful] = useState(false);
|
|
116
115
|
const [desk, setDesk] = useState(false);
|
|
117
116
|
const deck = useDeck('dev-new', { tabs: [{ id: 'tab-1', kind: PAGE, title: '' }], at: 'tab-1' });
|
|
118
117
|
useKey(() => setDesk((d) => !d));
|
|
119
|
-
const [browserTabs, setBrowserTabs] = useState(false);
|
|
120
|
-
const [webSearch, setWebSearch] = useState(false);
|
|
121
|
-
const [research, setResearch] = useState(false);
|
|
122
118
|
// Asking for a repository's address, for one the lists do not show.
|
|
123
119
|
const [giving, setGiving] = useState(false);
|
|
124
120
|
// The repository and branch lists are read again each time they open.
|
|
@@ -277,8 +273,12 @@ export function Landing({ onStarted }) {
|
|
|
277
273
|
// The first thing said opens a conversation (api/talk.ts) and starts nothing:
|
|
278
274
|
// the agent answers, and leases a sandbox or starts a coding run only when the
|
|
279
275
|
// ask needs one — on the repository, branch, machine and Plan chosen here.
|
|
276
|
+
// Skills, memories and plugin system prompts travel out-of-band as
|
|
277
|
+
// developerInstructions so the user prompt stays clean and cacheable.
|
|
278
|
+
const developerInstructions = [carry.text, prepped.system ?? ''].filter(Boolean).join('\n\n');
|
|
280
279
|
const sent = await say(target, {
|
|
281
|
-
input: compose(
|
|
280
|
+
input: compose(said.trim(), files),
|
|
281
|
+
...(developerInstructions ? { developerInstructions } : {}),
|
|
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,
|
|
@@ -431,24 +431,20 @@ export function Landing({ onStarted }) {
|
|
|
431
431
|
loading: places.loading,
|
|
432
432
|
error: places.error?.message ?? null,
|
|
433
433
|
};
|
|
434
|
-
return (_jsxs(XStack, { flex: 1, width: "100%", height: "100%", minW: 0, minH: 0, overflow: "hidden", children: [_jsxs(YStack, { flex: 1, minW: 0, minH: 0, height: "100%", overflow: "hidden", children: [_jsxs(XStack, { "data-slot": "conversation-head", shrink: 0, items: "center", justify: "space-between", gap: "$2", px: "$3", height: 36, "$max-md": { display: 'none' }, children: [_jsx(XStack, { items: "center", gap: "$2", minW: 0, flex: 1 }),
|
|
434
|
+
return (_jsxs(XStack, { flex: 1, width: "100%", height: "100%", minW: 0, minH: 0, overflow: "hidden", children: [_jsxs(YStack, { flex: 1, minW: 0, minH: 0, height: "100%", overflow: "hidden", children: [_jsxs(XStack, { "data-slot": "conversation-head", shrink: 0, items: "center", justify: "space-between", gap: "$2", px: "$3", height: 36, "$max-md": { display: 'none' }, children: [_jsx(XStack, { items: "center", gap: "$2", minW: 0, flex: 1 }), _jsx(XStack, { "data-slot": "conversation-controls", items: "center", gap: "$1", shrink: 0, children: wide ? _jsx(PanelToggle, { open: desk, onToggle: () => setDesk((d) => !d) }) : null })] }), _jsxs(YStack, { display: "grid", gridTemplateRows: wide ? '1fr auto auto 1fr' : 'minmax(0, 1fr) auto', items: "center", "$platform-web": { justifyItems: 'center' }, width: "100%", flex: 1, minH: 0, overflowX: "hidden", "data-slot": "new", children: [wide ? _jsx(YStack, {}) : null, _jsx(YStack, { display: "grid",
|
|
435
435
|
// One track, its question set at the track's foot, just above the composer: a
|
|
436
436
|
// second `auto` track left the question alone in the first, at the pane's top.
|
|
437
437
|
gridTemplateRows: "minmax(0, 1fr)", items: "flex-end", width: "100%", maxW: MEASURE, height: wide ? undefined : '100%', pb: wide ? '$5' : '$3', overflowY: "auto", children: _jsx(SizableText, { render: "h1", fontSize: "$7", lineHeight: "$7", fontWeight: "700", color: "$ink", style: { textAlign: 'center' }, children: t('Build what’s next.') }) }), _jsx(YStack, { width: "100%", maxW: MEASURE, gap: "$2", pb: 12, children: _jsxs(YStack, { gap: "$2", children: [env.value && (env.value.state === 'proposed' || unset(env.value)) && !place.id ? (_jsxs(XStack, { items: "center", justify: "space-between", gap: "$3", px: "$3", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, minW: 0, children: env.value.state === 'proposed'
|
|
438
438
|
? t('A proposed environment for {repo} is waiting for review.', { repo: codebase })
|
|
439
|
-
: t('{repo} has no environment yet, so every run starts it bare.', { repo: codebase }) }), env.value.state === 'proposed' && env.value.session ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => host.go(env.value.session), children: t('Review') })) : (_jsx(Button, { size: "sm", onPress: () => setOffering(true), children: t('Set up environment') }))] })) : null, note || unhonoured(mode, place.id, t) || mind.note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note || unhonoured(mode, place.id, t) || mind.note })) : null, _jsx(Composer, { column: true, value: draft, onChange: setDraft, onSend: () => void send(), busy: busy,
|
|
439
|
+
: t('{repo} has no environment yet, so every run starts it bare.', { repo: codebase }) }), env.value.state === 'proposed' && env.value.session ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => host.go(env.value.session), children: t('Review') })) : (_jsx(Button, { size: "sm", onPress: () => setOffering(true), children: t('Set up environment') }))] })) : null, note || unhonoured(mode, place.id, t) || mind.note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note || unhonoured(mode, place.id, t) || mind.note })) : null, _jsx(Composer, { column: true, value: draft, onChange: setDraft, onSend: () => void send(), busy: busy, placeholder: t('Ask, build, or run anything…'), label: t('Describe a task or ask a question'), plus: {
|
|
440
440
|
upload: () => pick(files, setFiles, setNote, t),
|
|
441
|
-
|
|
442
|
-
browserTabs: { on: browserTabs, set: setBrowserTabs },
|
|
443
|
-
webSearch: { on: webSearch, set: setWebSearch },
|
|
444
|
-
},
|
|
445
|
-
research: { on: research, set: setResearch },
|
|
441
|
+
research: { on: carry.gear.gear.research, set: (on) => carry.gear.set({ research: on }) },
|
|
446
442
|
skills: carry.skills,
|
|
447
443
|
design: carry.design,
|
|
448
444
|
plugins: carry.plugins,
|
|
449
445
|
devices,
|
|
450
446
|
memory: { on: carry.gear.gear.memory, set: (on) => carry.gear.set({ memory: on }) },
|
|
451
|
-
}, carried: [...carry.on, ...carrying(files, setFiles)], slash: carry.skills, at: carry.plugins, pills: pills, commands: commands, mind: mind, effort: pacing(mind), limits: limits, onUpgrade: () => host.go(path({ kind: 'screen', screen: 'plans' })), voice: voice, language: prefs.language ?? null, onLanguage: (id) => void savePrefs({ language: id }), talk: talk })] }) }), wide ? _jsx(YStack, {}) : null, _jsx(Publish, { source: adding, onClose: () => setAdding(null) }), _jsx(Address, { open: giving, onOpenChange: setGiving, title: t('Use a git URL'), says: t('Runs work on the GitHub repository at this address until you choose another. A private one needs GitHub connected.'), act: t('Use'), address: "", run: async (at) => give(at) }), carry.dialog, codebase ? (_jsx(SetupDialog, { repo: codebase, homes: homes, open: offering, onOpenChange: setOffering, onStart: setup, onRepo: choose, onSaved: () => {
|
|
447
|
+
}, carried: [...carry.on, ...carrying(files, setFiles)], slash: carry.skills, at: carry.plugins, pills: pills, commands: commands, mode: carry.mode, mind: mind, effort: pacing(mind), limits: limits, onUpgrade: () => host.go(path({ kind: 'screen', screen: 'plans' })), voice: voice, language: prefs.language ?? null, onLanguage: (id) => void savePrefs({ language: id }), talk: talk })] }) }), wide ? _jsx(YStack, {}) : null, _jsx(Publish, { source: adding, onClose: () => setAdding(null) }), _jsx(Address, { open: giving, onOpenChange: setGiving, title: t('Use a git URL'), says: t('Runs work on the GitHub repository at this address until you choose another. A private one needs GitHub connected.'), act: t('Use'), address: "", run: async (at) => give(at) }), carry.dialog, codebase ? (_jsx(SetupDialog, { repo: codebase, homes: homes, open: offering, onOpenChange: setOffering, onStart: setup, onRepo: choose, onSaved: () => {
|
|
452
448
|
setOffering(false);
|
|
453
449
|
env.reload();
|
|
454
450
|
} })) : null] })] }), desk && wide ? (_jsx(YStack, { width: 440, shrink: 0, height: "100%", borderLeftWidth: 1, borderColor: "$borderColor", bg: "$background", minW: 0, minH: 0, overflow: "hidden", children: _jsx(Panel, { side: deck, kinds: [], onHide: () => setDesk(false), label: t('Tabs') }) })) : null] }));
|
package/lib/run.js
CHANGED
|
@@ -180,8 +180,8 @@ function Job({ id, state: read }) {
|
|
|
180
180
|
const failed = finished && state === 'error';
|
|
181
181
|
const asked = shown.find((c) => c.kind === 'said' && c.who === 'person');
|
|
182
182
|
const again = asked && asked.kind === 'said' ? asked.text : '';
|
|
183
|
-
// What the recorded read left out
|
|
184
|
-
const hidden = Math.max(0, (detail.value?.events ?? 0) -
|
|
183
|
+
// What the recorded read left out once initial pagination and live replay are merged.
|
|
184
|
+
const hidden = Math.max(0, (detail.value?.events ?? 0) - events.length);
|
|
185
185
|
// Only a run still working is on a step.
|
|
186
186
|
const current = running ? plan.find((x) => !x.done) : undefined;
|
|
187
187
|
// Asked for while it ran, said once when it stops. `notify` is only ever set
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.124",
|
|
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.",
|