@xema/omni-protocol 0.1.39 → 0.1.40

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
@@ -447,10 +447,10 @@ export type TaskCapabilities<C extends Channel = Channel> = C extends "voice" ?
447
447
  conference?: Lockable<true | DestinationDirectory>;
448
448
  recording?: Lockable<true>;
449
449
  } : C extends "chat" ? SharedTaskCapabilities & {
450
- reject?: Lockable<true>;
450
+ decline?: Lockable<true>;
451
451
  hold?: Lockable<true>;
452
452
  } : SharedTaskCapabilities & {
453
- reject?: Lockable<true>;
453
+ decline?: Lockable<true>;
454
454
  };
455
455
  /**
456
456
  * How a reusing browser's session is keyed.
@@ -731,8 +731,8 @@ export type TaskOutcome = {
731
731
  };
732
732
  export declare const TASK_COMMAND_NAMES: {
733
733
  readonly voice: readonly ["answer", "decline", "start-call", "mute", "hold", "resume", "disconnect", "connect-back", "transfer", "lead-assist", "conference", "recording", "complete"];
734
- readonly chat: readonly ["accept", "reject", "pause", "resume", "complete"];
735
- readonly email: readonly ["accept", "reject", "complete"];
734
+ readonly chat: readonly ["accept", "decline", "pause", "resume", "complete"];
735
+ readonly email: readonly ["accept", "decline", "complete"];
736
736
  };
737
737
  export type TaskCommandName<C extends keyof typeof TASK_COMMAND_NAMES> = (typeof TASK_COMMAND_NAMES)[C][number];
738
738
  export interface DispositionPayload {
@@ -826,7 +826,7 @@ export type VoiceTaskCommand = {
826
826
  export type ChatTaskCommand = {
827
827
  type: "accept";
828
828
  } | {
829
- type: "reject";
829
+ type: "decline";
830
830
  } | {
831
831
  type: "pause";
832
832
  } | {
@@ -837,7 +837,7 @@ export type ChatTaskCommand = {
837
837
  export type EmailTaskCommand = {
838
838
  type: "accept";
839
839
  } | {
840
- type: "reject";
840
+ type: "decline";
841
841
  } | ({
842
842
  type: "complete";
843
843
  } & DispositionPayload);
package/dist/index.js CHANGED
@@ -72,8 +72,8 @@ export function effectiveLevels(declared) {
72
72
  export const TASK_COMMAND_NAMES = {
73
73
  voice: ["answer", "decline", "start-call", "mute", "hold", "resume", "disconnect",
74
74
  "connect-back", "transfer", "lead-assist", "conference", "recording", "complete"],
75
- chat: ["accept", "reject", "pause", "resume", "complete"],
76
- email: ["accept", "reject", "complete"],
75
+ chat: ["accept", "decline", "pause", "resume", "complete"],
76
+ email: ["accept", "decline", "complete"],
77
77
  };
78
78
  /** The dial a command places, by the host's identity for it; `undefined` for a command that dials nothing. */
79
79
  export function commandDialId(command) {
@@ -96,8 +96,8 @@ const TASK_CAPABILITIES = {
96
96
  browsers: true, dispositions: true, custom: true, decline: true, mute: true, hold: true,
97
97
  agentDisconnect: true, connectBack: true, blindTransfer: true, consultTransfer: true, leadAssist: true, conference: true, recording: true,
98
98
  }),
99
- chat: membersOf({ browsers: true, dispositions: true, custom: true, reject: true, hold: true }),
100
- email: membersOf({ browsers: true, dispositions: true, custom: true, reject: true }),
99
+ chat: membersOf({ browsers: true, dispositions: true, custom: true, decline: true, hold: true }),
100
+ email: membersOf({ browsers: true, dispositions: true, custom: true, decline: true }),
101
101
  };
102
102
  // The published list and the type's keys are the same set, or one of them is wrong.
103
103
  true;
package/guide.md CHANGED
@@ -484,8 +484,8 @@ type TaskCapabilities<C extends Channel = Channel> =
484
484
  recording?: Lockable<true>;
485
485
  }
486
486
  : C extends "chat"
