@sequenceholdings/agent-spec 0.1.1 → 0.1.3
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 +93 -0
- package/dist/agent-definition.d.ts +616 -0
- package/dist/agent-definition.js +240 -0
- package/dist/canonical-json.d.ts +2 -0
- package/dist/canonical-json.js +13 -0
- package/dist/index.d.ts +2 -117
- package/dist/index.js +2 -248
- package/dist/input-schema.d.ts +19 -0
- package/dist/input-schema.js +57 -0
- package/dist/voice-access.d.ts +40 -0
- package/dist/voice-access.js +34 -0
- package/dist/voice-actions-contracts.d.ts +423 -0
- package/dist/voice-actions-contracts.js +95 -0
- package/dist/voice-actions-transitions.d.ts +52 -0
- package/dist/voice-actions-transitions.js +170 -0
- package/dist/voice-actions.d.ts +2 -0
- package/dist/voice-actions.js +2 -0
- package/dist/voice-api.d.ts +1102 -0
- package/dist/voice-api.js +164 -0
- package/dist/voice-authoring.d.ts +463 -0
- package/dist/voice-authoring.js +132 -0
- package/dist/voice-authority-contracts.d.ts +247 -0
- package/dist/voice-authority-contracts.js +177 -0
- package/dist/voice-authority-evaluation.d.ts +29 -0
- package/dist/voice-authority-evaluation.js +80 -0
- package/dist/voice-authority-verification.d.ts +47 -0
- package/dist/voice-authority-verification.js +184 -0
- package/dist/voice-authority.d.ts +3 -0
- package/dist/voice-authority.js +3 -0
- package/dist/voice-common.d.ts +21 -0
- package/dist/voice-common.js +23 -0
- package/dist/voice-drafts.d.ts +441 -0
- package/dist/voice-drafts.js +75 -0
- package/dist/voice-grant.d.ts +19 -0
- package/dist/voice-grant.js +21 -0
- package/dist/voice-lifecycle-control.d.ts +130 -0
- package/dist/voice-lifecycle-control.js +138 -0
- package/dist/voice-lifecycle-session.d.ts +168 -0
- package/dist/voice-lifecycle-session.js +114 -0
- package/dist/voice-lifecycle-states.d.ts +96 -0
- package/dist/voice-lifecycle-states.js +139 -0
- package/dist/voice-lifecycle.d.ts +3 -0
- package/dist/voice-lifecycle.js +3 -0
- package/dist/voice-policy-duration.d.ts +46 -0
- package/dist/voice-policy-duration.js +166 -0
- package/dist/voice-policy-limits.d.ts +174 -0
- package/dist/voice-policy-limits.js +188 -0
- package/dist/voice-policy.d.ts +2 -0
- package/dist/voice-policy.js +2 -0
- package/dist/voice-provider-evidence.d.ts +80 -0
- package/dist/voice-provider-evidence.js +115 -0
- package/dist/voice-provider-publication.d.ts +319 -0
- package/dist/voice-provider-publication.js +117 -0
- package/dist/voice-provider-release.d.ts +386 -0
- package/dist/voice-provider-release.js +154 -0
- package/dist/voice-provider.d.ts +3 -0
- package/dist/voice-provider.js +3 -0
- package/dist/voice-release.d.ts +808 -0
- package/dist/voice-release.js +110 -0
- package/dist/voice-runs-audio.d.ts +157 -0
- package/dist/voice-runs-audio.js +85 -0
- package/dist/voice-runs-evidence.d.ts +183 -0
- package/dist/voice-runs-evidence.js +154 -0
- package/dist/voice-runs-model.d.ts +967 -0
- package/dist/voice-runs-model.js +199 -0
- package/dist/voice-runs-tooling.d.ts +88 -0
- package/dist/voice-runs-tooling.js +100 -0
- package/dist/voice-runs.d.ts +4 -0
- package/dist/voice-runs.js +4 -0
- package/dist/voice.d.ts +13 -0
- package/dist/voice.js +13 -0
- package/package.json +8 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type VoiceProviderDurationSettingMode } from './voice-policy-limits.js';
|
|
3
|
+
export declare const VOICE_SETUP_ALLOWANCE_SECONDS = 120;
|
|
4
|
+
export declare const voiceCallDurationSnapshotSchema: z.ZodObject<{
|
|
5
|
+
policyRevision: z.ZodNumber;
|
|
6
|
+
admittedAt: z.ZodISODateTime;
|
|
7
|
+
setupAllowanceSeconds: z.ZodLiteral<120>;
|
|
8
|
+
maxCallDurationSeconds: z.ZodNumber;
|
|
9
|
+
providerReleaseDurationCeilingSeconds: z.ZodNumber;
|
|
10
|
+
absoluteExpiresAt: z.ZodISODateTime;
|
|
11
|
+
connectedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
12
|
+
connectedDeadlineAt: z.ZodNullable<z.ZodISODateTime>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type VoiceCallDurationSnapshot = z.infer<typeof voiceCallDurationSnapshotSchema>;
|
|
15
|
+
export declare function createVoiceDurationSnapshot({ policyRevision, admittedAt, maxCallDurationSeconds, providerReleaseDurationCeilingSeconds, }: {
|
|
16
|
+
policyRevision: number;
|
|
17
|
+
admittedAt: string;
|
|
18
|
+
maxCallDurationSeconds: number;
|
|
19
|
+
providerReleaseDurationCeilingSeconds: number;
|
|
20
|
+
}): VoiceCallDurationSnapshot;
|
|
21
|
+
export declare function connectVoiceDurationSnapshot({ snapshot, connectedAt }: {
|
|
22
|
+
snapshot: VoiceCallDurationSnapshot;
|
|
23
|
+
connectedAt: string;
|
|
24
|
+
}): VoiceCallDurationSnapshot;
|
|
25
|
+
export declare const voiceDurationApplicationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
|
+
status: z.ZodLiteral<"EFFECTIVE">;
|
|
27
|
+
configuredMaxCallDurationSeconds: z.ZodNumber;
|
|
28
|
+
effectiveMaxCallDurationSeconds: z.ZodNumber;
|
|
29
|
+
activeReleaseDurationCeilingSeconds: z.ZodNumber;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
status: z.ZodLiteral<"REPUBLICATION_REQUIRED">;
|
|
32
|
+
reason: z.ZodEnum<{
|
|
33
|
+
ACTIVE_RELEASE_DURATION_CEILING: "ACTIVE_RELEASE_DURATION_CEILING";
|
|
34
|
+
PROVIDER_SETTING_REQUIRES_REPUBLICATION: "PROVIDER_SETTING_REQUIRES_REPUBLICATION";
|
|
35
|
+
}>;
|
|
36
|
+
configuredMaxCallDurationSeconds: z.ZodNumber;
|
|
37
|
+
effectiveMaxCallDurationSeconds: z.ZodNumber;
|
|
38
|
+
activeReleaseDurationCeilingSeconds: z.ZodNumber;
|
|
39
|
+
}, z.core.$strict>], "status">;
|
|
40
|
+
export type VoiceDurationApplication = z.infer<typeof voiceDurationApplicationSchema>;
|
|
41
|
+
export declare function assessVoiceDurationApplication({ configuredMaxCallDurationSeconds, previousEffectiveMaxCallDurationSeconds, activeReleaseDurationCeilingSeconds, durationSettingMode, }: {
|
|
42
|
+
configuredMaxCallDurationSeconds: number;
|
|
43
|
+
previousEffectiveMaxCallDurationSeconds: number;
|
|
44
|
+
activeReleaseDurationCeilingSeconds: number;
|
|
45
|
+
durationSettingMode: VoiceProviderDurationSettingMode;
|
|
46
|
+
}): VoiceDurationApplication;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { voiceRevisionSchema, voiceTimestampSchema } from './voice-common.js';
|
|
3
|
+
import { voiceProviderDurationSettingModeSchema, } from './voice-policy-limits.js';
|
|
4
|
+
const durationSchema = z.number().int().positive().safe();
|
|
5
|
+
export const VOICE_SETUP_ALLOWANCE_SECONDS = 120;
|
|
6
|
+
export const voiceCallDurationSnapshotSchema = z.strictObject({
|
|
7
|
+
policyRevision: voiceRevisionSchema,
|
|
8
|
+
admittedAt: voiceTimestampSchema,
|
|
9
|
+
setupAllowanceSeconds: z.literal(VOICE_SETUP_ALLOWANCE_SECONDS),
|
|
10
|
+
maxCallDurationSeconds: durationSchema,
|
|
11
|
+
providerReleaseDurationCeilingSeconds: durationSchema,
|
|
12
|
+
absoluteExpiresAt: voiceTimestampSchema,
|
|
13
|
+
connectedAt: voiceTimestampSchema.nullable(),
|
|
14
|
+
connectedDeadlineAt: voiceTimestampSchema.nullable(),
|
|
15
|
+
}).superRefine(validateDurationSnapshot);
|
|
16
|
+
export function createVoiceDurationSnapshot({ policyRevision, admittedAt, maxCallDurationSeconds, providerReleaseDurationCeilingSeconds, }) {
|
|
17
|
+
const revision = voiceRevisionSchema.parse(policyRevision);
|
|
18
|
+
const admitted = voiceTimestampSchema.parse(admittedAt);
|
|
19
|
+
const duration = durationSchema.parse(maxCallDurationSeconds);
|
|
20
|
+
const providerCeiling = durationSchema.parse(providerReleaseDurationCeilingSeconds);
|
|
21
|
+
if (duration > providerCeiling) {
|
|
22
|
+
throw new Error('admitted call duration exceeds the verified provider release ceiling');
|
|
23
|
+
}
|
|
24
|
+
return voiceCallDurationSnapshotSchema.parse({
|
|
25
|
+
policyRevision: revision,
|
|
26
|
+
admittedAt: admitted,
|
|
27
|
+
setupAllowanceSeconds: VOICE_SETUP_ALLOWANCE_SECONDS,
|
|
28
|
+
maxCallDurationSeconds: duration,
|
|
29
|
+
providerReleaseDurationCeilingSeconds: providerCeiling,
|
|
30
|
+
absoluteExpiresAt: addSeconds({
|
|
31
|
+
timestamp: admitted, seconds: VOICE_SETUP_ALLOWANCE_SECONDS + duration,
|
|
32
|
+
}),
|
|
33
|
+
connectedAt: null,
|
|
34
|
+
connectedDeadlineAt: null,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export function connectVoiceDurationSnapshot({ snapshot, connectedAt }) {
|
|
38
|
+
const current = voiceCallDurationSnapshotSchema.parse(snapshot);
|
|
39
|
+
const connected = voiceTimestampSchema.parse(connectedAt);
|
|
40
|
+
if (current.connectedAt !== null) {
|
|
41
|
+
if (toMillis(current.connectedAt) !== toMillis(connected)) {
|
|
42
|
+
throw new Error('connected timestamp is immutable once recorded');
|
|
43
|
+
}
|
|
44
|
+
return current;
|
|
45
|
+
}
|
|
46
|
+
const admittedMillis = toMillis(current.admittedAt);
|
|
47
|
+
const connectedMillis = toMillis(connected);
|
|
48
|
+
if (connectedMillis < admittedMillis)
|
|
49
|
+
throw new Error('connection cannot occur before admission');
|
|
50
|
+
const setupDeadline = admittedMillis + current.setupAllowanceSeconds * 1_000;
|
|
51
|
+
if (connectedMillis > setupDeadline) {
|
|
52
|
+
throw new Error('connection occurred after the bounded setup allowance');
|
|
53
|
+
}
|
|
54
|
+
const absoluteExpiry = toMillis(current.absoluteExpiresAt);
|
|
55
|
+
if (connectedMillis >= absoluteExpiry) {
|
|
56
|
+
throw new Error('connection occurred at or after the absolute expiry');
|
|
57
|
+
}
|
|
58
|
+
const durationDeadline = addSeconds({
|
|
59
|
+
timestamp: connected, seconds: current.maxCallDurationSeconds,
|
|
60
|
+
});
|
|
61
|
+
const deadline = toMillis(durationDeadline) <= absoluteExpiry
|
|
62
|
+
? durationDeadline
|
|
63
|
+
: current.absoluteExpiresAt;
|
|
64
|
+
return voiceCallDurationSnapshotSchema.parse({
|
|
65
|
+
...current, connectedAt: connected, connectedDeadlineAt: deadline,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export const voiceDurationApplicationSchema = z.discriminatedUnion('status', [
|
|
69
|
+
z.strictObject({
|
|
70
|
+
status: z.literal('EFFECTIVE'),
|
|
71
|
+
configuredMaxCallDurationSeconds: durationSchema,
|
|
72
|
+
effectiveMaxCallDurationSeconds: durationSchema,
|
|
73
|
+
activeReleaseDurationCeilingSeconds: durationSchema,
|
|
74
|
+
}),
|
|
75
|
+
z.strictObject({
|
|
76
|
+
status: z.literal('REPUBLICATION_REQUIRED'),
|
|
77
|
+
reason: z.enum([
|
|
78
|
+
'ACTIVE_RELEASE_DURATION_CEILING',
|
|
79
|
+
'PROVIDER_SETTING_REQUIRES_REPUBLICATION',
|
|
80
|
+
]),
|
|
81
|
+
configuredMaxCallDurationSeconds: durationSchema,
|
|
82
|
+
effectiveMaxCallDurationSeconds: durationSchema,
|
|
83
|
+
activeReleaseDurationCeilingSeconds: durationSchema,
|
|
84
|
+
}),
|
|
85
|
+
]).superRefine((application, context) => {
|
|
86
|
+
if (application.effectiveMaxCallDurationSeconds > application.activeReleaseDurationCeilingSeconds) {
|
|
87
|
+
context.addIssue({
|
|
88
|
+
code: 'custom',
|
|
89
|
+
path: ['effectiveMaxCallDurationSeconds'],
|
|
90
|
+
message: 'effective duration exceeds the active release ceiling',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
export function assessVoiceDurationApplication({ configuredMaxCallDurationSeconds, previousEffectiveMaxCallDurationSeconds, activeReleaseDurationCeilingSeconds, durationSettingMode, }) {
|
|
95
|
+
const configured = durationSchema.parse(configuredMaxCallDurationSeconds);
|
|
96
|
+
const previous = durationSchema.parse(previousEffectiveMaxCallDurationSeconds);
|
|
97
|
+
const ceiling = durationSchema.parse(activeReleaseDurationCeilingSeconds);
|
|
98
|
+
const settingMode = voiceProviderDurationSettingModeSchema.parse(durationSettingMode);
|
|
99
|
+
if (previous > ceiling) {
|
|
100
|
+
throw new Error('previous effective duration exceeds the active release ceiling');
|
|
101
|
+
}
|
|
102
|
+
if (configured > ceiling) {
|
|
103
|
+
return makePendingDuration({
|
|
104
|
+
configured, previous, ceiling, reason: 'ACTIVE_RELEASE_DURATION_CEILING',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (configured !== previous && settingMode === 'REQUIRES_REPUBLICATION') {
|
|
108
|
+
return makePendingDuration({
|
|
109
|
+
configured, previous, ceiling,
|
|
110
|
+
reason: 'PROVIDER_SETTING_REQUIRES_REPUBLICATION',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return voiceDurationApplicationSchema.parse({
|
|
114
|
+
status: 'EFFECTIVE',
|
|
115
|
+
configuredMaxCallDurationSeconds: configured,
|
|
116
|
+
effectiveMaxCallDurationSeconds: configured,
|
|
117
|
+
activeReleaseDurationCeilingSeconds: ceiling,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function validateDurationSnapshot(snapshot, context) {
|
|
121
|
+
const admitted = toMillis(snapshot.admittedAt);
|
|
122
|
+
const absolute = toMillis(snapshot.absoluteExpiresAt);
|
|
123
|
+
const maximumAbsolute = admitted +
|
|
124
|
+
(snapshot.setupAllowanceSeconds + snapshot.maxCallDurationSeconds) * 1_000;
|
|
125
|
+
if (snapshot.maxCallDurationSeconds > snapshot.providerReleaseDurationCeilingSeconds) {
|
|
126
|
+
addIssue({ context, path: 'maxCallDurationSeconds', message: 'duration exceeds the verified provider release ceiling' });
|
|
127
|
+
}
|
|
128
|
+
if (absolute <= admitted || absolute > maximumAbsolute) {
|
|
129
|
+
addIssue({ context, path: 'absoluteExpiresAt', message: 'absolute expiry exceeds the admission duration bound' });
|
|
130
|
+
}
|
|
131
|
+
const hasConnectedAt = snapshot.connectedAt !== null;
|
|
132
|
+
if (hasConnectedAt !== (snapshot.connectedDeadlineAt !== null)) {
|
|
133
|
+
addIssue({ context, path: 'connectedDeadlineAt', message: 'connected timestamp and deadline must be recorded together' });
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (snapshot.connectedAt === null || snapshot.connectedDeadlineAt === null)
|
|
137
|
+
return;
|
|
138
|
+
const connected = toMillis(snapshot.connectedAt);
|
|
139
|
+
const deadline = toMillis(snapshot.connectedDeadlineAt);
|
|
140
|
+
const setupDeadline = admitted + snapshot.setupAllowanceSeconds * 1_000;
|
|
141
|
+
const maximumDeadline = Math.min(connected + snapshot.maxCallDurationSeconds * 1_000, absolute);
|
|
142
|
+
if (connected < admitted || connected > setupDeadline) {
|
|
143
|
+
addIssue({ context, path: 'connectedAt', message: 'connection must occur during the bounded setup window' });
|
|
144
|
+
}
|
|
145
|
+
if (deadline <= connected || deadline > maximumDeadline) {
|
|
146
|
+
addIssue({ context, path: 'connectedDeadlineAt', message: 'connected deadline exceeds the call authority bound' });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function makePendingDuration({ configured, previous, ceiling, reason }) {
|
|
150
|
+
return voiceDurationApplicationSchema.parse({
|
|
151
|
+
status: 'REPUBLICATION_REQUIRED',
|
|
152
|
+
reason,
|
|
153
|
+
configuredMaxCallDurationSeconds: configured,
|
|
154
|
+
effectiveMaxCallDurationSeconds: previous,
|
|
155
|
+
activeReleaseDurationCeilingSeconds: ceiling,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function addIssue({ context, path, message }) {
|
|
159
|
+
context.addIssue({ code: 'custom', path: [path], message });
|
|
160
|
+
}
|
|
161
|
+
function toMillis(timestamp) {
|
|
162
|
+
return new Date(voiceTimestampSchema.parse(timestamp)).getTime();
|
|
163
|
+
}
|
|
164
|
+
function addSeconds({ timestamp, seconds }) {
|
|
165
|
+
return new Date(toMillis(timestamp) + durationSchema.parse(seconds) * 1_000).toISOString();
|
|
166
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type VoiceCallDirection } from './voice-lifecycle-states.js';
|
|
3
|
+
export declare const voiceCallLimitsSchema: z.ZodObject<{
|
|
4
|
+
maxConcurrentCalls: z.ZodNumber;
|
|
5
|
+
maxDailyCallAttempts: z.ZodNumber;
|
|
6
|
+
maxDailyOutboundAttemptsPerPerson: z.ZodNumber;
|
|
7
|
+
maxDailyInboundAttemptsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
maxConcurrentInboundCallsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
maxCallDurationSeconds: z.ZodNumber;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export type VoiceCallLimits = z.infer<typeof voiceCallLimitsSchema>;
|
|
12
|
+
export declare const VOICE_DEFAULT_CALL_LIMITS: VoiceCallLimits;
|
|
13
|
+
export declare const voiceEngineeringLimitsSchema: z.ZodObject<{
|
|
14
|
+
maxToolAttemptsPerCall: z.ZodNumber;
|
|
15
|
+
toolInvocationTimeoutSeconds: z.ZodNumber;
|
|
16
|
+
maxPublicationsPerUtcDay: z.ZodNumber;
|
|
17
|
+
maxOwnedProviderAgents: z.ZodNumber;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type VoiceEngineeringLimits = z.infer<typeof voiceEngineeringLimitsSchema>;
|
|
20
|
+
export declare const VOICE_DEFAULT_ENGINEERING_LIMITS: VoiceEngineeringLimits;
|
|
21
|
+
export declare const voiceProviderDurationSettingModeSchema: z.ZodEnum<{
|
|
22
|
+
PER_SESSION: "PER_SESSION";
|
|
23
|
+
REQUIRES_REPUBLICATION: "REQUIRES_REPUBLICATION";
|
|
24
|
+
}>;
|
|
25
|
+
export type VoiceProviderDurationSettingMode = z.infer<typeof voiceProviderDurationSettingModeSchema>;
|
|
26
|
+
export declare const voiceProviderCapabilitiesSchema: z.ZodObject<{
|
|
27
|
+
verifiedMaxConcurrentCalls: z.ZodNumber;
|
|
28
|
+
verifiedMaxCallDurationSeconds: z.ZodNumber;
|
|
29
|
+
durationSettingMode: z.ZodEnum<{
|
|
30
|
+
PER_SESSION: "PER_SESSION";
|
|
31
|
+
REQUIRES_REPUBLICATION: "REQUIRES_REPUBLICATION";
|
|
32
|
+
}>;
|
|
33
|
+
verifiedAt: z.ZodISODateTime;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type VoiceProviderCapabilities = z.infer<typeof voiceProviderCapabilitiesSchema>;
|
|
36
|
+
export declare const voiceOperatorPolicySchema: z.ZodObject<{
|
|
37
|
+
tenantId: z.ZodString;
|
|
38
|
+
environmentId: z.ZodString;
|
|
39
|
+
revision: z.ZodNumber;
|
|
40
|
+
revocationGeneration: z.ZodNumber;
|
|
41
|
+
admissionEnabled: z.ZodBoolean;
|
|
42
|
+
limits: z.ZodObject<{
|
|
43
|
+
maxConcurrentCalls: z.ZodNumber;
|
|
44
|
+
maxDailyCallAttempts: z.ZodNumber;
|
|
45
|
+
maxDailyOutboundAttemptsPerPerson: z.ZodNumber;
|
|
46
|
+
maxDailyInboundAttemptsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
maxConcurrentInboundCallsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
48
|
+
maxCallDurationSeconds: z.ZodNumber;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
engineeringLimits: z.ZodObject<{
|
|
51
|
+
maxToolAttemptsPerCall: z.ZodNumber;
|
|
52
|
+
toolInvocationTimeoutSeconds: z.ZodNumber;
|
|
53
|
+
maxPublicationsPerUtcDay: z.ZodNumber;
|
|
54
|
+
maxOwnedProviderAgents: z.ZodNumber;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
updatedAt: z.ZodISODateTime;
|
|
57
|
+
updatedByPrincipalId: z.ZodString;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
export type VoiceOperatorPolicy = z.infer<typeof voiceOperatorPolicySchema>;
|
|
60
|
+
export declare const voiceUtcDaySchema: z.ZodISODate;
|
|
61
|
+
export declare const voicePolicyUsageSchema: z.ZodObject<{
|
|
62
|
+
tenantId: z.ZodString;
|
|
63
|
+
environmentId: z.ZodString;
|
|
64
|
+
utcDay: z.ZodISODate;
|
|
65
|
+
activeReservations: z.ZodNumber;
|
|
66
|
+
admittedAttempts: z.ZodNumber;
|
|
67
|
+
outboundAttemptsByPrincipalId: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
68
|
+
measuredAt: z.ZodISODateTime;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export type VoicePolicyUsage = z.infer<typeof voicePolicyUsageSchema>;
|
|
71
|
+
export declare function rollVoicePolicyUsageToUtcDay({ usage, measuredAt }: {
|
|
72
|
+
usage: VoicePolicyUsage;
|
|
73
|
+
measuredAt: string;
|
|
74
|
+
}): {
|
|
75
|
+
usage: VoicePolicyUsage;
|
|
76
|
+
changed: boolean;
|
|
77
|
+
};
|
|
78
|
+
export declare const voicePolicyLimitUpdateSchema: z.ZodObject<{
|
|
79
|
+
expectedRevision: z.ZodNumber;
|
|
80
|
+
limits: z.ZodObject<{
|
|
81
|
+
maxConcurrentCalls: z.ZodNumber;
|
|
82
|
+
maxDailyCallAttempts: z.ZodNumber;
|
|
83
|
+
maxDailyOutboundAttemptsPerPerson: z.ZodNumber;
|
|
84
|
+
maxDailyInboundAttemptsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
85
|
+
maxConcurrentInboundCallsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
86
|
+
maxCallDurationSeconds: z.ZodNumber;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
actorPrincipalId: z.ZodString;
|
|
89
|
+
updatedAt: z.ZodISODateTime;
|
|
90
|
+
}, z.core.$strict>;
|
|
91
|
+
export type VoicePolicyLimitUpdate = z.infer<typeof voicePolicyLimitUpdateSchema>;
|
|
92
|
+
export declare const voicePolicyLimitAuditSchema: z.ZodObject<{
|
|
93
|
+
tenantId: z.ZodString;
|
|
94
|
+
environmentId: z.ZodString;
|
|
95
|
+
previousRevision: z.ZodNumber;
|
|
96
|
+
nextRevision: z.ZodNumber;
|
|
97
|
+
actorPrincipalId: z.ZodString;
|
|
98
|
+
updatedAt: z.ZodISODateTime;
|
|
99
|
+
previousLimits: z.ZodObject<{
|
|
100
|
+
maxConcurrentCalls: z.ZodNumber;
|
|
101
|
+
maxDailyCallAttempts: z.ZodNumber;
|
|
102
|
+
maxDailyOutboundAttemptsPerPerson: z.ZodNumber;
|
|
103
|
+
maxDailyInboundAttemptsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
104
|
+
maxConcurrentInboundCallsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
maxCallDurationSeconds: z.ZodNumber;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
nextLimits: z.ZodObject<{
|
|
108
|
+
maxConcurrentCalls: z.ZodNumber;
|
|
109
|
+
maxDailyCallAttempts: z.ZodNumber;
|
|
110
|
+
maxDailyOutboundAttemptsPerPerson: z.ZodNumber;
|
|
111
|
+
maxDailyInboundAttemptsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
maxConcurrentInboundCallsPerNumber: z.ZodDefault<z.ZodNumber>;
|
|
113
|
+
maxCallDurationSeconds: z.ZodNumber;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
export type VoicePolicyLimitAudit = z.infer<typeof voicePolicyLimitAuditSchema>;
|
|
117
|
+
export declare const voiceProviderLimitViolationSchema: z.ZodObject<{
|
|
118
|
+
field: z.ZodEnum<{
|
|
119
|
+
maxConcurrentCalls: "maxConcurrentCalls";
|
|
120
|
+
maxCallDurationSeconds: "maxCallDurationSeconds";
|
|
121
|
+
}>;
|
|
122
|
+
requested: z.ZodNumber;
|
|
123
|
+
verifiedMaximum: z.ZodNumber;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
export type VoiceProviderLimitViolation = z.infer<typeof voiceProviderLimitViolationSchema>;
|
|
126
|
+
export type VoiceProviderLimitValidation = {
|
|
127
|
+
ok: true;
|
|
128
|
+
} | {
|
|
129
|
+
ok: false;
|
|
130
|
+
violations: VoiceProviderLimitViolation[];
|
|
131
|
+
};
|
|
132
|
+
export declare function validateVoiceCallLimitsAgainstProvider({ limits, providerCapabilities }: {
|
|
133
|
+
limits: VoiceCallLimits;
|
|
134
|
+
providerCapabilities: VoiceProviderCapabilities;
|
|
135
|
+
}): VoiceProviderLimitValidation;
|
|
136
|
+
export type VoicePolicyLimitUpdateResult = {
|
|
137
|
+
ok: true;
|
|
138
|
+
policy: VoiceOperatorPolicy;
|
|
139
|
+
usage: VoicePolicyUsage;
|
|
140
|
+
audit: VoicePolicyLimitAudit;
|
|
141
|
+
} | {
|
|
142
|
+
ok: false;
|
|
143
|
+
reason: 'STALE_REVISION';
|
|
144
|
+
actualRevision: number;
|
|
145
|
+
} | {
|
|
146
|
+
ok: false;
|
|
147
|
+
reason: 'PROVIDER_CAPABILITY_EXCEEDED';
|
|
148
|
+
violations: VoiceProviderLimitViolation[];
|
|
149
|
+
};
|
|
150
|
+
export declare function applyVoicePolicyLimitUpdate({ currentPolicy, currentUsage, update, providerCapabilities, }: {
|
|
151
|
+
currentPolicy: VoiceOperatorPolicy;
|
|
152
|
+
currentUsage: VoicePolicyUsage;
|
|
153
|
+
update: VoicePolicyLimitUpdate;
|
|
154
|
+
providerCapabilities: VoiceProviderCapabilities;
|
|
155
|
+
}): VoicePolicyLimitUpdateResult;
|
|
156
|
+
export declare const voiceAdmissionLimitReasonSchema: z.ZodEnum<{
|
|
157
|
+
ADMISSION_DISABLED: "ADMISSION_DISABLED";
|
|
158
|
+
CONCURRENT_LIMIT_REACHED: "CONCURRENT_LIMIT_REACHED";
|
|
159
|
+
ENVIRONMENT_DAILY_LIMIT_REACHED: "ENVIRONMENT_DAILY_LIMIT_REACHED";
|
|
160
|
+
PERSON_DAILY_LIMIT_REACHED: "PERSON_DAILY_LIMIT_REACHED";
|
|
161
|
+
}>;
|
|
162
|
+
export type VoiceAdmissionLimitReason = z.infer<typeof voiceAdmissionLimitReasonSchema>;
|
|
163
|
+
export type VoiceCallAdmissionEvaluation = {
|
|
164
|
+
admitted: true;
|
|
165
|
+
} | {
|
|
166
|
+
admitted: false;
|
|
167
|
+
reason: VoiceAdmissionLimitReason;
|
|
168
|
+
};
|
|
169
|
+
export declare function evaluateVoiceCallAdmission({ policy, usage, direction, initiatingStaffPrincipalId, }: {
|
|
170
|
+
policy: VoiceOperatorPolicy;
|
|
171
|
+
usage: VoicePolicyUsage;
|
|
172
|
+
direction: VoiceCallDirection;
|
|
173
|
+
initiatingStaffPrincipalId: string | null;
|
|
174
|
+
}): VoiceCallAdmissionEvaluation;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { voiceCallDirectionSchema, } from './voice-lifecycle-states.js';
|
|
3
|
+
import { voiceIdSchema, voiceRevisionSchema, voiceScopeSchema, voiceTimestampSchema, } from './voice-common.js';
|
|
4
|
+
const positiveIntegerSchema = z.number().int().positive().safe();
|
|
5
|
+
const counterSchema = z.number().int().nonnegative().safe();
|
|
6
|
+
export const voiceCallLimitsSchema = z.strictObject({
|
|
7
|
+
maxConcurrentCalls: positiveIntegerSchema,
|
|
8
|
+
maxDailyCallAttempts: positiveIntegerSchema,
|
|
9
|
+
maxDailyOutboundAttemptsPerPerson: positiveIntegerSchema,
|
|
10
|
+
maxDailyInboundAttemptsPerNumber: positiveIntegerSchema.default(100),
|
|
11
|
+
maxConcurrentInboundCallsPerNumber: positiveIntegerSchema.default(2),
|
|
12
|
+
maxCallDurationSeconds: positiveIntegerSchema,
|
|
13
|
+
});
|
|
14
|
+
export const VOICE_DEFAULT_CALL_LIMITS = voiceCallLimitsSchema.parse({
|
|
15
|
+
maxConcurrentCalls: 20,
|
|
16
|
+
maxDailyCallAttempts: 200,
|
|
17
|
+
maxDailyOutboundAttemptsPerPerson: 100,
|
|
18
|
+
maxDailyInboundAttemptsPerNumber: 100,
|
|
19
|
+
maxConcurrentInboundCallsPerNumber: 2,
|
|
20
|
+
maxCallDurationSeconds: 900,
|
|
21
|
+
});
|
|
22
|
+
export const voiceEngineeringLimitsSchema = z.strictObject({
|
|
23
|
+
maxToolAttemptsPerCall: positiveIntegerSchema,
|
|
24
|
+
toolInvocationTimeoutSeconds: positiveIntegerSchema,
|
|
25
|
+
maxPublicationsPerUtcDay: positiveIntegerSchema,
|
|
26
|
+
maxOwnedProviderAgents: positiveIntegerSchema,
|
|
27
|
+
});
|
|
28
|
+
export const VOICE_DEFAULT_ENGINEERING_LIMITS = voiceEngineeringLimitsSchema.parse({
|
|
29
|
+
maxToolAttemptsPerCall: 20,
|
|
30
|
+
toolInvocationTimeoutSeconds: 10,
|
|
31
|
+
maxPublicationsPerUtcDay: 10,
|
|
32
|
+
maxOwnedProviderAgents: 20,
|
|
33
|
+
});
|
|
34
|
+
export const voiceProviderDurationSettingModeSchema = z.enum([
|
|
35
|
+
'PER_SESSION', 'REQUIRES_REPUBLICATION',
|
|
36
|
+
]);
|
|
37
|
+
export const voiceProviderCapabilitiesSchema = z.strictObject({
|
|
38
|
+
verifiedMaxConcurrentCalls: positiveIntegerSchema,
|
|
39
|
+
verifiedMaxCallDurationSeconds: positiveIntegerSchema,
|
|
40
|
+
durationSettingMode: voiceProviderDurationSettingModeSchema,
|
|
41
|
+
verifiedAt: voiceTimestampSchema,
|
|
42
|
+
});
|
|
43
|
+
export const voiceOperatorPolicySchema = voiceScopeSchema.extend({
|
|
44
|
+
revision: voiceRevisionSchema,
|
|
45
|
+
revocationGeneration: voiceRevisionSchema,
|
|
46
|
+
admissionEnabled: z.boolean(),
|
|
47
|
+
limits: voiceCallLimitsSchema,
|
|
48
|
+
engineeringLimits: voiceEngineeringLimitsSchema,
|
|
49
|
+
updatedAt: voiceTimestampSchema,
|
|
50
|
+
updatedByPrincipalId: voiceIdSchema,
|
|
51
|
+
});
|
|
52
|
+
export const voiceUtcDaySchema = z.iso.date();
|
|
53
|
+
export const voicePolicyUsageSchema = voiceScopeSchema.extend({
|
|
54
|
+
utcDay: voiceUtcDaySchema,
|
|
55
|
+
activeReservations: counterSchema,
|
|
56
|
+
admittedAttempts: counterSchema,
|
|
57
|
+
outboundAttemptsByPrincipalId: z.record(voiceIdSchema, counterSchema),
|
|
58
|
+
measuredAt: voiceTimestampSchema,
|
|
59
|
+
});
|
|
60
|
+
export function rollVoicePolicyUsageToUtcDay({ usage, measuredAt }) {
|
|
61
|
+
const current = voicePolicyUsageSchema.parse(usage);
|
|
62
|
+
const observedAt = voiceTimestampSchema.parse(measuredAt);
|
|
63
|
+
const nextDay = voiceUtcDaySchema.parse(new Date(observedAt).toISOString().substring(0, 10));
|
|
64
|
+
if (nextDay < current.utcDay)
|
|
65
|
+
throw new Error('UTC usage buckets cannot roll backward');
|
|
66
|
+
if (nextDay === current.utcDay)
|
|
67
|
+
return { usage: current, changed: false };
|
|
68
|
+
return {
|
|
69
|
+
changed: true,
|
|
70
|
+
usage: voicePolicyUsageSchema.parse({
|
|
71
|
+
...current,
|
|
72
|
+
utcDay: nextDay,
|
|
73
|
+
admittedAttempts: 0,
|
|
74
|
+
outboundAttemptsByPrincipalId: {},
|
|
75
|
+
measuredAt: observedAt,
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export const voicePolicyLimitUpdateSchema = z.strictObject({
|
|
80
|
+
expectedRevision: voiceRevisionSchema,
|
|
81
|
+
limits: voiceCallLimitsSchema,
|
|
82
|
+
actorPrincipalId: voiceIdSchema,
|
|
83
|
+
updatedAt: voiceTimestampSchema,
|
|
84
|
+
});
|
|
85
|
+
export const voicePolicyLimitAuditSchema = voiceScopeSchema.extend({
|
|
86
|
+
previousRevision: voiceRevisionSchema,
|
|
87
|
+
nextRevision: voiceRevisionSchema,
|
|
88
|
+
actorPrincipalId: voiceIdSchema,
|
|
89
|
+
updatedAt: voiceTimestampSchema,
|
|
90
|
+
previousLimits: voiceCallLimitsSchema,
|
|
91
|
+
nextLimits: voiceCallLimitsSchema,
|
|
92
|
+
});
|
|
93
|
+
export const voiceProviderLimitViolationSchema = z.strictObject({
|
|
94
|
+
field: z.enum(['maxConcurrentCalls', 'maxCallDurationSeconds']),
|
|
95
|
+
requested: positiveIntegerSchema,
|
|
96
|
+
verifiedMaximum: positiveIntegerSchema,
|
|
97
|
+
});
|
|
98
|
+
export function validateVoiceCallLimitsAgainstProvider({ limits, providerCapabilities }) {
|
|
99
|
+
const requested = voiceCallLimitsSchema.parse(limits);
|
|
100
|
+
const verified = voiceProviderCapabilitiesSchema.parse(providerCapabilities);
|
|
101
|
+
const violations = [];
|
|
102
|
+
if (requested.maxConcurrentCalls > verified.verifiedMaxConcurrentCalls) {
|
|
103
|
+
violations.push({
|
|
104
|
+
field: 'maxConcurrentCalls',
|
|
105
|
+
requested: requested.maxConcurrentCalls,
|
|
106
|
+
verifiedMaximum: verified.verifiedMaxConcurrentCalls,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (requested.maxCallDurationSeconds > verified.verifiedMaxCallDurationSeconds) {
|
|
110
|
+
violations.push({
|
|
111
|
+
field: 'maxCallDurationSeconds',
|
|
112
|
+
requested: requested.maxCallDurationSeconds,
|
|
113
|
+
verifiedMaximum: verified.verifiedMaxCallDurationSeconds,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return violations.length === 0 ? { ok: true } : { ok: false, violations };
|
|
117
|
+
}
|
|
118
|
+
export function applyVoicePolicyLimitUpdate({ currentPolicy, currentUsage, update, providerCapabilities, }) {
|
|
119
|
+
const policy = voiceOperatorPolicySchema.parse(currentPolicy);
|
|
120
|
+
const usage = voicePolicyUsageSchema.parse(currentUsage);
|
|
121
|
+
const requested = voicePolicyLimitUpdateSchema.parse(update);
|
|
122
|
+
assertSameScope({ left: policy, right: usage });
|
|
123
|
+
if (requested.expectedRevision !== policy.revision) {
|
|
124
|
+
return { ok: false, reason: 'STALE_REVISION', actualRevision: policy.revision };
|
|
125
|
+
}
|
|
126
|
+
const capability = validateVoiceCallLimitsAgainstProvider({
|
|
127
|
+
limits: requested.limits, providerCapabilities,
|
|
128
|
+
});
|
|
129
|
+
if (!capability.ok) {
|
|
130
|
+
return { ok: false, reason: 'PROVIDER_CAPABILITY_EXCEEDED', violations: capability.violations };
|
|
131
|
+
}
|
|
132
|
+
const nextRevision = policy.revision + 1;
|
|
133
|
+
const nextPolicy = voiceOperatorPolicySchema.parse({
|
|
134
|
+
...policy,
|
|
135
|
+
revision: nextRevision,
|
|
136
|
+
limits: requested.limits,
|
|
137
|
+
updatedAt: requested.updatedAt,
|
|
138
|
+
updatedByPrincipalId: requested.actorPrincipalId,
|
|
139
|
+
});
|
|
140
|
+
const audit = voicePolicyLimitAuditSchema.parse({
|
|
141
|
+
tenantId: policy.tenantId,
|
|
142
|
+
environmentId: policy.environmentId,
|
|
143
|
+
previousRevision: policy.revision,
|
|
144
|
+
nextRevision,
|
|
145
|
+
actorPrincipalId: requested.actorPrincipalId,
|
|
146
|
+
updatedAt: requested.updatedAt,
|
|
147
|
+
previousLimits: policy.limits,
|
|
148
|
+
nextLimits: nextPolicy.limits,
|
|
149
|
+
});
|
|
150
|
+
return { ok: true, policy: nextPolicy, usage, audit };
|
|
151
|
+
}
|
|
152
|
+
export const voiceAdmissionLimitReasonSchema = z.enum([
|
|
153
|
+
'ADMISSION_DISABLED', 'CONCURRENT_LIMIT_REACHED',
|
|
154
|
+
'ENVIRONMENT_DAILY_LIMIT_REACHED', 'PERSON_DAILY_LIMIT_REACHED',
|
|
155
|
+
]);
|
|
156
|
+
export function evaluateVoiceCallAdmission({ policy, usage, direction, initiatingStaffPrincipalId, }) {
|
|
157
|
+
const currentPolicy = voiceOperatorPolicySchema.parse(policy);
|
|
158
|
+
const currentUsage = voicePolicyUsageSchema.parse(usage);
|
|
159
|
+
const callDirection = voiceCallDirectionSchema.parse(direction);
|
|
160
|
+
assertSameScope({ left: currentPolicy, right: currentUsage });
|
|
161
|
+
if (callDirection === 'OUTBOUND' && initiatingStaffPrincipalId === null) {
|
|
162
|
+
throw new Error('outbound calls require an initiating staff principal');
|
|
163
|
+
}
|
|
164
|
+
if (callDirection === 'INBOUND' && initiatingStaffPrincipalId !== null) {
|
|
165
|
+
throw new Error('inbound calls cannot have an initiating staff principal');
|
|
166
|
+
}
|
|
167
|
+
if (!currentPolicy.admissionEnabled)
|
|
168
|
+
return { admitted: false, reason: 'ADMISSION_DISABLED' };
|
|
169
|
+
if (currentUsage.activeReservations >= currentPolicy.limits.maxConcurrentCalls) {
|
|
170
|
+
return { admitted: false, reason: 'CONCURRENT_LIMIT_REACHED' };
|
|
171
|
+
}
|
|
172
|
+
if (currentUsage.admittedAttempts >= currentPolicy.limits.maxDailyCallAttempts) {
|
|
173
|
+
return { admitted: false, reason: 'ENVIRONMENT_DAILY_LIMIT_REACHED' };
|
|
174
|
+
}
|
|
175
|
+
if (callDirection === 'OUTBOUND') {
|
|
176
|
+
const principalId = voiceIdSchema.parse(initiatingStaffPrincipalId);
|
|
177
|
+
const attempts = currentUsage.outboundAttemptsByPrincipalId[principalId] ?? 0;
|
|
178
|
+
if (attempts >= currentPolicy.limits.maxDailyOutboundAttemptsPerPerson) {
|
|
179
|
+
return { admitted: false, reason: 'PERSON_DAILY_LIMIT_REACHED' };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return { admitted: true };
|
|
183
|
+
}
|
|
184
|
+
function assertSameScope({ left, right }) {
|
|
185
|
+
if (left.tenantId !== right.tenantId || left.environmentId !== right.environmentId) {
|
|
186
|
+
throw new Error('Voice policy and usage must have the same scope');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MAX_VOICE_PROVIDER_DOCUMENT_BYTES: number;
|
|
3
|
+
export declare const MAX_VOICE_PROVIDER_DOCUMENT_DEPTH = 12;
|
|
4
|
+
export declare const MAX_VOICE_PROVIDER_DOCUMENT_NODES = 2000;
|
|
5
|
+
export declare const voiceProviderEvidenceReferenceSchema: z.ZodString;
|
|
6
|
+
export declare const voiceSanitizedEvidenceTextSchema: z.ZodString;
|
|
7
|
+
export declare const voiceSanitizedProviderDocumentSchema: z.ZodJSONSchema;
|
|
8
|
+
export declare function hashVoiceProviderEvidenceValue({ value }: {
|
|
9
|
+
value: unknown;
|
|
10
|
+
}): string;
|
|
11
|
+
export declare const voiceProviderBranchVersionSchema: z.ZodObject<{
|
|
12
|
+
identifierContract: z.ZodEnum<{
|
|
13
|
+
LIVE_PROOF_PENDING: "LIVE_PROOF_PENDING";
|
|
14
|
+
NOT_USED: "NOT_USED";
|
|
15
|
+
BRANCH_ONLY: "BRANCH_ONLY";
|
|
16
|
+
VERSION_ONLY: "VERSION_ONLY";
|
|
17
|
+
BRANCH_AND_VERSION: "BRANCH_AND_VERSION";
|
|
18
|
+
}>;
|
|
19
|
+
branchId: z.ZodNullable<z.ZodString>;
|
|
20
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
21
|
+
verifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
22
|
+
evidenceRef: z.ZodNullable<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type VoiceProviderBranchVersion = z.infer<typeof voiceProviderBranchVersionSchema>;
|
|
25
|
+
export declare const voiceProviderProcedureMappingSchema: z.ZodObject<{
|
|
26
|
+
localProcedureKey: z.ZodString;
|
|
27
|
+
providerProcedureId: z.ZodString;
|
|
28
|
+
branchVersion: z.ZodObject<{
|
|
29
|
+
identifierContract: z.ZodEnum<{
|
|
30
|
+
LIVE_PROOF_PENDING: "LIVE_PROOF_PENDING";
|
|
31
|
+
NOT_USED: "NOT_USED";
|
|
32
|
+
BRANCH_ONLY: "BRANCH_ONLY";
|
|
33
|
+
VERSION_ONLY: "VERSION_ONLY";
|
|
34
|
+
BRANCH_AND_VERSION: "BRANCH_AND_VERSION";
|
|
35
|
+
}>;
|
|
36
|
+
branchId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
38
|
+
verifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
39
|
+
evidenceRef: z.ZodNullable<z.ZodString>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type VoiceProviderProcedureMapping = z.infer<typeof voiceProviderProcedureMappingSchema>;
|
|
43
|
+
export declare function isVoiceCanonicalList({ values }: {
|
|
44
|
+
values: readonly string[];
|
|
45
|
+
}): boolean;
|
|
46
|
+
export declare const voiceCanonicalToolAliasesSchema: z.ZodArray<z.ZodString>;
|
|
47
|
+
export declare const voiceCanonicalProcedureMappingsSchema: z.ZodArray<z.ZodObject<{
|
|
48
|
+
localProcedureKey: z.ZodString;
|
|
49
|
+
providerProcedureId: z.ZodString;
|
|
50
|
+
branchVersion: z.ZodObject<{
|
|
51
|
+
identifierContract: z.ZodEnum<{
|
|
52
|
+
LIVE_PROOF_PENDING: "LIVE_PROOF_PENDING";
|
|
53
|
+
NOT_USED: "NOT_USED";
|
|
54
|
+
BRANCH_ONLY: "BRANCH_ONLY";
|
|
55
|
+
VERSION_ONLY: "VERSION_ONLY";
|
|
56
|
+
BRANCH_AND_VERSION: "BRANCH_AND_VERSION";
|
|
57
|
+
}>;
|
|
58
|
+
branchId: z.ZodNullable<z.ZodString>;
|
|
59
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
60
|
+
verifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
61
|
+
evidenceRef: z.ZodNullable<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
export declare const voiceGeneratedWorkflowEvidenceSchema: z.ZodObject<{
|
|
65
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
66
|
+
capturedAt: z.ZodISODateTime;
|
|
67
|
+
documentHash: z.ZodString;
|
|
68
|
+
sanitizedDocument: z.ZodJSONSchema;
|
|
69
|
+
normalized: z.ZodObject<{
|
|
70
|
+
authoritySource: z.ZodLiteral<"ATLAS_RELEASE_BINDINGS">;
|
|
71
|
+
procedures: z.ZodArray<z.ZodObject<{
|
|
72
|
+
localProcedureKey: z.ZodString;
|
|
73
|
+
providerProcedureId: z.ZodString;
|
|
74
|
+
toolAliases: z.ZodArray<z.ZodString>;
|
|
75
|
+
referencedProviderProcedureIds: z.ZodArray<z.ZodString>;
|
|
76
|
+
}, z.core.$strict>>;
|
|
77
|
+
toolAliases: z.ZodArray<z.ZodString>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
export type VoiceGeneratedWorkflowEvidence = z.infer<typeof voiceGeneratedWorkflowEvidenceSchema>;
|