@hanzo/build 0.2.112 → 0.2.114
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/agents.d.ts +2 -0
- package/lib/customize/agents.js +6 -5
- package/lib/library.js +8 -5
- package/package.json +1 -1
package/lib/api/agents.d.ts
CHANGED
|
@@ -98,6 +98,8 @@ export interface Cast {
|
|
|
98
98
|
read?: () => Promise<string>;
|
|
99
99
|
/** Its face, an address of the host. */
|
|
100
100
|
avatar?: string;
|
|
101
|
+
/** Who it is drawn from, by the names Browse prints: "Ogilvy", "Bernbach", "Burnett". */
|
|
102
|
+
after?: readonly string[];
|
|
101
103
|
tools?: string[];
|
|
102
104
|
/** How the preset runs when elected (e.g. 'long-running' for 24/7 autonomous bots). */
|
|
103
105
|
executionMode?: Mode;
|
package/lib/customize/agents.js
CHANGED
|
@@ -35,7 +35,7 @@ import { useLoad } from './load.js';
|
|
|
35
35
|
import { say } from './say.js';
|
|
36
36
|
import { Add, Choice, Confirm, Empty, Failed, Field, Grid, Line, Mark, matches, mono, Part, Sheet, Soft, Tile, useCount, Visitor } from './ui.js';
|
|
37
37
|
/** How many cards Browse draws at a time. */
|
|
38
|
-
const PAGE =
|
|
38
|
+
const PAGE = 36;
|
|
39
39
|
const ANY = phrase('All');
|
|
40
40
|
const TRIGGER_LABELS = {
|
|
41
41
|
webhook: { title: phrase('Webhook & API events'), detail: phrase('Wake immediately when an inbound webhook or API event fires.') },
|
|
@@ -145,12 +145,13 @@ export function Agents({ view, q, adding, onAdding, onView, onCount, mode = 'age
|
|
|
145
145
|
if (browsing) {
|
|
146
146
|
const allCast = host.cast ?? [];
|
|
147
147
|
const isBotCast = (c) => c.category === 'Bot' || c.executionMode === 'long-running';
|
|
148
|
-
const
|
|
149
|
-
|
|
148
|
+
const first = botsMode
|
|
149
|
+
? allCast.map(asBot)
|
|
150
|
+
: allCast.map((c) => (isBotCast(c) ? { ...c, category: 'Team', executionMode: undefined, schedule: undefined, triggers: undefined } : c));
|
|
150
151
|
const rest = botsMode ? [] : figures.value.filter((c) => !isBotCast(c));
|
|
151
152
|
const all = [...first, ...rest];
|
|
152
|
-
const shown = all.filter((c) => (botsMode || kind === ANY || c.category === kind) && matches(q, c.title, c.name, c.description, c.category));
|
|
153
|
-
const card = (c) => (_jsx(Tile, { title: c.title, detail: c.description === c.title || c.description === c.category ?
|
|
153
|
+
const shown = all.filter((c) => (botsMode || kind === ANY || c.category === kind) && matches(q, c.title, c.name, c.description, c.category, ...(c.after ?? [])));
|
|
154
|
+
const card = (c) => (_jsx(Tile, { title: c.title, detail: [c.description === c.title || c.description === c.category ? '' : c.description, c.after?.length ? t('after {names}', { names: c.after.join(', ') }) : ''].filter(Boolean).join(' · ') || undefined, meta: [botsMode ? t('Bot') : category(c.category, t), c.executionMode === 'long-running' ? t('24/7 · Proactive · Event-driven') : '', c.schedule].filter(Boolean).join(' · '), mark: _jsx(Mark, { name: c.title, size: 40, logo: c.avatar }), onOpen: signed && botsMode ? () => setElecting(c) : undefined, action: signed ? (_jsxs(XStack, { items: "center", gap: "$1.5", children: [botsMode ? (_jsx(XStack, { "$max-sm": { display: 'none' }, children: _jsx(Button, { size: "sm", variant: "ghost", disabled: using !== null, "aria-label": t('Elect {name} to run 24/7', { name: c.title }), onPress: () => setElecting(c), children: t('Configure 24/7') }) })) : null, _jsx(Add, { name: c.title, use: true, added: false, busy: using !== null, onPress: () => void take(c) })] })) : undefined }, `${c.category}/${c.name}/${c.title}`));
|
|
154
155
|
return (_jsxs(YStack, { gap: "$3", children: [signed ? (_jsxs(XStack, { gap: "$2", flexWrap: "wrap", children: [_jsx(Button, { size: "sm", variant: "outline", onPress: () => onAdding(true), children: t('Start from scratch') }), botsMode ? (allCast.length ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => setElecting((first[0] ?? allCast[0])), children: t('Elect 24/7 preset') })) : null) : (_jsxs(_Fragment, { children: [_jsx(Button, { size: "sm", variant: "outline", onPress: () => setMaking('self'), children: t('Clone yourself') }), _jsx(Button, { size: "sm", variant: "outline", onPress: () => setMaking('person'), children: t('Create from a person') })] }))] })) : null, !botsMode ? (_jsx(XStack, { overflowX: "auto", overflowY: "hidden", pb: "$1", children: _jsx(Choice, { label: t('Category'), value: kind, options: kinds(first, rest).map((id) => ({ id, label: category(id, t) })), onChange: setKind }) })) : null, _jsx(Line, { children: note }), shown.length ? (_jsx(Grid, { label: botsMode ? t('Bots to start from') : t('Agents to start from'), children: shown.slice(0, more).map(card) })) : figures.loading ? null : q.trim() ? (_jsx(Soft, { children: t(botsMode ? 'No bot matches “{q}”.' : 'No agent matches “{q}”.', { q: q.trim() }) })) : botsMode ? (_jsx(Soft, { children: t('Create a persistent 24/7 bot from scratch or elect any preset.') })) : (_jsx(Soft, { children: t('No agent matches “{q}”.', { q: q.trim() }) })), shown.length > more ? (_jsx(XStack, { children: _jsx(Button, { size: "sm", variant: "ghost", onPress: () => setMore(more + PAGE), children: t('More') }) })) : null, figures.error ? _jsx(Failed, { error: figures.error, onRetry: figures.reload }) : figures.loading ? _jsx(Soft, { children: t('Loading…') }) : null, editor, making ? _jsx(Person, { self: making === 'self', onClose: () => setMaking(null), onMade: opened }) : null, electing ? _jsx(Elect, { preset: electing, all: allCast, onClose: () => setElecting(null), onElected: opened }) : null] }));
|
|
155
156
|
}
|
|
156
157
|
if (!signed) {
|
package/lib/library.js
CHANGED
|
@@ -78,15 +78,18 @@ function glyph(kind, n = 18) {
|
|
|
78
78
|
return _jsx(FileText, { size: n });
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
/** Known same-origin agent
|
|
82
|
-
const AGENT_STILLS = new Set([
|
|
83
|
-
|
|
81
|
+
/** Known same-origin agent stills shelved by Dev, used if the signed store URL is unreachable. */
|
|
82
|
+
const AGENT_STILLS = new Set([
|
|
83
|
+
'antje.jpg', 'art.png', 'audit.png', 'auto.png', 'biz.png', 'com.png', 'comp.png', 'corp.png',
|
|
84
|
+
'creative.png', 'cust.png', 'cyber.png', 'data.png', 'des.png', 'dev.png', 'doc.png', 'edu.png',
|
|
85
|
+
'fin.png', 'gov.png', 'huma.png', 'it.png', 'lang.png', 'law.png', 'mana.png', 'mark.png',
|
|
86
|
+
'mu.png', 'opera.png', 'proc.png', 'qa.png', 'rev.png', 'risk.png', 'sal.png', 'sci.png',
|
|
87
|
+
'su.png', 'supply.png', 'vi.png', 'vid.png', 'zach.jpg',
|
|
88
|
+
]);
|
|
84
89
|
function localStill(x) {
|
|
85
90
|
const name = x.name.trim().toLowerCase();
|
|
86
91
|
if (AGENT_STILLS.has(name))
|
|
87
92
|
return `/agents/${name}`;
|
|
88
|
-
if (BOT_STILLS.has(name))
|
|
89
|
-
return `/bots/${name}`;
|
|
90
93
|
return '';
|
|
91
94
|
}
|
|
92
95
|
/** The still a tile shows: the item's preview, or an image's own bytes. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.114",
|
|
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.",
|