487
- ? SharedTaskCapabilities & { reject?: Lockable<true>; hold?: Lockable<true> }
488
- : SharedTaskCapabilities & { reject?: Lockable<true> };
487
+ ? SharedTaskCapabilities & { decline?: Lockable<true>; hold?: Lockable<true> }
488
+ : SharedTaskCapabilities & { decline?: Lockable<true> };
489
489
  ```
490
490
 
491
491
  The channel arms are why `Task<"email">` rejects `hold` at compile time rather than at runtime.
@@ -678,8 +678,8 @@ const TASK_COMMAND_NAMES = {
678
678
  "recording",
679
679
  "complete",
680
680
  ],
681
- chat: ["accept", "reject", "pause", "resume", "complete"],
682
- email: ["accept", "reject", "complete"],
681
+ chat: ["accept", "decline", "pause", "resume", "complete"],
682
+ email: ["accept", "decline", "complete"],
683
683
  } as const;
684
684
 
685
685
  type TaskCommandName<C extends keyof typeof TASK_COMMAND_NAMES> =
@@ -711,14 +711,14 @@ type VoiceTaskCommand =
711
711
 
712
712
  type ChatTaskCommand =
713
713
  | { type: "accept" }
714
- | { type: "reject" }
714
+ | { type: "decline" }
715
715
  | { type: "pause" }
716
716
  | { type: "resume" }
717
717
  | ({ type: "complete" } & DispositionPayload);
718
718
 
719
719
  type EmailTaskCommand =
720
720
  | { type: "accept" }
721
- | { type: "reject" }
721
+ | { type: "decline" }
722
722
  | ({ type: "complete" } & DispositionPayload);
723
723
 
724
724
  type CustomTaskCommand = { type: "custom"; name: string; [key: string]: unknown };
@@ -2561,7 +2561,7 @@ const taskCapabilities = {
2561
2561
 
2562
2562
  | Capability | Omni UI | Contract |
2563
2563
  | --- | --- | --- |
2564
- | `decline` | Pending-task button: Decline | The provider can decline a pending voice offer. Omni shows it only when provisioning also permits rejection. |
2564
+ | `decline` | Pending-task button: Decline | The provider can decline a pending voice offer. Omni shows it only when provisioning also permits declining. |
2565
2565
  | `mute` | Primary toggle: Mute | Omni may mute and unmute the agent's outbound audio. |
2566
2566
  | `hold` | Primary toggle: Hold | Omni may issue voice-task `hold` and `resume` commands. |
2567
2567
  | `agentDisconnect` | Primary button: Disconnect | Omni may disconnect real-time media without disposing the task. |
@@ -2679,7 +2679,7 @@ customer.
2679
2679
 
2680
2680
  | Capability | Omni UI | Contract |
2681
2681
  | --- | --- | --- |
2682
- | `reject` | Pending-task button: Reject | The provider can reject a pending chat offer. Omni shows it only when provisioning also permits rejection. |
2682
+ | `decline` | Pending-task button: Decline | The provider can decline a pending chat offer. Omni shows it only when provisioning also permits declining. |
2683
2683
  | `hold` | Primary toggle: Hold | Omni may pause and resume agent handling of the chat. |
2684
2684
  | `dispositions` | Primary button: Complete | Omni may request task disposal with a provider disposition and notes. |
2685
2685
 
@@ -2687,7 +2687,7 @@ customer.
2687
2687
 
2688
2688
  | Capability | Omni UI | Contract |
2689
2689
  | --- | --- | --- |
2690
- | `reject` | Pending-task button: Reject | The provider can reject a pending email offer. Omni shows it only when provisioning also permits rejection. |
2690
+ | `decline` | Pending-task button: Decline | The provider can decline a pending email offer. Omni shows it only when provisioning also permits declining. |
2691
2691
  | `dispositions` | Primary button: Complete | Omni may request task disposal with a provider disposition and notes. |
2692
2692
 
2693
2693
  ### Custom capabilities
@@ -3613,7 +3613,7 @@ declared:
3613
3613
  | Command | What makes it available |
3614
3614
  | --- | --- |
3615
3615
  | `answer`, `accept` | Nothing. A task that was offered can be accepted, or offering it meant nothing. |
3616
- | `decline`, `reject` | The channel's decline or reject capability, **and** Omni provisioning permitting rejection. |
3616
+ | `decline` | The `decline` capability on any channel, **and** Omni provisioning permitting it. One word for refusing an offer, whatever the channel. |
3617
3617
  | `start-call` | The `preparing` phase. It starts the contact a preview gave the agent time to read, so the phase is the gate and there is no capability. |
3618
3618
  | `complete` | `completionMode: "agent-command"`. The `dispositions` capability decides whether a code travels with the command, never whether the command exists — a task Omni cannot complete never ends. |
3619
3619
  | `connect-back` | The `connectBack` capability **and** the `completing` phase. It exists to reach the party again after the call, so it has no meaning while the call is up. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xema/omni-protocol",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "The Omni protocol: the contract every provider adapter implements",
5
5
  "type": "module",
6
6
  "license": "MIT",