@volter/supercode-teams 0.2.173 → 0.2.174

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.173",
3
+ "version": "0.2.174",
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",
@@ -17,7 +17,7 @@ import { handleCatalogEvents, handleSessionEvents, sessionNames } from './event-
17
17
  import { exact } from '@volter/teams/server/request-json';
18
18
  import { MESSAGE_AT, OPEN_REVISION } from '@volter/teams/server/migrations';
19
19
  import { delegatedRoomNoticeOf, delegatedSessionOf, looksDelegated } from '@volter/teams/server/delegated';
20
- import { deliverSessionRoomNotice } from '@volter/teams/server/machine-link';
20
+ import { deliverSessionRoomNotice, sessionDeliveryResolution } from '@volter/teams/server/machine-link';
21
21
  import { renderSourceCollectorConfig } from './otlp/collector-config.mjs';
22
22
  import { attachmentActionRoute, createAttachment, liveGrantRoute, machineEffectRoute } from './effects.mjs';
23
23
  import { exportSessionRoute, operationRoute } from './exports.mjs';
@@ -437,7 +437,16 @@ async function viewBindingRoute(api,req,res,auth,ref,requestId){
437
437
  if(!['user','service'].includes(auth.kind))fail(403,'forbidden','credential cannot bind sessions');
438
438
  const session=await api.store.authorizedSession({teamId:auth.team_id,principalId:auth.principal_id,credentialId:auth.credential_id,ref,now:api.clock.nowMs()});
439
439
  const list=async()=>api.store.query('SELECT issuer,room,conversation,bound_by,created_at FROM session_view_bindings WHERE team_id=? AND session_id=? ORDER BY created_at',[auth.team_id,session.id]);
440
- if(req.method==='GET'){send(res,200,result(api,auth,{session_id:session.id,harness:session.harness,bindings:await list()}),requestId);return;}
440
+ if(req.method==='GET'){
441
+ const bindings=await list();
442
+ // Native transport destinations are custody information, not an extra transcript-reader capability.
443
+ if(session.custodian_id===auth.principal_id&&!auth.installation_id)for(const binding of bindings){
444
+ const resolution=await sessionDeliveryResolution(api,auth.team_id,{sessionRef:session.id,...binding},true);
445
+ binding.delivery=resolution.target&&resolution.target.harness!==session.harness
446
+ ? {...resolution,state:'unavailable',reason:'harness_mismatch'} : resolution;
447
+ }
448
+ send(res,200,result(api,auth,{session_id:session.id,harness:session.harness,bindings}),requestId);return;
449
+ }
441
450
  if(session.custodian_id!==auth.principal_id)fail(403,'forbidden',"only the session's owner binds it to a view");
442
451
  const body=await parseJson(req);exact(body,['issuer','room','conversation']);
443
452
  if(typeof body.room!=='string'||!body.room||typeof body.conversation!=='string'||!body.conversation)fail(400,'invalid_request','room and conversation are required');