@xema/omni-protocol 0.1.105 → 0.1.107

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/README.md CHANGED
@@ -11,7 +11,8 @@ system.
11
11
 
12
12
  | Path | |
13
13
  | --- | --- |
14
- | `guide.md` | **The protocol.** Rules, shapes, and the reasoning behind them. |
14
+ | `guide.md` | **The protocol.** The terms, the shapes, the rules, and how an adapter is declared, connected and held to them. |
15
+ | `guide/` | One file per role and channel: `agent.md`, `lead.md`, `breaks.md`, `phone.md`, `voice.md`, `chat.md`, `email.md`. Each points back into `guide.md` for what it relies on. |
15
16
  | `src/index.ts` | The TypeScript declarations. |
16
17
  | `src/validation.ts` | Runtime validators Omni applies to adapter output. |
17
18
  | `src/testing.ts` | Conformance helpers an adapter runs against its own test state. |
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type Adapter, type AuthenticationState, type ProviderEventEnvelope, type Snapshot, type Task, type TaskCompletion, type BreakStatus, type BrowserSessionKeyInput, type Channel, type ConnectContext, type Host, type HostGuarantees, type HostMute, type LoginStore, type HostReport, type Manifest, type ProviderEvent } from "./index.js";
1
+ import { type Adapter, type AuthenticationState, type ProviderEventEnvelope, type Snapshot, type Task, type BreakStatus, type BrowserSessionKeyInput, type Channel, type ConnectContext, type Host, type HostGuarantees, type HostMute, type LoginStore, type HostReport, type Manifest, type ProviderEvent } from "./index.js";
2
2
  import { type ProtocolViolation } from "./validation.js";
3
3
  export { ProtocolConformanceError, assertNoViolations, type ProtocolViolation } from "./validation.js";
4
4
  /**
@@ -276,15 +276,6 @@ export interface BreakOnTaskStep {
276
276
  * outstanding -- never beside a task, and never later than the step that has none.
277
277
  */
278
278
  export declare function assertBreakBeginsAfterTask(steps: readonly BreakOnTaskStep[]): void;
279
- /**
280
- * Validates the deadline derived from audio end and the task's fixed wrap allowance.
281
- *
282
- * A task with no allowance has no deadline, so `observedDeadline` must then be `undefined`: a
283
- * host counting down what the provider left open is the violation, and so is a host counting
284
- * nothing down when the provider set a clock. `toleranceMs` absorbs scheduler jitter in a real
285
- * implementation; pass 0 to demand an exact match.
286
- */
287
- export declare function assertWrapTimeout(task: Pick<TaskCompletion, "completionMode" | "wrapAllowance">, audioEndedAt: string, observedDeadline: string | undefined, toleranceMs?: number): void;
288
279
  /** One browser in one task of one provider. `providerId` is `Manifest.id`, never `displayName`. */
289
280
  export type BrowserIsolationScenario = BrowserSessionKeyInput;
290
281
  /** Validates whether two task-browser definitions should share one browser session. */
package/dist/testing.js CHANGED
@@ -2207,33 +2207,6 @@ export function assertBreakBeginsAfterTask(steps) {
2207
2207
  throw new Error(`Break-on-task scenario must end in effect, ended ${String(steps.at(-1)?.approval)}`);
2208
2208
  }
2209
2209
  }
2210
- /**
2211
- * Validates the deadline derived from audio end and the task's fixed wrap allowance.
2212
- *
2213
- * A task with no allowance has no deadline, so `observedDeadline` must then be `undefined`: a
2214
- * host counting down what the provider left open is the violation, and so is a host counting
2215
- * nothing down when the provider set a clock. `toleranceMs` absorbs scheduler jitter in a real
2216
- * implementation; pass 0 to demand an exact match.
2217
- */
2218
- export function assertWrapTimeout(task, audioEndedAt, observedDeadline, toleranceMs = 1_000) {
2219
- if (task.wrapAllowance === undefined) {
2220
- if (observedDeadline !== undefined) {
2221
- throw new Error(`Wrap deadline mismatch: the task states no allowance, so there is no deadline, received ${observedDeadline}`);
2222
- }
2223
- return;
2224
- }
2225
- if (observedDeadline === undefined) {
2226
- throw new Error(`Wrap deadline mismatch: the task allows ${task.wrapAllowance}s, but no deadline was observed`);
2227
- }
2228
- const ended = Date.parse(audioEndedAt);
2229
- const deadline = Date.parse(observedDeadline);
2230
- if (Number.isNaN(ended) || Number.isNaN(deadline))
2231
- throw new Error("Wrap scenario requires valid ISO-8601 times");
2232
- const expected = ended + task.wrapAllowance * 1_000;
2233
- if (Math.abs(deadline - expected) > toleranceMs) {
2234
- throw new Error(`Wrap deadline mismatch: expected ${new Date(expected).toISOString()} within ${toleranceMs}ms, received ${observedDeadline}`);
2235
- }
2236
- }
2237
2210
  /** The session key one scenario derives, or `undefined` where the browser shares nothing. */
2238
2211
  const sessionKeyFor = (scenario) => browserSessionKey(scenario);
2239
2212
  /** Validates whether two task-browser definitions should share one browser session. */