@xema/omni-protocol 0.1.97 → 0.1.99
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 +132 -110
- package/dist/index.js +9 -19
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +41 -27
- package/dist/validation.d.ts +20 -6
- package/dist/validation.js +175 -202
- package/guide.md +247 -295
- package/package.json +1 -1
package/dist/validation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RecordingState, type ProtocolViolation, type UserCapabilities, type UserId } from "./index.js";
|
|
1
|
+
import { type RecordingState, type Channel, type ProtocolViolation, type UserCapabilities, type UserId } from "./index.js";
|
|
2
2
|
export type { ProtocolViolation } from "./index.js";
|
|
3
3
|
export declare class ProtocolConformanceError extends Error {
|
|
4
4
|
readonly violations: readonly ProtocolViolation[];
|
|
@@ -45,16 +45,23 @@ export interface TaskValidationContext {
|
|
|
45
45
|
* carry one of these. Unknown to a host, which never sees the value, and then unchecked.
|
|
46
46
|
*/
|
|
47
47
|
locked?: readonly string[];
|
|
48
|
+
/**
|
|
49
|
+
* A member's task on the team member list, trimmed by the provider: the workspace -- controls,
|
|
50
|
+
* their source, browsers, completion terms -- is the member's and may be absent; what is present
|
|
51
|
+
* is held to the same rules as on the member's own desk.
|
|
52
|
+
*/
|
|
53
|
+
member?: true;
|
|
48
54
|
}
|
|
49
55
|
export declare function validateTask(task: unknown, context: TaskValidationContext, path?: string): ProtocolViolation[];
|
|
50
56
|
/** Checks break status against the full currently retained task set, after a transaction. */
|
|
51
57
|
export declare function validateBreakStatus(state: unknown, tasks: unknown, path?: string): ProtocolViolation[];
|
|
52
58
|
/**
|
|
53
|
-
* Checks lead
|
|
54
|
-
* for force-break
|
|
55
|
-
*
|
|
59
|
+
* Checks a lead command before dispatch, against the current authentication, transport and team
|
|
60
|
+
* member list (`team`) and, for force-break and end-forced-break, the target's full `memberBreak`.
|
|
61
|
+
* The authority is the login's `lead` flag; the provider rechecks the target and the state
|
|
62
|
+
* atomically, since a team member list is not authority to act after it has changed.
|
|
56
63
|
*/
|
|
57
|
-
export declare function
|
|
64
|
+
export declare function validateTeamCommand(request: unknown, context: unknown, path?: string): ProtocolViolation[];
|
|
58
65
|
/** The four agent break methods; this is a validation API, not a wire command. */
|
|
59
66
|
export type BreakMethod = "requestBreak" | "commitBreak" | "cancelBreak" | "endBreak";
|
|
60
67
|
/**
|
|
@@ -90,6 +97,13 @@ export interface ReaderContext {
|
|
|
90
97
|
levels?: readonly string[];
|
|
91
98
|
/** The login's `loginId`. A snapshot or event naming another belongs to a login that is gone. */
|
|
92
99
|
loginId?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the lead has the team feature on, as the application last told the provider. On by
|
|
102
|
+
* default for a lead; off, no team member list is owed or expected. Unknown to a caller without it.
|
|
103
|
+
*/
|
|
104
|
+
leadFeatures?: boolean;
|
|
105
|
+
/** The provider's channel, for a member's task that states none. Filled from the manifest by `validateSnapshot` and `validateEventEnvelope`. */
|
|
106
|
+
channel?: Channel;
|
|
93
107
|
/**
|
|
94
108
|
* The values the queue locked on this login's tasks, as whoever runs the validator knows them:
|
|
95
109
|
* a conformance run states them, a host never has them. Where a task's party stands locked, no
|
|
@@ -135,7 +149,7 @@ export declare function validateTaskCommandRequest(request: unknown, task: unkno
|
|
|
135
149
|
*/
|
|
136
150
|
export declare function validateTaskCommand(command: unknown, task?: unknown, path?: string, taskContext?: Omit<TaskValidationContext, "channel">): ProtocolViolation[];
|
|
137
151
|
/** The connection methods whose results `validateResult` knows. */
|
|
138
|
-
export type ResultMethod = "execute" | "dial" | "setCapacity" | "requestBreak" | "commitBreak" | "cancelBreak" | "endBreak" | "
|
|
152
|
+
export type ResultMethod = "execute" | "dial" | "setCapacity" | "requestBreak" | "commitBreak" | "cancelBreak" | "endBreak" | "executeTeam" | "openMedia" | "setPreference" | "recordStep";
|
|
139
153
|
/**
|
|
140
154
|
* Validates what a connection method answered. A result is untrusted for the same reason a
|
|
141
155
|
* snapshot is: it comes from an adapter that may be compiled against another version, and Omni
|