@xema/omni-protocol 0.1.33 → 0.1.34

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 CHANGED
@@ -76,11 +76,12 @@ export interface DialCapability {
76
76
  }
77
77
  /**
78
78
  * How a dial ended, as the switch distinguishes it. `answered` is the one success; the rest are
79
- * the ways a destination was not reached. A manifest declares which of these its platform can
80
- * tell apart (`dialOutcomes`), and a `dial-outcome` carries only a declared one.
79
+ * the ways a destination was not reached -- `cancelled` because the dialler called it off before
80
+ * anyone answered, not because the destination failed to. A manifest declares which of these its
81
+ * platform can tell apart (`dialOutcomes`), and a `dial-outcome` carries only a declared one.
81
82
  */
82
- export type DialOutcome = "answered" | "busy" | "no-answer" | "unreachable" | "rejected";
83
- export declare const DIAL_OUTCOMES: readonly ["answered", "busy", "no-answer", "unreachable", "rejected"];
83
+ export type DialOutcome = "answered" | "busy" | "no-answer" | "unreachable" | "rejected" | "cancelled";
84
+ export declare const DIAL_OUTCOMES: readonly ["answered", "busy", "no-answer", "unreachable", "rejected", "cancelled"];
84
85
  /** Every idle capability a provider may declare. Only voice may `dial`; the channel arm says so. */
85
86
  export declare const IDLE_CAPABILITIES: readonly ["dial", "personalBrowser", "calendar", "contacts"];
86
87
  export type IdleCapability = (typeof IDLE_CAPABILITIES)[number];
@@ -1212,9 +1213,10 @@ export type ProviderEvent<C extends Channel = Channel> = {
1212
1213
  }
1213
1214
  /**
1214
1215
  * How a dial the host placed ended, once, either way -- `answered` is stated, never read off
1215
- * somebody appearing on the call. `taskId` where the dial was on a task, and that task may
1216
- * already have ended: a dial placed late routinely outlives its call. `reason` is the switch's
1217
- * own words, shown to the agent as such.
1216
+ * somebody appearing on the call, and says what happened to the dial; who is on the call is
1217
+ * `Task.onCall`. `taskId` is the task the dial was placed on, resolved from the dial and never
1218
+ * from what the agent is looking at, and that task may already have ended: a dial placed late
1219
+ * routinely outlives its call. `reason` is the switch's own words, shown to the agent as such.
1218
1220
  */
1219
1221
  | {
1220
1222
  type: "dial-outcome";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ export function negotiateProtocolVersion(adapterVersions, hostVersions = OMNI_SU
15
15
  const shared = adapterVersions.filter(version => host.has(version));
16
16
  return shared.length === 0 ? undefined : Math.max(...shared);
17
17
  }
18
- export const DIAL_OUTCOMES = ["answered", "busy", "no-answer", "unreachable", "rejected"];
18
+ export const DIAL_OUTCOMES = ["answered", "busy", "no-answer", "unreachable", "rejected", "cancelled"];
19
19
  /** Every idle capability a provider may declare. Only voice may `dial`; the channel arm says so. */
20
20
  export const IDLE_CAPABILITIES = ["dial", "personalBrowser", "calendar", "contacts"];
21
21
  /** What Omni calls each idle capability. */
@@ -67,7 +67,7 @@ const ACCESS_APPLIES_TO = membersOf({
67
67
  "initial-url": true, "all-navigation": true,
68
68
  });
69
69
  const DIAL_DESTINATION_POLICIES = membersOf({ "contacts-only": true, "any-number": true });
70
- const DIAL_OUTCOMES = membersOf({ answered: true, busy: true, "no-answer": true, unreachable: true, rejected: true });
70
+ const DIAL_OUTCOMES = membersOf({ answered: true, busy: true, "no-answer": true, unreachable: true, rejected: true, cancelled: true });
71
71
  const ON_CALL_ROLES = membersOf({ party: true, agent: true, consulted: true, conferenced: true });
72
72
  /** The task capabilities under which a command dials, and so need the manifest to say how a dial ends. */
73
73
  const DIALLING_CAPABILITIES = ["callback", "blindTransfer", "consultTransfer", "conference"];
package/guide.md CHANGED
@@ -165,7 +165,7 @@ type DialDestinations = "contacts-only" | "any-number";
165
165
 
166
166
  type DialCapability = { destinations: DialDestinations };
167
167
 
168
- type DialOutcome = "answered" | "busy" | "no-answer" | "unreachable" | "rejected";
168
+ type DialOutcome = "answered" | "busy" | "no-answer" | "unreachable" | "rejected" | "cancelled";
169
169
 
170
170
  type IdleCapabilities<C extends Channel = Channel> = {
171
171
  personalBrowser?: PersonalBrowserCapability;
@@ -2779,12 +2779,23 @@ nothing, is refused (`result.status`). `validateResult(result, method, path, dia
2779
2779
 
2780
2780
  **The outcome is stated, once, either way.** A `dial-outcome` names the `dialId`, the task where
2781
2781
  there was one, the destination where the provider knows it, and how the dial ended -- from a closed
2782
- set: `answered`, `busy`, `no-answer`, `unreachable`, `rejected`. `answered` is stated rather than
2783
- read off somebody appearing on the call, because a host that infers success cannot tell "reached"
2784
- from "still ringing". `reason` is the switch's own words, optional, and shown to the agent
2785
- attributed to the switch rather than to Omni. The task named may already have ended, and the
2786
- harness places the outcome all the same (`TaskStream`, `stream.dialOutcome.unknown`,
2787
- `stream.dialOutcome.duplicate`); an agent who moved on still learns nobody was reached.
2782
+ set: `answered`, `busy`, `no-answer`, `unreachable`, `rejected`, `cancelled`. `answered` is stated
2783
+ rather than read off somebody appearing on the call, because a host that infers success cannot tell
2784
+ "reached" from "still ringing". `cancelled` is the dialler calling the dial off before anyone
2785
+ answered -- the agent hanging up while a consult still rings -- which is not a `no-answer` the
2786
+ destination never gave. `reason` is the switch's own words, optional, and shown to the agent
2787
+ attributed to the switch rather than to Omni.
2788
+
2789
+ **`taskId` is the task the dial was placed on**, resolved from the dial's own identity and never from
2790
+ whatever task the agent is looking at when the outcome arrives. That task may already have ended,
2791
+ and the harness places the outcome all the same (`TaskStream`, `stream.dialOutcome.unknown`,
2792
+ `stream.dialOutcome.duplicate`); an agent who moved on still learns nobody was reached, against the
2793
+ call it belonged to and never against the next one.
2794
+
2795
+ **`answered` says what happened to the dial; `onCall` says who is in the room.** They are two
2796
+ claims, and both are true at once when a leg answers and never joins. A desk shows `answered` as the
2797
+ dial's conclusion and says "on the call" only when the person appears on `Task.onCall`; the obvious
2798
+ reading of `answered` -- that they are on the line -- is the one it does not make.
2788
2799
 
2789
2800
  **A provider says which outcomes it can tell apart.** No switch distinguishes all five, and a
2790
2801
  provider that cannot tell busy from unreachable must not pick one. The manifest declares
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xema/omni-protocol",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "The Omni protocol: the contract every provider adapter implements",
5
5
  "type": "module",
6
6
  "license": "MIT",