bloby-bot 0.49.1 → 0.49.3
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/dist-bloby/assets/{bloby-DU3UB3X1.js → bloby-CnyC8k_L.js} +77 -77
- package/dist-bloby/assets/{globals-BjVrJod9.css → globals-D60b-8LY.css} +1 -1
- package/dist-bloby/assets/{globals-BbvTL0oZ.js → globals-DNO3ilRx.js} +2 -2
- package/dist-bloby/assets/{highlighted-body-OFNGDK62-C3E0X5ku.js → highlighted-body-OFNGDK62-CeNcsRuK.js} +1 -1
- package/dist-bloby/assets/mermaid-GHXKKRXX-DxKK2ZHj.js +1 -0
- package/dist-bloby/assets/{onboard-TPkpjMdq.js → onboard-D8sRPjz2.js} +1 -1
- package/dist-bloby/bloby.html +3 -3
- package/dist-bloby/onboard.html +3 -3
- package/package.json +1 -1
- package/supervisor/channels/manager.ts +20 -15
- package/supervisor/chat/src/components/Chat/MessageBubble.tsx +37 -4
- package/supervisor/chat/src/hooks/useBlobyChat.ts +3 -1
- package/supervisor/file-saver.ts +1 -1
- package/supervisor/index.ts +12 -3
- package/worker/prompts/bloby-system-prompt.txt +3 -2
- package/dist-bloby/assets/mermaid-GHXKKRXX-BS0WlgMc.js +0 -1
|
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import { Streamdown } from 'streamdown';
|
|
3
3
|
import { code } from '@streamdown/code';
|
|
4
4
|
import 'streamdown/styles.css';
|
|
5
|
-
import { Paperclip, Copy, Check, ExternalLink, Mic, Play, Pause } from 'lucide-react';
|
|
5
|
+
import { Paperclip, Copy, Check, ExternalLink, Mic, Play, Pause, Laptop, Smartphone, Monitor, Globe, Volume2 } from 'lucide-react';
|
|
6
6
|
import AudioBubble from './AudioBubble';
|
|
7
7
|
import EnvForm, { type EnvGroupData, type EnvField } from './EnvForm';
|
|
8
8
|
import BlobyImageCard from './BlobyImageCard';
|
|
@@ -29,6 +29,27 @@ function formatTime(iso: string): string {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/** Parse the leading channel tag from content, e.g. "[Mac]\n..." → { tag: "Mac", body: "..." }.
|
|
33
|
+
* User messages without an explicit tag default to "Chat" (PWA chat bubble). */
|
|
34
|
+
function parseChannelTag(text: string): { tag: string; body: string } {
|
|
35
|
+
const m = text.match(/^\[([^\]]+)\]\n([\s\S]*)$/);
|
|
36
|
+
if (!m) return { tag: 'Chat', body: text };
|
|
37
|
+
const raw = m[1].split('|')[0].trim();
|
|
38
|
+
// Normalize explicit [PWA] tag to the friendlier "Chat" label
|
|
39
|
+
const tag = raw === 'PWA' ? 'Chat' : raw;
|
|
40
|
+
return { tag, body: m[2] };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function ChannelIcon({ tag }: { tag: string }) {
|
|
44
|
+
const cls = 'h-3 w-3 opacity-60';
|
|
45
|
+
if (tag === 'Mac') return <Laptop className={cls} />;
|
|
46
|
+
if (tag === 'WhatsApp') return <Smartphone className={cls} />;
|
|
47
|
+
if (tag === 'workspace') return <Monitor className={cls} />;
|
|
48
|
+
if (tag === 'Chat') return <Globe className={cls} />;
|
|
49
|
+
if (tag === 'Alexa') return <Volume2 className={cls} />;
|
|
50
|
+
return <Globe className={cls} />;
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
/** Convert channel-pair URLs (any format) into markdown links so the buttons render */
|
|
33
54
|
function preprocessContent(text: string): string {
|
|
34
55
|
let out = text;
|
|
@@ -172,6 +193,9 @@ export default function MessageBubble({ role, content, timestamp, hasAttachments
|
|
|
172
193
|
const isUser = role === 'user';
|
|
173
194
|
const time = timestamp ? formatTime(timestamp) : '';
|
|
174
195
|
|
|
196
|
+
// Strip channel tag from user messages for clean display
|
|
197
|
+
const { tag: channelTag, body: displayContent } = isUser ? parseChannelTag(content) : { tag: '', body: content };
|
|
198
|
+
|
|
175
199
|
// Separate image and document attachments
|
|
176
200
|
const imageAtts = attachments?.filter((a) => a.mediaType?.startsWith('image/')) || [];
|
|
177
201
|
const docAtts = attachments?.filter((a) => !a.mediaType?.startsWith('image/')) || [];
|
|
@@ -187,7 +211,7 @@ export default function MessageBubble({ role, content, timestamp, hasAttachments
|
|
|
187
211
|
return (
|
|
188
212
|
<div className="flex flex-col items-end gap-0.5">
|
|
189
213
|
<div className="group relative max-w-[85%]">
|
|
190
|
-
<CopyButton text={
|
|
214
|
+
<CopyButton text={displayContent} />
|
|
191
215
|
<div className="rounded-2xl px-4 py-2.5 text-sm leading-relaxed whitespace-pre-wrap bg-primary text-primary-foreground break-words">
|
|
192
216
|
{/* Image thumbnails */}
|
|
193
217
|
{imageUrls.length > 0 && (
|
|
@@ -224,7 +248,7 @@ export default function MessageBubble({ role, content, timestamp, hasAttachments
|
|
|
224
248
|
</div>
|
|
225
249
|
)}
|
|
226
250
|
{/* Text content */}
|
|
227
|
-
{
|
|
251
|
+
{displayContent}
|
|
228
252
|
{/* Inline audio bar */}
|
|
229
253
|
{audioData && (
|
|
230
254
|
<div className="mt-2 pt-2 border-t border-white/10">
|
|
@@ -233,7 +257,16 @@ export default function MessageBubble({ role, content, timestamp, hasAttachments
|
|
|
233
257
|
)}
|
|
234
258
|
</div>
|
|
235
259
|
</div>
|
|
236
|
-
{
|
|
260
|
+
{/* Timestamp + channel icon */}
|
|
261
|
+
<div className="flex items-center gap-1 px-1 self-end">
|
|
262
|
+
{channelTag && (
|
|
263
|
+
<span className="flex items-center gap-0.5 text-[10px] text-muted-foreground/40">
|
|
264
|
+
<ChannelIcon tag={channelTag} />
|
|
265
|
+
{channelTag}
|
|
266
|
+
</span>
|
|
267
|
+
)}
|
|
268
|
+
{time && <span className="text-[10px] text-muted-foreground/50">{time}</span>}
|
|
269
|
+
</div>
|
|
237
270
|
</div>
|
|
238
271
|
);
|
|
239
272
|
}
|
|
@@ -270,7 +270,7 @@ export function useBlobyChat(ws: WsClient | null, triggerReload?: number, enable
|
|
|
270
270
|
]);
|
|
271
271
|
}),
|
|
272
272
|
// Cross-device sync: append message from another client
|
|
273
|
-
ws.on('chat:sync', (data: { conversationId: string; message: { role: string; content: string; timestamp: string } }) => {
|
|
273
|
+
ws.on('chat:sync', (data: { conversationId: string; message: { role: string; content: string; timestamp: string; attachments?: StoredAttachment[] } }) => {
|
|
274
274
|
if (conversationIdRef.current && data.conversationId !== conversationIdRef.current) return;
|
|
275
275
|
setMessages((msgs) => [
|
|
276
276
|
...msgs,
|
|
@@ -279,6 +279,8 @@ export function useBlobyChat(ws: WsClient | null, triggerReload?: number, enable
|
|
|
279
279
|
role: data.message.role as 'user' | 'assistant',
|
|
280
280
|
content: data.message.content,
|
|
281
281
|
timestamp: data.message.timestamp,
|
|
282
|
+
hasAttachments: !!(data.message.attachments?.length),
|
|
283
|
+
attachments: data.message.attachments,
|
|
282
284
|
},
|
|
283
285
|
]);
|
|
284
286
|
}),
|
package/supervisor/file-saver.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function saveAttachment(att: { type: 'image' | 'file'; name: string; medi
|
|
|
33
33
|
const ext = extFromName || extFromMime[att.mediaType] || 'bin';
|
|
34
34
|
|
|
35
35
|
const filename = `${stamp}_${rand}.${ext}`;
|
|
36
|
-
const relPath =
|
|
36
|
+
const relPath = `${category}/${filename}`;
|
|
37
37
|
|
|
38
38
|
const dir = category === 'images' ? paths.filesImages : paths.filesDocuments;
|
|
39
39
|
const absPath = `${dir}/${filename}`;
|
package/supervisor/index.ts
CHANGED
|
@@ -2187,10 +2187,17 @@ mint();
|
|
|
2187
2187
|
role: 'user', content, meta,
|
|
2188
2188
|
});
|
|
2189
2189
|
|
|
2190
|
-
// Broadcast user message to other clients
|
|
2190
|
+
// Broadcast user message to other clients (include saved attachment metadata)
|
|
2191
2191
|
broadcastBlobyExcept(ws, 'chat:sync', {
|
|
2192
2192
|
conversationId: convId,
|
|
2193
|
-
message: {
|
|
2193
|
+
message: {
|
|
2194
|
+
role: 'user',
|
|
2195
|
+
content,
|
|
2196
|
+
timestamp: new Date().toISOString(),
|
|
2197
|
+
attachments: savedFiles.length
|
|
2198
|
+
? savedFiles.map((f) => ({ type: f.type, name: f.name, mediaType: f.mediaType, filePath: f.relPath }))
|
|
2199
|
+
: undefined,
|
|
2200
|
+
},
|
|
2194
2201
|
});
|
|
2195
2202
|
} catch (err: any) {
|
|
2196
2203
|
log.warn(`[bloby] DB persist error: ${err.message}`);
|
|
@@ -2253,10 +2260,12 @@ mint();
|
|
|
2253
2260
|
const ownPhone = waStatus?.connected ? (waStatus.info?.phoneNumber as string | undefined) : undefined;
|
|
2254
2261
|
const waMirrorTo = ownPhone ? `${ownPhone}@s.whatsapp.net` : undefined;
|
|
2255
2262
|
log.info(`[orchestrator] Pushing message into live conversation (waMirror=${waMirrorTo || 'none'})`);
|
|
2263
|
+
// Don't prepend [PWA] if content already carries its own channel tag (e.g. [Mac] from Morphy)
|
|
2264
|
+
const alreadyTagged = /^\[[^\]]+\]\n/.test(content);
|
|
2256
2265
|
channelManager.pushWithRouting(
|
|
2257
2266
|
convId,
|
|
2258
2267
|
{ surface: 'chat', waSendTo: waMirrorTo, isSelfChat: true },
|
|
2259
|
-
`[
|
|
2268
|
+
alreadyTagged ? content : `[PWA]\n${content}`,
|
|
2260
2269
|
data.attachments,
|
|
2261
2270
|
savedFiles,
|
|
2262
2271
|
);
|
|
@@ -278,12 +278,13 @@ If your human asks you to update a skill's behavior, edit the files INSIDE `skil
|
|
|
278
278
|
|
|
279
279
|
You can communicate through several surfaces at once. The two built-in ones are:
|
|
280
280
|
|
|
281
|
-
- **`[
|
|
281
|
+
- **`[PWA]`** — the chat bubble in the dashboard (web app / PWA). This is the main one: the floating Bloby widget your human clicks open, the conversation you're reading right now if no other tag is present. Treat it as your home base.
|
|
282
|
+
- **`[Mac]`** — the Morphy native Mac app living in the MacBook notch. Your human held a hotkey, spoke, and Morphy sent the transcript here. Screenshots of their screen may be attached. Keep replies concise — they'll be spoken aloud via TTS. No markdown, no bullet lists — plain spoken sentences only.
|
|
282
283
|
- **`[workspace]`** — a chat-shaped widget your human placed somewhere inside their dashboard *workspace*. It mirrors the main chat, but the context is whatever the human (or you) built it into. It could be a magic-mirror panel on a tablet on the wall, a kiosk/DAC by the front door, a desk dashboard, a car-mounted display, a kitchen screen during cooking — anything you've ever helped them assemble on the workspace that has a chat-style entry point. **Check `MEMORY.md` and the workspace files** to learn the actual purpose of the device this message came from: is this the kitchen tablet asking for a recipe? The hallway mirror asking what's on today's schedule? The garage panel asking about the car? Tailor tone, brevity, and content to that role. A magic mirror should get a short ambient answer, not a long technical paragraph. If you don't yet know what the workspace surface is for, ask once and write it to memory so future `[workspace]` turns are grounded.
|
|
283
284
|
|
|
284
285
|
Beyond those, your human can install additional channels (WhatsApp, Telegram, Discord, Alexa…) as **skills** from the Bloby Marketplace. Each channel skill teaches you the conventions for that surface.
|
|
285
286
|
|
|
286
|
-
**Channel discipline.** Every incoming message is tagged with a surface (e.g. `[
|
|
287
|
+
**Channel discipline.** Every incoming message is tagged with a surface (e.g. `[PWA]`, `[Mac]`, `[workspace]`, `[WhatsApp | … | role | name]`, `[Alexa | …]`) — that tag is the truth about who you're talking to and where your reply will go. The supervisor pins each turn's reply to the surface that triggered it; concurrent inbounds from another channel cannot redirect this turn. **Don't infer the channel from prior messages, conversation drift, or what feels right** — read the tag on the current turn and respond accordingly. If a tag isn't present, you're on the PWA chat bubble. If you ever feel the urge to mention a different channel's content in your reply, stop and re-check the tag.
|
|
287
288
|
|
|
288
289
|
## Marketplace — Getting New Skills
|
|
289
290
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./bloby-DU3UB3X1.js";export{e as Mermaid};
|