@xema/omni-protocol 0.1.136 → 0.1.137

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
@@ -812,6 +812,10 @@ export interface OutcomeCode {
812
812
  group?: string;
813
813
  }
814
814
  export interface OutcomeRules {
815
+ /**
816
+ * The agent's `complete` carries a code. A person's close chooses an outcome; only the provider's
817
+ * own close, when a `provider-automatic` wrap runs out, may carry none.
818
+ */
815
819
  required?: boolean;
816
820
  notes?: "required" | "optional" | "none";
817
821
  codes?: OutcomeCode[];
@@ -1374,11 +1374,6 @@ function validateTaskInto(task, context, path, into) {
1374
1374
  if (capabilities.browsers === true && Array.isArray(task.browsers) && task.browsers.length === 0) {
1375
1375
  into.add("task.browsers.required", `${path}.browsers`, "a task that declares capabilities.browsers supplies at least one; with none, omit the capability");
1376
1376
  }
1377
- // An outcome is given in wrap, by the agent: a provider that completes the task itself cannot
1378
- // wait for one, and a task with no wrap has nowhere to take one.
1379
- if (isPlainObject(capabilities.outcomes) && capabilities.outcomes.required === true) {
1380
- into.require(task.completionMode !== "provider-automatic", "task.outcomes.required.mode", `${path}.capabilities.outcomes.required`, "a required outcome is the agent's to give, so the task completes on the agent's command; provider-automatic completion cannot wait for it");
1381
- }
1382
1377
  // Under agent-command the allowance is the expected wrap, shown and never acted on: the agent
1383
1378
  // completes whenever they are done, so there is always a wrap to collect the code in.
1384
1379
  if (capabilities.outcomes !== undefined) {
package/guide/agent.md CHANGED
@@ -164,7 +164,7 @@ time. Runtime conformance checks also require the task channel to match its prov
164
164
  | `previewEndsInSeconds` | Voice only, in `preview`: how long the preparation has left, in whole seconds from this publication, restated on every publication that carries it. Absent, the agent has as long as they need without a preparation countdown. Always with `atDeadline`. See **Preview: the agent presses Call** in `guide/voice.md`. |
165
165
  | `atDeadline` | Voice only, in `preview`, with `previewEndsInSeconds`: what the system does when it runs out -- `provider-dials` makes the provider initiate dialing, `host-dials` makes the agent application issue Call, `waits` keeps the task in preview awaiting the agent. |
166
166
  | `reference` | Optional agent-facing reference such as a case, call, conversation, ticket, or message number. It is distinct from the protocol `id`. |
167
- | `completionMode` | `agent-command` waits for the channel's `complete` command; `provider-automatic` completes without one, and takes the agent's `complete` as finishing early. A required outcome is the agent's to give, so it needs `agent-command` (`task.outcomes.required.mode`). |
167
+ | `completionMode` | `agent-command` waits for the channel's `complete` command; `provider-automatic` completes without one, and takes the agent's `complete` as finishing early. A required outcome binds the agent's `complete` under either mode. |
168
168
  | `wrapAllowance` | Fixed time allowed to complete the task after primary interaction ends. For real-time audio, it begins after `task-audio-ended`. Required under `provider-automatic`, where the provider acts on it. Optional under `agent-command`: omitted says the provider imposes no deadline, and Omni counts nothing down; stated, it is the expected wrap, shown and never acted on. `0` under `provider-automatic` is no wrap at all, so such a task publishes no `outcomes` (`task.outcomes.wrapAllowance`). |
169
169
  | `wrapEndsInSeconds` | In `completing`, wherever `wrapAllowance` is stated: how much of the wrap is left, in whole seconds from this publication, restated on every publication that carries it (`task.completing.wrapEndsInSeconds`, `.required`, `.unexpected`). A reloaded agent computer and a lead's screen count down the same number. See **Completion timing**. |
170
170
  | `attributes` | Optional ordered, typed `TaskAttribute` entries with keys unique within the task. Each contact or timestamp is a separate array item; new attribute shapes require new union members. |
@@ -254,10 +254,17 @@ with no wrap at all -- `provider-automatic` with `wrapAllowance: 0` -- has nothi
254
254
  the command is refused there (`command.complete.wrapAllowance`). An ending the agent asked for says
255
255
  so, `completed` with `by: "agent"`, whichever mode the task was under.
256
256
 
257
- **A required outcome is the agent's to give.** A task whose `outcomes` says `required: true` waits
258
- for a code the agent chooses, so it completes on the agent's command: `provider-automatic` cannot
259
- wait for it, and the pair is refused (`task.outcomes.required.mode`). Optional outcomes may ride on
260
- a task the provider completes itself; the agent gives one if in time. And a code is given in wrap,
257
+ Migration: a required outcome under `provider-automatic` is no longer refused; the former
258
+ `task.outcomes.required.mode` rule is gone.
259
+
260
+ **A required outcome binds the agent's close.** `required: true` says the agent's `complete`
261
+ carries a code from the list (`command.complete.outcome.required`): a person who closes the task
262
+ chooses how it went. It says nothing about the provider's own close. Under `agent-command` the
263
+ task waits for the agent, so every close carries a code. Under `provider-automatic` the agent may
264
+ still close early, with a code, and when the wrap runs out the provider closes it with none, since
265
+ nobody chose one. The agent computer reads `required` and asks for a code before it sends
266
+ `complete`, so the agent is never told one is needed only after pressing it. Optional outcomes
267
+ ride on either mode; the agent gives one if they want to. And a code is given in wrap,
261
268
  so a `provider-automatic` task with `wrapAllowance: 0` publishes no `outcomes` at all
262
269
  (`task.outcomes.wrapAllowance`).
263
270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xema/omni-protocol",
3
- "version": "0.1.136",
3
+ "version": "0.1.137",
4
4
  "description": "The Omni protocol: the contract every provider adapter implements",
5
5
  "type": "module",
6
6
  "license": "MIT",