@volter/supercode-orchestrator 0.5.68 → 0.5.69

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.
@@ -11,8 +11,10 @@
11
11
  // and every answer is posted back anchored at its thread's root, by `AgentMailboxBridge` over the RH2 adapter.
12
12
  //
13
13
  // The Room is found by its key (`--room-key`, default `account-<agent>`), or opened once when the organization has
14
- // none: the principal (`--principal`, RH2's principal id) as its operator, and the bot seated in its conversation
15
- // answering every line. `--room <id>` names an existing Room instead and opens nothing.
14
+ // none: from the organization's preset (`--preset`) with the principal (`--principal`, RH2's principal id) and the agent
15
+ // both seated in the role the org's floor names (`--role`), and the agent answering every line of its conversation.
16
+ // Authority comes from a stated role: opening a Room without both is refused. `--room <id>` names an existing Room
17
+ // instead and opens nothing.
16
18
  //
17
19
  // RH2 is reached as the agent's own principal where the organization declares the agent (docs/adr/0017: `supercode
18
20
  // orchestrator apps install rh2-agent … --profile <agent>` in the home, `--root` or HERMES_HOME), so its threads, its DM
@@ -37,10 +39,10 @@ import { installedApps } from '../installed-apps.mjs';
37
39
 
38
40
  const { values } = parseArgs({
39
41
  args: process.argv.slice(3),
40
- options: { agent: { type: 'string' }, root: { type: 'string' }, room: { type: 'string' }, 'room-key': { type: 'string' }, 'room-name': { type: 'string' }, principal: { type: 'string' }, state: { type: 'string' }, platform: { type: 'string' }, site: { type: 'string' }, jql: { type: 'string' }, 'slack-channel': { type: 'string' }, help: { type: 'boolean' } },
42
+ options: { agent: { type: 'string' }, root: { type: 'string' }, room: { type: 'string' }, 'room-key': { type: 'string' }, 'room-name': { type: 'string' }, principal: { type: 'string' }, preset: { type: 'string' }, role: { type: 'string' }, state: { type: 'string' }, platform: { type: 'string' }, site: { type: 'string' }, jql: { type: 'string' }, 'slack-channel': { type: 'string' }, help: { type: 'boolean' } },
41
43
  });
42
44
  if (values.help || !values.agent) {
43
- console.log('supercode-orchestrator agent-channel --agent <name> [--root <home>] [--room <id> | --room-key <key> --principal <rh2 principal id> [--room-name <name>]] [--state <file>]\n supercode-orchestrator agent-channel --agent <name> --platform slack --slack-channel <id>[,<id>] [--state <file>]\n supercode-orchestrator agent-channel --agent <name> --platform jira --site <url> --jql <jql> [--state <file>]');
45
+ console.log('supercode-orchestrator agent-channel --agent <name> [--root <home>] [--room <id> | --room-key <key> [--principal <rh2 principal id> --preset <preset id> --role <role key> [--room-name <name>]]] [--state <file>]\n supercode-orchestrator agent-channel --agent <name> --platform slack --slack-channel <id>[,<id>] [--state <file>]\n supercode-orchestrator agent-channel --agent <name> --platform jira --site <url> --jql <jql> [--state <file>]');
44
46
  process.exit(values.help ? 0 : 2);
45
47
  }
46
48
  const log = (level, line) => (level === 'debug' ? undefined : console.error(`${new Date().toISOString()} ${level} ${line}`));
@@ -99,10 +101,15 @@ async function accountRoom() {
99
101
  const found = (Array.isArray(listing) ? listing : listing.rooms ?? []).map((entry) => entry.room ?? entry).find((room) => room?.key === key && room.state === 'active');
100
102
  if (found) return String(found.roomId);
101
103
  if (!values.principal) throw new Error(`no active Room with key ${key}, and no --principal to open it for`);
104
+ // the Room's shape and the seats' role are the organization's (its floor names them), never this door's
105
+ const missing = ['preset', 'role'].filter((name) => !values[name]);
106
+ if (missing.length) throw new Error(`no active Room with key ${key}; opening one needs ${missing.map((name) => `--${name}`).join(' and ')} from the organization's floor (the preset the Room is made from and the role its principal and agent hold)`);
107
+ const seated = [...new Set([values.principal, adapter.principalId()])];
102
108
  const { room } = await post('/rooms', {
103
109
  key,
110
+ presetId: values.preset,
104
111
  name: values['room-name'] ?? `${values.agent}`,
105
- members: [{ principalId: values.principal, roleKeys: ['operator'] }],
112
+ members: seated.map((principalId) => ({ principalId, roleKeys: [values.role] })),
106
113
  });
107
114
  const view = await adapter.get(`/rooms/${encodeURIComponent(room.roomId)}`);
108
115
  const conversation = view.room?.defaultConversationId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.68",
3
+ "version": "0.5.69",
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": {