@volter/supercode-teams 0.2.126 → 0.2.127

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.
Files changed (2) hide show
  1. package/machine.mjs +7 -2
  2. package/package.json +1 -1
package/machine.mjs CHANGED
@@ -534,11 +534,16 @@ export class TeamsMachine extends MachineCore {
534
534
  // Who typed it is noted before it is typed: a capture can read the session's new line before the door confirms
535
535
  // it (a loaded machine confirmed a frozen-then-resumed line after the line was captured, and it went up unnamed).
536
536
  // A refusal withdraws the note; an unconfirmed turn keeps it, as the line may well be in the session.
537
- const note = { harness, session, text: request.text, at: Date.now(), source: { via: 'room', from: { principalId: principal ?? null, name: entry.name ?? null } } };
537
+ // Room context comes only from the server-authenticated claim. JSON quotes names as data,
538
+ // so a display name cannot introduce another header or masquerade as an instruction.
539
+ const text = entry.roomContext
540
+ ? `[Room ${JSON.stringify(entry.roomContext.name)} (${JSON.stringify(entry.roomContext.id)}); sender ${JSON.stringify(entry.name ?? entry.roomContext.sender)} (${JSON.stringify(entry.roomContext.sender)})]\n${request.text}`
541
+ : request.text;
542
+ const note = { harness, session, text, at: Date.now(), source: { via: 'room', from: { principalId: principal ?? null, name: entry.name ?? null } } };
538
543
  try { this.onTurn?.(note); } catch { /* naming is best-effort; the turn goes either way */ }
539
544
  this.#serveRequest('harness.v1.sessions.message', {
540
545
  locator: { harness, session_id: session, storage: { kind: 'file', path: '' } },
541
- text: request.text,
546
+ text,
542
547
  from_name: entry.name ?? principal ?? 'a Room member',
543
548
  as_user: true,
544
549
  }, TURN_CONFIRM_MS).then((result) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.126",
3
+ "version": "0.2.127",
4
4
  "type": "module",
5
5
  "description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
6
6
  "license": "MIT",