@volter/teams 0.1.49 → 0.1.50
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/package.json +1 -1
- package/session-follow.mjs +7 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/teams",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Volter Teams, the neutral team plane: machine identity and daemon core, the local door and server link, admission from machine grants, product doors, and the Teams server's neutral routes (company RFC 0008).",
|
|
6
6
|
"license": "MIT",
|
package/session-follow.mjs
CHANGED
|
@@ -86,8 +86,8 @@ export function peerMessage(text) {
|
|
|
86
86
|
return { id: own.id || outer.id || null, name: own['from-name'] || outer['from-name'] || own.from || outer.from || 'Another session', address: own.from || outer.from || '', body };
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
/** A person's picture
|
|
90
|
-
export const personImage = (seed = '') => `https://brand.volter.ai/runner/svg?seed=${encodeURIComponent(seed)}&size=36&radius=18
|
|
89
|
+
/** A known person's picture; an unnamed sender gets the neutral brand user icon. */
|
|
90
|
+
export const personImage = (seed = '') => seed ? `https://brand.volter.ai/runner/svg?seed=${encodeURIComponent(seed)}&size=36&radius=18` : 'https://brand.volter.ai/icon/user-round/svg?size=24';
|
|
91
91
|
/** An agent's picture (this session's own, a peer session's): the brand's agent mark, a rounded square, never a face. */
|
|
92
92
|
export const agentImage = (seed) => `https://brand.volter.ai/agent/svg?seed=${encodeURIComponent(seed)}&size=36&radius=7`;
|
|
93
93
|
|
|
@@ -124,13 +124,15 @@ export function withPeople(transcript, messages, { agentName = null, sessionId =
|
|
|
124
124
|
const metadata = byTime.get(entry.ts) ?? {};
|
|
125
125
|
const name = metadata.source_name || null;
|
|
126
126
|
const seed = name ? (metadata.source_principal_id || name) : '';
|
|
127
|
-
|
|
127
|
+
const via = typeof metadata.source_via === 'string' ? metadata.source_via.trim() : '';
|
|
128
|
+
const source = ({ room: 'Room', app: 'App', terminal: 'Terminal', api: 'API' })[via] || via || 'Session';
|
|
129
|
+
return { ...entry, actor: { ...(seed ? { id: seed } : {}), name: name ?? 'Anonymous', anonymous: !name, source, image: person(seed), kind: 'person' } };
|
|
128
130
|
});
|
|
129
131
|
let last = null;
|
|
130
132
|
return people.map((entry) => {
|
|
131
133
|
if (!entry.actor) return entry;
|
|
132
|
-
const author = `${entry.actor.kind ?? ''}:${entry.actor.name ?? entry.role}`;
|
|
133
|
-
const continued = last !== null && last.author === author && Number.isFinite(entry.ts) && Number.isFinite(last.ts) && entry.ts - last.ts < 5 * 60_000;
|
|
134
|
+
const author = `${entry.actor.kind ?? ''}:${entry.actor.id ?? entry.actor.name ?? entry.role}:${entry.actor.source ?? ''}`;
|
|
135
|
+
const continued = !entry.actor.anonymous && last !== null && last.author === author && Number.isFinite(entry.ts) && Number.isFinite(last.ts) && entry.ts - last.ts < 5 * 60_000;
|
|
134
136
|
last = { author, ts: entry.ts };
|
|
135
137
|
const timeLabel = Number.isFinite(entry.ts) ? new Date(entry.ts).toLocaleTimeString(locale, { hour: 'numeric', minute: '2-digit' }) : undefined;
|
|
136
138
|
return { ...entry, actor: { ...entry.actor, ...(continued ? { continued: true } : {}), ...(timeLabel ? { timeLabel } : {}) } };
|