@volter/teams 0.1.75 → 0.1.77
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 +27 -9
- package/viewer/session-view.mjs +21 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/teams",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
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
|
@@ -142,6 +142,19 @@ export const personImage = (seed = '') => seed ? `https://brand.volter.ai/runner
|
|
|
142
142
|
/** An agent's picture (this session's own, a peer session's): the brand's agent mark, a rounded square, never a face. */
|
|
143
143
|
export const agentImage = (seed) => `https://brand.volter.ai/agent/svg?seed=${encodeURIComponent(seed)}&size=36&radius=7`;
|
|
144
144
|
|
|
145
|
+
// Older history lacks actor metadata but still carries its envelope name.
|
|
146
|
+
// Use native addressing only for a harness label, never as display text or as
|
|
147
|
+
// evidence that a generated operator mailbox is the voice of this session.
|
|
148
|
+
function mailIdentity(address, suppliedName) {
|
|
149
|
+
const native = /^sc:([^:]+):([^:]+):(.+)$/.exec(address || '');
|
|
150
|
+
const label = ({ 'claude-code': 'Claude Code', codex: 'Codex', gemini: 'Gemini', goose: 'Goose', grok: 'Grok', opencode: 'OpenCode', pi: 'Pi', operator: 'Automation', board: 'Board', pane: 'Terminal' })[native?.[2]] || 'Another session';
|
|
151
|
+
let name = typeof suppliedName === 'string' ? suppliedName.trim() : '';
|
|
152
|
+
if (native && name.endsWith(`@${native[1]}`)) name = name.slice(0, -native[1].length - 1);
|
|
153
|
+
if (!name || name === address || name.startsWith('sc:') || /^(?:(?:codex|claude-code|claude|gemini|pi|goose|grok|opencode|supercode-voice)-)?[0-9a-f]{8,}(?:-[0-9a-f]+)*$/i.test(name)) name = label;
|
|
154
|
+
return { name, kind: native && !['operator', 'board', 'pane'].includes(native[2]) ? 'agent' : 'automation' };
|
|
155
|
+
}
|
|
156
|
+
const automationImage = seed => `https://brand.volter.ai/bot/svg?seed=${encodeURIComponent(seed || 'mail')}&size=24&radius=4`;
|
|
157
|
+
|
|
145
158
|
/**
|
|
146
159
|
* Who wrote each entry of a projected transcript (supercode-ui's entries), from the messages' own annotations:
|
|
147
160
|
* this session's turns are its agent's (`agentName`); a peer session's message is that session's, its envelope kept
|
|
@@ -182,10 +195,10 @@ export function withPeople(transcript, messages, { agentName = null, sessionId =
|
|
|
182
195
|
// is this session's own front, not another agent with a generated id.
|
|
183
196
|
const ownVoice = peer.via === 'voice';
|
|
184
197
|
const seed = ownVoice ? sessionId : peer.address.startsWith('sc:') ? peer.address : peer.name;
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const
|
|
188
|
-
return { ...entry, text: peer.body, mail: { id: peer.id || entry.id, from: name, to: agentName || 'This session', direction: 'in', image: picture, ...(peer.subject ? { subject: peer.subject } : {}), ...(ownVoice ? { via: 'voice' } : {}), ...(peer.inReplyTo ? { inReplyTo: peer.inReplyTo } : {}) }, actor: { id: seed, name, image: picture, kind: 'agent' }, context: [{ id: `${entry.id}:envelope`, kind: 'envelope', label: 'Delivered by supercode', detail: entry.text }] };
|
|
198
|
+
const identity = mailIdentity(peer.address, peer.name);
|
|
199
|
+
const name = ownVoice && agentName ? agentName : identity.name;
|
|
200
|
+
const picture = ownVoice || identity.kind === 'agent' ? agent(seed) : automationImage(seed);
|
|
201
|
+
return { ...entry, text: peer.body, mail: { id: peer.id || entry.id, from: name, to: agentName || 'This session', direction: 'in', image: picture, ...(peer.subject ? { subject: peer.subject } : {}), ...(ownVoice ? { via: 'voice' } : {}), ...(peer.inReplyTo ? { inReplyTo: peer.inReplyTo } : {}) }, actor: { id: seed, name, image: picture, ...(ownVoice || identity.kind === 'agent' ? { kind: 'agent' } : {}) }, context: [{ id: `${entry.id}:envelope`, kind: 'envelope', label: 'Delivered by supercode', detail: entry.text }] };
|
|
189
202
|
}
|
|
190
203
|
const name = metadata.source_name || null;
|
|
191
204
|
const seed = name ? (metadata.source_principal_id || name) : '';
|
|
@@ -213,11 +226,16 @@ export function withMail(transcript, rows, { agentName = 'This session', agentId
|
|
|
213
226
|
let earliest = Infinity;
|
|
214
227
|
for (const entry of transcript) if (Number.isFinite(entry.ts)) earliest = Math.min(earliest, entry.ts);
|
|
215
228
|
if (earliest !== Infinity) rows = rows.filter(row => row.at >= earliest);
|
|
216
|
-
const nameOf = actor => actor?.self ? agentName : actor?.name ||
|
|
217
|
-
const mail = rows.map(row =>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
229
|
+
const nameOf = (actor, address, suppliedName, self = false) => actor?.self || self ? agentName : mailIdentity(actor?.id || address, actor?.name || suppliedName).name;
|
|
230
|
+
const mail = rows.map(row => {
|
|
231
|
+
const own = row.fromActor ? row.fromActor.self : row.direction === 'out';
|
|
232
|
+
const kind = row.fromActor?.kind || (own ? 'agent' : mailIdentity(row.from, row.fromName).kind);
|
|
233
|
+
const seed = own ? agentId : row.fromActor?.id || row.from;
|
|
234
|
+
return { id: `mail:${row.id}`, role: 'notice', text: row.text, ts: row.at, truncated: false,
|
|
235
|
+
mail: { id: row.id, from: nameOf(row.fromActor, row.from, row.fromName, own), to: nameOf(row.toActor, row.to, '', !row.toActor && row.direction === 'in'),
|
|
236
|
+
image: kind === 'agent' ? picture(seed) : kind === 'person' ? personImage(seed) : automationImage(seed),
|
|
237
|
+
subject: row.subject || undefined, via: row.fromActor?.via, direction: row.direction, inReplyTo: row.inReplyTo } };
|
|
238
|
+
});
|
|
221
239
|
// Some native envelopes use a shortened ID. It identifies a copy only if
|
|
222
240
|
// there is exactly one matching full ID; ambiguity must not erase native mail.
|
|
223
241
|
const fullIds = new Set(rows.map(row => row.id));
|