@volter/supercode-teams 0.3.2 → 0.3.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/bin/workspace.mjs CHANGED
@@ -485,6 +485,9 @@ async function sessionsCommand(sub, command) {
485
485
  if (sub === 'url') { only(flags, ['json', 'help', 'context']); requireArgs(rest, 1, 1, 'sessions url REF'); const descriptor = await session.descriptor(); return output({ version: 1, context: scope(context), data: { url: `${context.origin}/teams/${context.team_id}/sessions/${descriptor.data.id}` } }); }
486
486
  // A session view (RH2 ADR 0008): its owner lets a workplace Room's Conversation read this session with the tokens that
487
487
  // workplace signs. `bind` records it and prints what the workplace's own bind door takes; `unbind` removes it.
488
+ // The custodian's read of a session's view bindings, each with where a Room notice to it would be delivered now
489
+ // (ready, stopped and resumable, ended, unknown liveness, or unavailable with the failing predicate).
490
+ if (sub === 'bindings') { only(flags, ['json', 'help', 'context']); requireArgs(rest, 1, 1, 'sessions bindings REF'); return output(await command.client.request('GET', `${session.path}/view-bindings`)); }
488
491
  if (sub === 'bind' || sub === 'unbind') {
489
492
  only(flags, ['json', 'help', 'context', 'room', 'agent', 'conversation', 'rh2']); requireArgs(rest, 1, 1, `sessions ${sub} REF --room ROOM --agent PRINCIPAL --rh2 ORIGIN`);
490
493
  if (!flags.room || (!flags.agent && !flags.conversation) || (flags.agent && flags.conversation) || !flags.rh2) usage(`sessions ${sub} needs --room, --agent (or a legacy --conversation), and --rh2 (the workplace's origin)`);
package/machine.mjs CHANGED
@@ -35,7 +35,7 @@ import { Workspaces, inspectCheckout } from './workspaces.mjs';
35
35
  import { WorkspaceContexts, fromContext } from '@volter/teams/context';
36
36
  import { TeamsClient } from '@volter/teams/http-client';
37
37
  import { supercodeHome } from '@volter/teams/home';
38
- import { readMailHistory } from './mail-history.mjs';
38
+ import { readMailHistory, machineName } from './mail-history.mjs';
39
39
  import { randomBytes, createHash } from 'node:crypto';
40
40
  import { WebSocket } from 'ws';
41
41
  import { TmuxTerminalHost, classifyAttentionSignal, composerHoldsDraft, composerReadyForInput } from '@volter/supercode-terminal';
@@ -555,7 +555,7 @@ export class TeamsMachine extends MachineCore {
555
555
  }
556
556
 
557
557
  #noticeTarget(address){
558
- return sessionNoticeTarget(address,{machine:hostname().split('.')[0].toLowerCase().replace(/[^a-z0-9_-]/g,'-'),
558
+ return sessionNoticeTarget(address,{machine:machineName(this.env),
559
559
  mail:request=>this.#nativeMailReply(request),
560
560
  discover:params=>this.#serveRequest('harness.v1.sessions.discover',params,10000),
561
561
  recordedConfig:locator=>this.#serveRequest('harness.v1.sessions.recorded_config',{locator},15000)});
@@ -1638,7 +1638,7 @@ export class TeamsMachine extends MachineCore {
1638
1638
  const ended=await this.#serveRequest('harness.v1.runtimes.close',{connection:runtime.connection});
1639
1639
  result=ended?.closed?{state:'closed',reason:'native runtime close receipt'}:{state:'unknown',reason:'runtime returned no close receipt'};
1640
1640
  }else{
1641
- const machine=hostname().split('.')[0].toLowerCase().replace(/[^a-z0-9_-]/g,'-'),address=`sc:${machine}:${closure.harness}:${closure.native_id}`;
1641
+ const machine=machineName(this.env),address=`sc:${machine}:${closure.harness}:${closure.native_id}`;
1642
1642
  const code=await new Promise((resolve,reject)=>{
1643
1643
  const child=spawn(this.supercodeBin,['close',address],{env:{...this.env,SUPERCODE_CALLER:address},stdio:'ignore'});
1644
1644
  const timer=setTimeout(()=>{child.kill('SIGTERM');resolve(null);},30000);
package/mail-history.mjs CHANGED
@@ -71,7 +71,7 @@ async function answeredMail(rows, binary, env, signal) {
71
71
 
72
72
  // Match the CLI's local_machine_name: the native mailbox belongs to its
73
73
  // enrolled context, which can differ from a viewer connector's --home.
74
- function machineName(env) {
74
+ export function machineName(env) {
75
75
  let name = hostname();
76
76
  try {
77
77
  const root = join(teamsHome(env), 'workspaces');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
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",