@xema/omni-protocol 0.1.86 → 0.1.88
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/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/validation.js +3 -3
- package/guide.md +31 -16
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -244,8 +244,8 @@ export interface TeamCapabilities {
|
|
|
244
244
|
/** This lead may join a member's call on request. Requires `executeTeamLeadAssist`. */
|
|
245
245
|
leadAssistControl?: true;
|
|
246
246
|
/**
|
|
247
|
-
* This lead may listen to a member's call unasked, in these modes and no others.
|
|
248
|
-
*
|
|
247
|
+
* This lead may listen to a member's call unasked, in these modes and no others. Coach and
|
|
248
|
+
* join-call begin from a monitor, so the list always includes `monitor`. Nothing of it reaches the
|
|
249
249
|
* member's task. Requires `executeTeamMonitor`.
|
|
250
250
|
*/
|
|
251
251
|
monitorControl?: MonitorMode[];
|
|
@@ -254,10 +254,10 @@ export interface TeamCapabilities {
|
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
256
|
* How a lead listening to a member's call is heard: `monitor` hears both sides in silence,
|
|
257
|
-
* `
|
|
257
|
+
* `coach` is heard by the agent alone, `join-call` by everyone on the call.
|
|
258
258
|
*/
|
|
259
|
-
export type MonitorMode = "monitor" | "
|
|
260
|
-
export declare const MONITOR_MODES: readonly ["monitor", "
|
|
259
|
+
export type MonitorMode = "monitor" | "coach" | "join-call";
|
|
260
|
+
export declare const MONITOR_MODES: readonly ["monitor", "coach", "join-call"];
|
|
261
261
|
/**
|
|
262
262
|
* What this login may do, beyond any one task. It travels with the identity because it is part
|
|
263
263
|
* of who the agent is on this provider: the provider knows the roles and says so at sign-in.
|
|
@@ -1373,16 +1373,16 @@ export interface TeamLeadAssistCommandRequest {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
/**
|
|
1375
1375
|
* A lead listening to a member's call. `monitor` starts one, silent, on a member from the team member list;
|
|
1376
|
-
* `
|
|
1376
|
+
* `coach` and `join-call` change how the standing one is heard; `leave` ends it. One member at a
|
|
1377
1377
|
* time, and only the modes the login's `monitorControl` lists.
|
|
1378
1378
|
*/
|
|
1379
1379
|
export type TeamMonitorCommand = {
|
|
1380
1380
|
type: "monitor";
|
|
1381
1381
|
memberId: UserId;
|
|
1382
1382
|
} | {
|
|
1383
|
-
type: "
|
|
1383
|
+
type: "coach";
|
|
1384
1384
|
} | {
|
|
1385
|
-
type: "
|
|
1385
|
+
type: "join-call";
|
|
1386
1386
|
} | {
|
|
1387
1387
|
type: "leave";
|
|
1388
1388
|
};
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export const IDLE_CAPABILITY_UI = {
|
|
|
26
26
|
calendar: "Calendar",
|
|
27
27
|
contacts: "Contacts",
|
|
28
28
|
};
|
|
29
|
-
export const MONITOR_MODES = ["monitor", "
|
|
29
|
+
export const MONITOR_MODES = ["monitor", "coach", "join-call"];
|
|
30
30
|
export const MUTED_BY = ["host", "station"];
|
|
31
31
|
export const HOST_MUTES = ["stream", "station"];
|
|
32
32
|
export const RECORDING_ACTIONS = ["start", "pause", "resume", "stop", "cancel"];
|
package/dist/validation.js
CHANGED
|
@@ -88,7 +88,7 @@ const OFFERABLE_PHASES = membersOf({
|
|
|
88
88
|
const PREVIEW_DEADLINES = membersOf({ calls: true, "host-calls": true, waits: true });
|
|
89
89
|
const PHONES = membersOf({ softphone: true, deskPhone: true });
|
|
90
90
|
const TEAM_CAPABILITIES = membersOf({ breakControl: true, leadAssistControl: true, policyControl: true, monitorControl: true });
|
|
91
|
-
const MONITOR_MODES = membersOf({ monitor: true,
|
|
91
|
+
const MONITOR_MODES = membersOf({ monitor: true, coach: true, "join-call": true });
|
|
92
92
|
const COMPLETED_BY = membersOf({ agent: true, provider: true });
|
|
93
93
|
const CANCELLED_BY = membersOf({ agent: true, provider: true, party: true });
|
|
94
94
|
const EXPIRABLE_PHASES = membersOf({
|
|
@@ -2716,7 +2716,7 @@ function validateUserCapabilitiesInto(value, path, into, levels) {
|
|
|
2716
2716
|
}
|
|
2717
2717
|
}
|
|
2718
2718
|
/**
|
|
2719
|
-
* The modes a lead may listen in, as a list:
|
|
2719
|
+
* The modes a lead may listen in, as a list: coach and join-call begin from a monitor, so a list
|
|
2720
2720
|
* without `monitor` names modes the lead could never reach.
|
|
2721
2721
|
*/
|
|
2722
2722
|
function validateMonitorControl(value, path, into) {
|
|
@@ -2729,7 +2729,7 @@ function validateMonitorControl(value, path, into) {
|
|
|
2729
2729
|
into.add("authentication.capability.team.monitorControl.unique", `${path}[${index}]`, `duplicate monitor mode: ${describeValue(mode)}`);
|
|
2730
2730
|
}
|
|
2731
2731
|
});
|
|
2732
|
-
into.require(value.includes("monitor"), "authentication.capability.team.monitorControl.monitor", path, "
|
|
2732
|
+
into.require(value.includes("monitor"), "authentication.capability.team.monitorControl.monitor", path, "coach and join-call begin from a monitor: a lead who may listen in any mode may monitor");
|
|
2733
2733
|
}
|
|
2734
2734
|
/**
|
|
2735
2735
|
* A failure an authentication reports: on a `rejected` start or completion, or on an `expired`
|
package/guide.md
CHANGED
|
@@ -40,7 +40,7 @@ are used precisely throughout and mean nothing looser here.
|
|
|
40
40
|
| **Break** | A reported, supervised state in which the agent is not working — one with a reason, a decision behind it and a return. It covers what a platform may call *not-ready*, including equipment trouble. An agent who is merely at capacity is not on a break. |
|
|
41
41
|
| **Workspace** | What Omni shows the agent. The **task workspace** holds the selected task, its controls and its browsers; the **idle workspace** holds what a provider contributes when no task is selected — dialpad, contacts, calendar, team member list. |
|
|
42
42
|
| **Dial** | One outbound call the host asks a provider to place — from the idle dialpad, a cold or warm transfer, a conference add, or a connect-back. Identified by the host's `dialId`, accepted as `dialling`, and ended by exactly one `dial-outcome`. See **Every dial has an outcome**. |
|
|
43
|
-
| **Monitor** | A lead listening to a member's call unasked, from the team member list: `monitor` in silence, `
|
|
43
|
+
| **Monitor** | A lead listening to a member's call unasked, from the team member list: `monitor` in silence, `coach` heard by the agent alone, `join-call` heard by everyone. Nothing of it reaches the member's task, and there is no take-over in it. See **Monitoring a call**. |
|
|
44
44
|
| **On the call** | Who a voice task's audio joins, or is bringing in, as the provider states it on `Task.onCall`: the party, the agents, and anyone consulted or conferenced in from the moment their dial is placed. |
|
|
45
45
|
|
|
46
46
|
Six words describe *what state a thing is in*, and they are not interchangeable: each belongs to
|
|
@@ -246,7 +246,7 @@ type AuthenticationContext = {
|
|
|
246
246
|
log?: (entry: unknown) => void;
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
-
type MonitorMode = "monitor" | "
|
|
249
|
+
type MonitorMode = "monitor" | "coach" | "join-call";
|
|
250
250
|
|
|
251
251
|
type TeamCapabilities = {
|
|
252
252
|
breakControl?: true;
|
|
@@ -1049,8 +1049,8 @@ type TeamLeadAssistCommandRequest = {
|
|
|
1049
1049
|
|
|
1050
1050
|
type TeamMonitorCommand =
|
|
1051
1051
|
| { type: "monitor"; memberId: UserId }
|
|
1052
|
-
| { type: "
|
|
1053
|
-
| { type: "
|
|
1052
|
+
| { type: "coach" }
|
|
1053
|
+
| { type: "join-call" }
|
|
1054
1054
|
| { type: "leave" };
|
|
1055
1055
|
|
|
1056
1056
|
type TeamMonitorCommandRequest = {
|
|
@@ -1926,7 +1926,7 @@ them from what arrives later.
|
|
|
1926
1926
|
| `team` | This login leads a team. The provider publishes a `TeamMembers` object to it on every snapshot — `members: []` when nobody is in it — and to nobody else. |
|
|
1927
1927
|
| `team.breakControl` | This lead may act on their team's breaks through `executeTeamBreak` — place, release, decide, set policy — as far as the provider supports; a command it lacks answers `omni.capability-not-enabled`. Omni asks for a decision only against a member whose `break` is `awaiting-decision`, so a provider that grants on request is never asked to decide. Requires `executeTeamBreak`. |
|
|
1928
1928
|
| `team.leadAssistControl` | This lead may join a member's call on request. Requires `executeTeamLeadAssist`. |
|
|
1929
|
-
| `team.monitorControl` | This lead may listen to a member's call unasked, in the listed modes and no others: `monitor`, `
|
|
1929
|
+
| `team.monitorControl` | This lead may listen to a member's call unasked, in the listed modes and no others: `monitor`, `coach`, `join-call`. The list always includes `monitor`, since the other two begin from one. Requires `executeTeamMonitor`. See **Monitoring a call**. |
|
|
1930
1930
|
| `team.policyControl` | This lead sets the team's policy per capability — on, off, or the person's — within what the queue allows. Requires `executeTeamPolicy`; the team member list carries `policies`. |
|
|
1931
1931
|
| `preferences` | What the team left to this person, with where each stands and who set it. Omitted when nothing was. Requires `setPreference`. See **Who decides what an agent may do**. |
|
|
1932
1932
|
|
|
@@ -4185,21 +4185,35 @@ Lead and member alike are `UserId`s of this provider, so an adapter publishing t
|
|
|
4185
4185
|
|
|
4186
4186
|
### Monitoring a call
|
|
4187
4187
|
|
|
4188
|
+
**Coach** lets the lead speak privately to the agent; the caller cannot hear the lead.
|
|
4189
|
+
The command and monitoring mode are `coach`. Migration: replace the former whisper literal
|
|
4190
|
+
in `TeamMonitorCommand`, `MonitorMode`, `team.monitorControl`, and the task’s `monitoring.mode`.
|
|
4191
|
+
`MONITOR_MODES` exports `coach`; update command producers, permissions and retained snapshots
|
|
4192
|
+
together. No legacy alias is accepted. The lead must already be monitoring and permitted to
|
|
4193
|
+
coach. This mode does not join the audible caller conversation or take over the task.
|
|
4194
|
+
|
|
4195
|
+
The user-facing action is **Join call**. The command and monitoring mode are `join-call`.
|
|
4196
|
+
Migration: replace the former barge literal in `TeamMonitorCommand`, `MonitorMode`,
|
|
4197
|
+
`team.monitorControl`, and the task’s `monitoring.mode`. `MONITOR_MODES` exports the new literal;
|
|
4198
|
+
no legacy alias is accepted. Update commands, capability declarations and retained snapshots
|
|
4199
|
+
together. The lead must already be monitoring and permitted to use this mode. Everyone on the
|
|
4200
|
+
call hears the lead; this does not transfer ownership or invoke lead-assist takeover.
|
|
4201
|
+
|
|
4188
4202
|
A lead may listen to a member's call without being asked -- to coach, to check quality, to step in
|
|
4189
4203
|
when it goes wrong. This is not lead assist: nobody requested it, the member's task says nothing
|
|
4190
4204
|
about it, and there is no take-over in it. A lead who wants the call itself uses lead assist. The
|
|
4191
|
-
three modes
|
|
4205
|
+
three modes determine who hears the lead:
|
|
4192
4206
|
|
|
4193
4207
|
| Mode | Who hears the lead |
|
|
4194
4208
|
| --- | --- |
|
|
4195
4209
|
| `monitor` | Nobody. The lead hears both sides in silence. |
|
|
4196
|
-
| `
|
|
4197
|
-
| `
|
|
4210
|
+
| `coach` | The agent alone. The customer hears nothing. |
|
|
4211
|
+
| `join-call` | Everyone on the call. |
|
|
4198
4212
|
|
|
4199
4213
|
The login says which modes this lead has, as a list on `team.monitorControl`, and it always
|
|
4200
|
-
includes `monitor`, because
|
|
4214
|
+
includes `monitor`, because coach and join-call begin from one
|
|
4201
4215
|
(`authentication.capability.team.monitorControl.monitor`). A centre that lets every lead listen but
|
|
4202
|
-
reserves
|
|
4216
|
+
reserves joining the call declares `["monitor", "coach"]`, and Omni offers no Join call to that lead. The
|
|
4203
4217
|
declaration requires `executeTeamMonitor`, gated exactly as `executeTeamLeadAssist` is by
|
|
4204
4218
|
`team.leadAssistControl`.
|
|
4205
4219
|
|
|
@@ -4212,8 +4226,8 @@ executeTeamMonitor({ command: { type: "monitor", memberId: "A-1" } })
|
|
|
4212
4226
|
// monitoring: { memberId: "A-1", taskId: "call-42", allocationId: "alloc-42", mode: "monitor", since }
|
|
4213
4227
|
|
|
4214
4228
|
// 3. The lead changes how they are heard; the provider restates the task with the new mode.
|
|
4215
|
-
executeTeamMonitor({ command: { type: "
|
|
4216
|
-
executeTeamMonitor({ command: { type: "
|
|
4229
|
+
executeTeamMonitor({ command: { type: "coach" } })
|
|
4230
|
+
executeTeamMonitor({ command: { type: "join-call" } })
|
|
4217
4231
|
|
|
4218
4232
|
// 4. The lead leaves; their task ends with `{ type: "left" }`. The member's call goes on.
|
|
4219
4233
|
executeTeamMonitor({ command: { type: "leave" } })
|
|
@@ -4221,9 +4235,10 @@ executeTeamMonitor({ command: { type: "leave" } })
|
|
|
4221
4235
|
|
|
4222
4236
|
**The lead's task is what gives them audio**: Omni opens media on it as on any voice task, and the
|
|
4223
4237
|
provider bridges the lead's leg into the member's call in the mode stated. `monitoring.mode` is
|
|
4224
|
-
the state, restated on every change, and a `
|
|
4238
|
+
the state, restated on every change, and a `coach` or `join-call` the login's list does not include
|
|
4225
4239
|
is answered `failed`. **A lead listens to one call at a time** (`snapshot.monitoring.single`), and
|
|
4226
|
-
a task
|
|
4240
|
+
a task carries lead assistance or monitoring, never both (`task.monitoring.assisting`).
|
|
4241
|
+
The `join-call` mode still belongs to monitoring; it does not create `assisting`. The member's
|
|
4227
4242
|
call ending ends the lead's task as it ends the member's, with `left`, since the lead was never
|
|
4228
4243
|
working on it.
|
|
4229
4244
|
|
|
@@ -4238,7 +4253,7 @@ during a break whose active reason is of any other kind, or of no stated kind, i
|
|
|
4238
4253
|
listening during a break declares that break `coaching`, `administrative` or `training`.
|
|
4239
4254
|
|
|
4240
4255
|
**Nothing reaches the member.** The member's task carries no trace of a monitoring lead in any
|
|
4241
|
-
mode: not on `onCall`, not in the record. Whether
|
|
4256
|
+
mode: not on `onCall`, not in the record. Whether coaching is announced to the agent is the
|
|
4242
4257
|
platform's business and travels on the audio, not on this wire.
|
|
4243
4258
|
|
|
4244
4259
|
```ts
|
|
@@ -4246,7 +4261,7 @@ const monitoringLead = {
|
|
|
4246
4261
|
channel: "voice",
|
|
4247
4262
|
capabilities: {},
|
|
4248
4263
|
phase: "in-progress",
|
|
4249
|
-
monitoring: { memberId: "A-1", taskId: "call-42", allocationId: "alloc-42", mode: "
|
|
4264
|
+
monitoring: { memberId: "A-1", taskId: "call-42", allocationId: "alloc-42", mode: "coach", since: "2026-08-21T09:04:00Z" },
|
|
4250
4265
|
} satisfies Pick<Task<"voice">, "channel" | "capabilities" | "phase" | "monitoring">;
|
|
4251
4266
|
```
|
|
4252
4267
|
|