@volter/supercode-orchestrator 0.5.66 → 0.5.68

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.
@@ -136,6 +136,14 @@ log('info', `${values.agent}: the account Room ${roomId} is carried to its mailb
136
136
  const supercode = process.env.SUPERCODE_BIN || 'supercode';
137
137
  const sc = (args) => JSON.parse(execFileSync(supercode, args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }));
138
138
  let boundTo = null;
139
+ /** The agent's own seat takes its session at RH2's own-seat door (PUT …/members/:principalId/session, a Room
140
+ * reader's): the session alone changes, never the seat's roles or who may read and post to it, which stay a
141
+ * members.manage holder's. A refusal throws with its status. */
142
+ async function seatSession(session) {
143
+ const path = `/rooms/${encodeURIComponent(roomId)}/members/${encodeURIComponent(adapter.principalId())}/session`;
144
+ const res = await adapter.fetch(`${adapter.apiUrl()}/api/v3${path}`, { method: 'PUT', headers: adapter.headers(), body: JSON.stringify({ session }) });
145
+ if (!res.ok) throw new Error(`PUT ${path} -> HTTP ${res.status}: ${(await res.text()).slice(0, 200)}`);
146
+ }
139
147
  /** The participant's seat bound to the agent's current main session; a new main session rebinds it. */
140
148
  async function bindDm() {
141
149
  let main;
@@ -145,7 +153,7 @@ async function bindDm() {
145
153
  let bound;
146
154
  try { bound = sc(['sessions', 'bind', session, '--room', roomId, '--agent', adapter.principalId(), '--rh2', adapter.apiUrl(), '--json']).data; }
147
155
  catch (error) { log('debug', `${values.agent}: its DM is not bound yet (${String(error.stderr ?? error.message).trim().split('\n').at(-1)})`); return; }
148
- await post(`/rooms/${encodeURIComponent(roomId)}/members`, { principalId: adapter.principalId(), roleKeys: ['member'], session: { harness: bound.harness, sessionId: bound.sessionId, team: bound.team, teamsUrl: bound.teamsUrl } });
156
+ await seatSession({ harness: bound.harness, sessionId: bound.sessionId, team: bound.team, teamsUrl: bound.teamsUrl });
149
157
  boundTo = session;
150
158
  log('info', `${values.agent}: its DM in the account Room is its main session ${session}`);
151
159
  }
package/loop.mjs CHANGED
@@ -1032,9 +1032,8 @@ export function webhookPort(state) {
1032
1032
 
1033
1033
  /**
1034
1034
  * Claude Code's `can_use_tool` reaches the runtime as a native control request, not a normalized
1035
- * `request`; unrelayed, the turn sits blocked until the runtime's own timeout denies it. Its id is the
1036
- * CLI's `request_id` (a string, which is what the runtime's respond door takes) and its answers are
1037
- * the two the CLI accepts.
1035
+ * `request`. Its id is the CLI's `request_id` (a string, which is what the runtime's respond door
1036
+ * takes) and its answers are the two the CLI accepts.
1038
1037
  */
1039
1038
  function claudePermissionRequest(payload) {
1040
1039
  const request = payload?.request;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.66",
3
+ "version": "0.5.68",
4
4
  "type": "module",
5
5
  "description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
6
6
  "exports": {