@dcdr/contracts 1.9.6
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/LICENSE +176 -0
- package/README.md +411 -0
- package/dist/capabilities.contract.d.ts +69 -0
- package/dist/capabilities.contract.d.ts.map +1 -0
- package/dist/capabilities.contract.js +126 -0
- package/dist/control.contract.d.ts +39 -0
- package/dist/control.contract.d.ts.map +1 -0
- package/dist/control.contract.js +2 -0
- package/dist/credentials.contract.d.ts +37 -0
- package/dist/credentials.contract.d.ts.map +1 -0
- package/dist/credentials.contract.js +15 -0
- package/dist/entitlements.contract.d.ts +107 -0
- package/dist/entitlements.contract.d.ts.map +1 -0
- package/dist/entitlements.contract.js +11 -0
- package/dist/errors.contract.d.ts +47 -0
- package/dist/errors.contract.d.ts.map +1 -0
- package/dist/errors.contract.js +48 -0
- package/dist/execution.contract.d.ts +240 -0
- package/dist/execution.contract.d.ts.map +1 -0
- package/dist/execution.contract.js +22 -0
- package/dist/http.contract.d.ts +20 -0
- package/dist/http.contract.d.ts.map +1 -0
- package/dist/http.contract.js +8 -0
- package/dist/implementations.contract.d.ts +120 -0
- package/dist/implementations.contract.d.ts.map +1 -0
- package/dist/implementations.contract.js +2 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/intent.contract.d.ts +137 -0
- package/dist/intent.contract.d.ts.map +1 -0
- package/dist/intent.contract.js +76 -0
- package/dist/logs.contract.d.ts +10 -0
- package/dist/logs.contract.d.ts.map +1 -0
- package/dist/logs.contract.js +2 -0
- package/dist/messages.contract.d.ts +16 -0
- package/dist/messages.contract.d.ts.map +1 -0
- package/dist/messages.contract.js +2 -0
- package/dist/policies.contract.d.ts +253 -0
- package/dist/policies.contract.d.ts.map +1 -0
- package/dist/policies.contract.js +283 -0
- package/dist/prompt-variable-schema.contract.d.ts +75 -0
- package/dist/prompt-variable-schema.contract.d.ts.map +1 -0
- package/dist/prompt-variable-schema.contract.js +572 -0
- package/dist/prompts.contract.d.ts +97 -0
- package/dist/prompts.contract.d.ts.map +1 -0
- package/dist/prompts.contract.js +87 -0
- package/dist/provider.contract.d.ts +477 -0
- package/dist/provider.contract.d.ts.map +1 -0
- package/dist/provider.contract.js +3310 -0
- package/dist/registry.stats.contract.d.ts +39 -0
- package/dist/registry.stats.contract.d.ts.map +1 -0
- package/dist/registry.stats.contract.js +9 -0
- package/dist/runtime.client.d.ts +362 -0
- package/dist/runtime.client.d.ts.map +1 -0
- package/dist/runtime.client.js +545 -0
- package/dist/service-tokens.contract.d.ts +29 -0
- package/dist/service-tokens.contract.d.ts.map +1 -0
- package/dist/service-tokens.contract.js +10 -0
- package/dist/session.contract.d.ts +51 -0
- package/dist/session.contract.d.ts.map +1 -0
- package/dist/session.contract.js +187 -0
- package/dist/subscription.contract.d.ts +37 -0
- package/dist/subscription.contract.d.ts.map +1 -0
- package/dist/subscription.contract.js +45 -0
- package/dist/utils.contract.d.ts +21 -0
- package/dist/utils.contract.d.ts.map +1 -0
- package/dist/utils.contract.js +79 -0
- package/package.json +57 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { ExecutionError } from "./errors.contract";
|
|
2
|
+
import { Message } from "./messages.contract";
|
|
3
|
+
import { Intent } from "./intent.contract";
|
|
4
|
+
import { IntentProvider } from "./provider.contract";
|
|
5
|
+
/**
|
|
6
|
+
* A single execution request coming into the gateway.
|
|
7
|
+
* The backend typically calls this and later writes AICallLog itself.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExecuteIntentRequest {
|
|
10
|
+
context?: ExecutionContext;
|
|
11
|
+
/**
|
|
12
|
+
* Optional template variables for prompt rendering.
|
|
13
|
+
* If omitted, gateway derives variables from `input`.
|
|
14
|
+
*/
|
|
15
|
+
vars?: Record<string, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Optional routing hints from backend.
|
|
18
|
+
* Useful for debugging or forcing a provider/implementation temporarily.
|
|
19
|
+
*/
|
|
20
|
+
routing?: {
|
|
21
|
+
preferProviders?: IntentProvider[];
|
|
22
|
+
denyProviders?: IntentProvider[];
|
|
23
|
+
forceImplementationId?: string | null;
|
|
24
|
+
allowFallback?: boolean;
|
|
25
|
+
maxAttempts?: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One attempt in an execution (for retries/fallback reporting).
|
|
30
|
+
* This is gold for debugging and later AICallLog correlation.
|
|
31
|
+
*/
|
|
32
|
+
export interface ExecutionAttemptReport {
|
|
33
|
+
attempt: number;
|
|
34
|
+
provider: IntentProvider;
|
|
35
|
+
implementationId: string;
|
|
36
|
+
status: ExecutionStatus;
|
|
37
|
+
latencyMs: number;
|
|
38
|
+
error: ExecutionError | null;
|
|
39
|
+
usage?: {
|
|
40
|
+
promptTokens?: number;
|
|
41
|
+
completionTokens?: number;
|
|
42
|
+
totalTokens?: number;
|
|
43
|
+
};
|
|
44
|
+
runHash?: string | null;
|
|
45
|
+
cached: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Final execution report returned by the gateway.
|
|
49
|
+
* The backend should persist the relevant fields into AICallLog.
|
|
50
|
+
*/
|
|
51
|
+
export interface ExecutionReport {
|
|
52
|
+
sessionId: string;
|
|
53
|
+
appId: string;
|
|
54
|
+
context?: ExecutionContext;
|
|
55
|
+
gatewayRequestId: string;
|
|
56
|
+
intent: Intent;
|
|
57
|
+
/**
|
|
58
|
+
* Prompt identity used for reproducibility.
|
|
59
|
+
* Backend should persist at least id+version+sha256.
|
|
60
|
+
*/
|
|
61
|
+
prompt: {
|
|
62
|
+
id: string;
|
|
63
|
+
version: string;
|
|
64
|
+
sha256: string;
|
|
65
|
+
};
|
|
66
|
+
/** Final chosen provider/implementation. */
|
|
67
|
+
finalImplementation: {
|
|
68
|
+
provider: IntentProvider;
|
|
69
|
+
model: string;
|
|
70
|
+
implementationId: string;
|
|
71
|
+
latencyMs: number;
|
|
72
|
+
};
|
|
73
|
+
/** All attempts (including failures). */
|
|
74
|
+
attempts: ExecutionAttemptReport[];
|
|
75
|
+
/** Aggregate usage if available. */
|
|
76
|
+
usage?: {
|
|
77
|
+
promptTokens?: number;
|
|
78
|
+
completionTokens?: number;
|
|
79
|
+
totalTokens?: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Timing breakdown for this execution.
|
|
83
|
+
*
|
|
84
|
+
* Notes:
|
|
85
|
+
* - All `*Ms` fields are durations in milliseconds.
|
|
86
|
+
* - `startedAt`/`endedAt` are wall-clock ISO strings (for correlation/logs).
|
|
87
|
+
* - Duration fields are best-effort and computed by the gateway; they can differ slightly
|
|
88
|
+
* from sums of attempt latencies due to rounding and internal scheduling.
|
|
89
|
+
*/
|
|
90
|
+
timing: {
|
|
91
|
+
/** Wall-clock start time (ISO). */
|
|
92
|
+
startedAt: string;
|
|
93
|
+
/** Wall-clock end time (ISO). */
|
|
94
|
+
endedAt: string;
|
|
95
|
+
/** Total end-to-end latency as measured by the gateway. */
|
|
96
|
+
latencyMs: number;
|
|
97
|
+
/**
|
|
98
|
+
* Gateway-only overhead excluding provider execution time (best-effort).
|
|
99
|
+
*
|
|
100
|
+
* Relationship (approx):
|
|
101
|
+
* - gatewayOverheadMs ≈ latencyMs - providerTotalMs
|
|
102
|
+
*
|
|
103
|
+
* This includes (among other things):
|
|
104
|
+
* - request validation
|
|
105
|
+
* - configuration/registry lookup
|
|
106
|
+
* - prompt rendering / template preparation
|
|
107
|
+
* - routing & candidate selection
|
|
108
|
+
* - retry backoff/jitter waits between attempts
|
|
109
|
+
* - response shaping (parsing/validation) and report building
|
|
110
|
+
*/
|
|
111
|
+
gatewayOverheadMs?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Time spent in the gateway BEFORE the first provider call (best-effort).
|
|
114
|
+
* Intended to capture validation + prompt render + routing.
|
|
115
|
+
*/
|
|
116
|
+
gatewayPreProviderMs?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Time spent in the gateway AFTER provider calls until the response/report is ready (best-effort).
|
|
119
|
+
* This typically includes output parsing/validation and response construction.
|
|
120
|
+
*/
|
|
121
|
+
gatewayPostProviderMs?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Sum of provider execution time across all attempts (best-effort).
|
|
124
|
+
*
|
|
125
|
+
* This is the time spent waiting for the provider(s)/LLM(s) to return, including retries/fallback.
|
|
126
|
+
*/
|
|
127
|
+
providerTotalMs?: number;
|
|
128
|
+
};
|
|
129
|
+
/** Output validation summary. */
|
|
130
|
+
validation?: {
|
|
131
|
+
parsed?: boolean;
|
|
132
|
+
schemaOk?: boolean;
|
|
133
|
+
errors?: string[];
|
|
134
|
+
};
|
|
135
|
+
/** The bundle version used during this execution (helps debugging). */
|
|
136
|
+
configVersion?: string;
|
|
137
|
+
problemHash?: string | null;
|
|
138
|
+
runHash?: string | null;
|
|
139
|
+
outputHash?: string | null;
|
|
140
|
+
cached: boolean;
|
|
141
|
+
}
|
|
142
|
+
export declare enum ExecutionStatus {
|
|
143
|
+
OK = "OK",
|
|
144
|
+
ERROR = "ERROR"
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Response object returned by the gateway.
|
|
148
|
+
* Keep this stable; it's your public internal contract.
|
|
149
|
+
*/
|
|
150
|
+
export interface ExecuteIntentResponse {
|
|
151
|
+
status: ExecutionStatus;
|
|
152
|
+
/** The input */
|
|
153
|
+
input: Message[];
|
|
154
|
+
/** Parsed result (if ok). */
|
|
155
|
+
output?: any;
|
|
156
|
+
/** Error (if error). */
|
|
157
|
+
error?: ExecutionError;
|
|
158
|
+
/** Execution report for backend logging. */
|
|
159
|
+
report: ExecutionReport;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Context info for logging and analytics.
|
|
163
|
+
*/
|
|
164
|
+
export interface ExecutionContext {
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Streaming execution event type names.
|
|
169
|
+
*
|
|
170
|
+
* Notes
|
|
171
|
+
* - These strings are used as SSE `event:` names.
|
|
172
|
+
* - Keep values stable (wire-level behavior).
|
|
173
|
+
*/
|
|
174
|
+
export declare enum ExecutionStreamEventType {
|
|
175
|
+
META = "meta",
|
|
176
|
+
DELTA = "delta",
|
|
177
|
+
FINAL = "final",
|
|
178
|
+
ERROR = "error"
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Metadata emitted at the start of a streaming execution.
|
|
182
|
+
*/
|
|
183
|
+
export interface ExecutionStreamMetaEventData {
|
|
184
|
+
/** Gateway-generated correlation ID for this execution. */
|
|
185
|
+
gatewayRequestId: string;
|
|
186
|
+
/** Intent name being executed. */
|
|
187
|
+
intent: Intent;
|
|
188
|
+
/** ISO timestamp for when the stream started (gateway wall-clock). */
|
|
189
|
+
startedAt: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* A text delta emitted during streaming generation.
|
|
193
|
+
*
|
|
194
|
+
* Notes
|
|
195
|
+
* - v1 focuses on text deltas only.
|
|
196
|
+
* - Providers that do not support native streaming may emit zero delta events.
|
|
197
|
+
*/
|
|
198
|
+
export interface ExecutionStreamDeltaEventData {
|
|
199
|
+
text: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Final execution payload emitted at the end of the stream.
|
|
203
|
+
*
|
|
204
|
+
* Notes
|
|
205
|
+
* - This is the same response shape as non-streaming `executeIntent`.
|
|
206
|
+
* - Even error executions should be delivered as a final response where possible.
|
|
207
|
+
*/
|
|
208
|
+
export interface ExecutionStreamFinalEventData {
|
|
209
|
+
response: ExecuteIntentResponse;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Fatal streaming error emitted when the stream cannot produce a final response.
|
|
213
|
+
*
|
|
214
|
+
* Notes
|
|
215
|
+
* - Prefer emitting `final` with `status=ERROR` when possible.
|
|
216
|
+
*/
|
|
217
|
+
export interface ExecutionStreamErrorEventData {
|
|
218
|
+
error: ExecutionError;
|
|
219
|
+
}
|
|
220
|
+
/** Streaming `meta` event envelope. */
|
|
221
|
+
export interface ExecutionStreamMetaEvent {
|
|
222
|
+
type: ExecutionStreamEventType.META;
|
|
223
|
+
data: ExecutionStreamMetaEventData;
|
|
224
|
+
}
|
|
225
|
+
/** Streaming `delta` event envelope. */
|
|
226
|
+
export interface ExecutionStreamDeltaEvent {
|
|
227
|
+
type: ExecutionStreamEventType.DELTA;
|
|
228
|
+
data: ExecutionStreamDeltaEventData;
|
|
229
|
+
}
|
|
230
|
+
/** Streaming `final` event envelope. */
|
|
231
|
+
export interface ExecutionStreamFinalEvent {
|
|
232
|
+
type: ExecutionStreamEventType.FINAL;
|
|
233
|
+
data: ExecutionStreamFinalEventData;
|
|
234
|
+
}
|
|
235
|
+
/** Streaming `error` event envelope. */
|
|
236
|
+
export interface ExecutionStreamErrorEvent {
|
|
237
|
+
type: ExecutionStreamEventType.ERROR;
|
|
238
|
+
data: ExecutionStreamErrorEventData;
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=execution.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.contract.d.ts","sourceRoot":"","sources":["../src/execution.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEnC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAG3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAG/B;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;QACnC,aAAa,CAAC,EAAE,cAAc,EAAE,CAA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.ExecutionStreamEventType = exports.ExecutionStatus = void 0;
|
|
4
|
+
var ExecutionStatus;
|
|
5
|
+
(function (ExecutionStatus) {
|
|
6
|
+
ExecutionStatus["OK"] = "OK";
|
|
7
|
+
ExecutionStatus["ERROR"] = "ERROR";
|
|
8
|
+
})(ExecutionStatus || (exports.ExecutionStatus = ExecutionStatus = {}));
|
|
9
|
+
/**
|
|
10
|
+
* Streaming execution event type names.
|
|
11
|
+
*
|
|
12
|
+
* Notes
|
|
13
|
+
* - These strings are used as SSE `event:` names.
|
|
14
|
+
* - Keep values stable (wire-level behavior).
|
|
15
|
+
*/
|
|
16
|
+
var ExecutionStreamEventType;
|
|
17
|
+
(function (ExecutionStreamEventType) {
|
|
18
|
+
ExecutionStreamEventType["META"] = "meta";
|
|
19
|
+
ExecutionStreamEventType["DELTA"] = "delta";
|
|
20
|
+
ExecutionStreamEventType["FINAL"] = "final";
|
|
21
|
+
ExecutionStreamEventType["ERROR"] = "error";
|
|
22
|
+
})(ExecutionStreamEventType || (exports.ExecutionStreamEventType = ExecutionStreamEventType = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical HTTP params shape used by runtime for request customization.
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT:
|
|
5
|
+
* - No multi-value headers yet. Duplicates should be resolved by the runtime merge rules.
|
|
6
|
+
*/
|
|
7
|
+
export interface NameValuePair {
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export interface HttpRequestParams {
|
|
12
|
+
headers?: NameValuePair[];
|
|
13
|
+
query?: NameValuePair[];
|
|
14
|
+
/**
|
|
15
|
+
* Convenience field to build the outgoing request Cookie header.
|
|
16
|
+
* Runtime will serialize these pairs into a single `Cookie` header.
|
|
17
|
+
*/
|
|
18
|
+
cookies?: NameValuePair[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=http.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.contract.d.ts","sourceRoot":"","sources":["../src/http.contract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IAExB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;CAC3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Canonical HTTP params shape used by runtime for request customization.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT:
|
|
6
|
+
* - No multi-value headers yet. Duplicates should be resolved by the runtime merge rules.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { IntentProvider } from "./provider.contract";
|
|
2
|
+
import { HttpRequestParams } from "./http.contract";
|
|
3
|
+
/**
|
|
4
|
+
* Time window constraints for an implementation.
|
|
5
|
+
* If present, the implementation is eligible ONLY within these windows.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExecutionWindow {
|
|
8
|
+
/**
|
|
9
|
+
* UTC window: Bit 0..6 represent days of week (recommended: 0=Mon ... 6=Sun).
|
|
10
|
+
*/
|
|
11
|
+
daysMask?: number;
|
|
12
|
+
/**
|
|
13
|
+
* UTC window: Bit 0..23 represent hour slots (bit0 = 00:00-01:00, bit23 = 23:00-00:00).
|
|
14
|
+
*/
|
|
15
|
+
hoursMask?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the execution window must be enforced (if false, the gateway may ignore it and use the implementation anyway).
|
|
18
|
+
*/
|
|
19
|
+
active?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Time window constraints for an implementation.
|
|
23
|
+
* If present, the implementation is eligible ONLY within these windows.
|
|
24
|
+
*/
|
|
25
|
+
export interface ExecutionWindow {
|
|
26
|
+
/**
|
|
27
|
+
* UTC window: Bit 0..6 represent days of week (recommended: 0=Mon ... 6=Sun).
|
|
28
|
+
*/
|
|
29
|
+
daysMask?: number;
|
|
30
|
+
/**
|
|
31
|
+
* UTC window: Bit 0..23 represent hour slots (bit0 = 00:00-01:00, bit23 = 23:00-00:00).
|
|
32
|
+
*/
|
|
33
|
+
hoursMask?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the execution window must be enforced (if false, the gateway may ignore it and use the implementation anyway).
|
|
36
|
+
*/
|
|
37
|
+
active?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Implementation contract: describes how a given provider/model endpoint can be used.
|
|
41
|
+
* This is pure configuration; provider adapters interpret it.
|
|
42
|
+
*/
|
|
43
|
+
export interface ImplementationContract {
|
|
44
|
+
/** Unique implementation ID (stable, e.g., UUID). */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Provider type (OFFICE, OPEN_AI, GROK...). */
|
|
47
|
+
provider: IntentProvider;
|
|
48
|
+
/** Human-readable name for this implementation (e.g., "openai-format-parser"). */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Version of this implementation (e.g., "2026-02-18.2"). */
|
|
51
|
+
version: string;
|
|
52
|
+
/**
|
|
53
|
+
* SHA256 hash of the canonical implementation payload (stable JSON serialization).
|
|
54
|
+
* Useful as an immutable fingerprint / audit trail.
|
|
55
|
+
*/
|
|
56
|
+
sha256: string;
|
|
57
|
+
/**
|
|
58
|
+
* Precomputed semantic hash (stable across irrelevant formatting changes).
|
|
59
|
+
* This MUST be exported from backend and used for:
|
|
60
|
+
* - runHash (execution dedupe)
|
|
61
|
+
*/
|
|
62
|
+
semanticHash: string;
|
|
63
|
+
/**
|
|
64
|
+
* Technical model identifier for the provider.
|
|
65
|
+
* Examples:
|
|
66
|
+
* - "gpt-4.1-mini"
|
|
67
|
+
* - "Qwen3-4B-Instruct-2507"
|
|
68
|
+
* - "grok-2"
|
|
69
|
+
*/
|
|
70
|
+
model: string;
|
|
71
|
+
/** Human readable description for diagnostics. */
|
|
72
|
+
description?: string;
|
|
73
|
+
/** Execution endpoint (HTTP, OpenAI-compatible, Dcdr, etc). */
|
|
74
|
+
endpoint: string;
|
|
75
|
+
/**
|
|
76
|
+
* Auth configuration (token, headers, mTLS, etc).
|
|
77
|
+
* NOTE: This must NOT affect semantic hashing in runtime.
|
|
78
|
+
*/
|
|
79
|
+
authConfig?: HttpRequestParams;
|
|
80
|
+
/** Optional reference to a credential contract (by id) for provider-specific auth config */
|
|
81
|
+
credentialRef?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Provider-specific runtime defaults (modelName, temperature, top_p, max_tokens, response_format, etc).
|
|
84
|
+
* NOTE: AISemantics will filter keys when building runtimeParamsKey.
|
|
85
|
+
*/
|
|
86
|
+
runtimeConfig?: any;
|
|
87
|
+
/** Is this implementation usable. */
|
|
88
|
+
active: boolean;
|
|
89
|
+
/** Weight for load balancing or selection purposes. */
|
|
90
|
+
weight?: number;
|
|
91
|
+
order?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Whether this implementation should be considered local / on-prem / office-side.
|
|
94
|
+
* Useful for LOCAL_FIRST execution policies.
|
|
95
|
+
*/
|
|
96
|
+
local?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Relative cost score for policy-based selection.
|
|
99
|
+
* Lower values mean cheaper implementations.
|
|
100
|
+
* Used by CHEAPEST_FIRST policies.
|
|
101
|
+
*/
|
|
102
|
+
costScore?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Relative latency score for policy-based selection.
|
|
105
|
+
* Lower values mean faster implementations.
|
|
106
|
+
* Used by FASTEST_FIRST policies.
|
|
107
|
+
*/
|
|
108
|
+
latencyScore?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Relative quality score for policy-based selection.
|
|
111
|
+
* Higher values mean better expected output quality.
|
|
112
|
+
* Used by QUALITY_FIRST policies.
|
|
113
|
+
*/
|
|
114
|
+
qualityScore?: number;
|
|
115
|
+
trackingIOProbability?: number;
|
|
116
|
+
cacheTTLSeconds?: number;
|
|
117
|
+
/** Execution window constraints. */
|
|
118
|
+
executionWindow?: ExecutionWindow;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=implementations.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementations.contract.d.ts","sourceRoot":"","sources":["../src/implementations.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAE9B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAGD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAE9B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAGD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IAErC,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IAEX,gDAAgD;IAChD,QAAQ,EAAE,cAAc,CAAC;IAEzB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IAEb,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAG/B,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB;;;OAGG;IACH,aAAa,CAAC,EAAE,GAAG,CAAC;IAEpB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAEhB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,oCAAoC;IACpC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./control.contract";
|
|
2
|
+
export * from "./errors.contract";
|
|
3
|
+
export * from "./execution.contract";
|
|
4
|
+
export * from "./implementations.contract";
|
|
5
|
+
export * from "./messages.contract";
|
|
6
|
+
export * from "./intent.contract";
|
|
7
|
+
export * from "./policies.contract";
|
|
8
|
+
export * from "./prompts.contract";
|
|
9
|
+
export * from "./session.contract";
|
|
10
|
+
export * from "./logs.contract";
|
|
11
|
+
export * from "./provider.contract";
|
|
12
|
+
export * from "./credentials.contract";
|
|
13
|
+
export * from "./http.contract";
|
|
14
|
+
export * from "./entitlements.contract";
|
|
15
|
+
export * from "./service-tokens.contract";
|
|
16
|
+
export * from "./capabilities.contract";
|
|
17
|
+
export * from "./subscription.contract";
|
|
18
|
+
export * from "./runtime.client";
|
|
19
|
+
export * from "./utils.contract";
|
|
20
|
+
export * from "./prompt-variable-schema.contract";
|
|
21
|
+
export * from "./registry.stats.contract";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./control.contract"), exports);
|
|
18
|
+
__exportStar(require("./errors.contract"), exports);
|
|
19
|
+
__exportStar(require("./execution.contract"), exports);
|
|
20
|
+
__exportStar(require("./implementations.contract"), exports);
|
|
21
|
+
__exportStar(require("./messages.contract"), exports);
|
|
22
|
+
__exportStar(require("./intent.contract"), exports);
|
|
23
|
+
__exportStar(require("./policies.contract"), exports);
|
|
24
|
+
__exportStar(require("./prompts.contract"), exports);
|
|
25
|
+
__exportStar(require("./session.contract"), exports);
|
|
26
|
+
__exportStar(require("./logs.contract"), exports);
|
|
27
|
+
__exportStar(require("./provider.contract"), exports);
|
|
28
|
+
__exportStar(require("./credentials.contract"), exports);
|
|
29
|
+
__exportStar(require("./http.contract"), exports);
|
|
30
|
+
__exportStar(require("./entitlements.contract"), exports);
|
|
31
|
+
__exportStar(require("./service-tokens.contract"), exports);
|
|
32
|
+
__exportStar(require("./capabilities.contract"), exports);
|
|
33
|
+
__exportStar(require("./subscription.contract"), exports);
|
|
34
|
+
__exportStar(require("./runtime.client"), exports);
|
|
35
|
+
__exportStar(require("./utils.contract"), exports);
|
|
36
|
+
__exportStar(require("./prompt-variable-schema.contract"), exports);
|
|
37
|
+
__exportStar(require("./registry.stats.contract"), exports);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ImplementationContract } from "./implementations.contract";
|
|
2
|
+
import { RetryPolicy, ExecutionPolicy } from "./policies.contract";
|
|
3
|
+
import { PromptTemplate, PromptVariable } from "./prompts.contract";
|
|
4
|
+
export type Intent = string;
|
|
5
|
+
/**
|
|
6
|
+
* Supported intent execution types.
|
|
7
|
+
*
|
|
8
|
+
* This defines the type of task the intent performs and which
|
|
9
|
+
* provider capabilities are required.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum IntentType {
|
|
12
|
+
/**
|
|
13
|
+
* Standard conversational or prompt-response interaction.
|
|
14
|
+
*
|
|
15
|
+
* Examples:
|
|
16
|
+
* - Q&A
|
|
17
|
+
* - summarization
|
|
18
|
+
* - reasoning
|
|
19
|
+
* - structured output generation
|
|
20
|
+
*/
|
|
21
|
+
CHAT = "CHAT",
|
|
22
|
+
/**
|
|
23
|
+
* Text embedding generation.
|
|
24
|
+
*
|
|
25
|
+
* Examples:
|
|
26
|
+
* - semantic search
|
|
27
|
+
* - vector indexing
|
|
28
|
+
* - similarity comparison
|
|
29
|
+
*/
|
|
30
|
+
EMBEDDING = "EMBEDDING",
|
|
31
|
+
/**
|
|
32
|
+
* Image generation.
|
|
33
|
+
*
|
|
34
|
+
* Examples:
|
|
35
|
+
* - DALL·E
|
|
36
|
+
* - diffusion models
|
|
37
|
+
*/
|
|
38
|
+
IMAGE_GENERATION = "IMAGE_GENERATION",
|
|
39
|
+
/**
|
|
40
|
+
* Image understanding / multimodal analysis.
|
|
41
|
+
*
|
|
42
|
+
* Examples:
|
|
43
|
+
* - vision LLMs
|
|
44
|
+
* - OCR-assisted models
|
|
45
|
+
*/
|
|
46
|
+
IMAGE_ANALYSIS = "IMAGE_ANALYSIS",
|
|
47
|
+
/**
|
|
48
|
+
* Audio transcription.
|
|
49
|
+
*
|
|
50
|
+
* Examples:
|
|
51
|
+
* - Whisper
|
|
52
|
+
* - speech-to-text models
|
|
53
|
+
*/
|
|
54
|
+
SPEECH_TO_TEXT = "SPEECH_TO_TEXT",
|
|
55
|
+
/**
|
|
56
|
+
* Audio generation / text-to-speech.
|
|
57
|
+
*/
|
|
58
|
+
TEXT_TO_SPEECH = "TEXT_TO_SPEECH",
|
|
59
|
+
/**
|
|
60
|
+
* Multimodal tasks combining text + images + audio.
|
|
61
|
+
*/
|
|
62
|
+
MULTIMODAL = "MULTIMODAL",
|
|
63
|
+
/**
|
|
64
|
+
* Deterministic tool execution.
|
|
65
|
+
*
|
|
66
|
+
* Examples:
|
|
67
|
+
* - HTTP calls
|
|
68
|
+
* - scripts
|
|
69
|
+
* - external API connectors
|
|
70
|
+
*/
|
|
71
|
+
TOOL = "TOOL",
|
|
72
|
+
/**
|
|
73
|
+
* Internal deterministic rule engine.
|
|
74
|
+
*/
|
|
75
|
+
RULE_ENGINE = "RULE_ENGINE"
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A single intent contract.
|
|
79
|
+
* This is what the gateway uses to execute requests in a provider-agnostic way.
|
|
80
|
+
*/
|
|
81
|
+
export interface IntentContract {
|
|
82
|
+
id: string;
|
|
83
|
+
/** Semantic intent (e.g., "name_processor", "format_parser"). */
|
|
84
|
+
intent: Intent;
|
|
85
|
+
/** Intent execution type */
|
|
86
|
+
type: IntentType;
|
|
87
|
+
/** Optional human-friendly name for diagnostics/UI (can equal intent). */
|
|
88
|
+
name?: string;
|
|
89
|
+
/** Global enable/disable for this intent. */
|
|
90
|
+
active: boolean;
|
|
91
|
+
/** Human readable description for diagnostics. */
|
|
92
|
+
description?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Input schema (JSON Schema or custom prompt schema).
|
|
95
|
+
* The gateway may validate input before running providers.
|
|
96
|
+
*/
|
|
97
|
+
inputSchema?: Record<string, PromptVariable>;
|
|
98
|
+
/**
|
|
99
|
+
* Output schema (JSON Schema or custom prompt schema).
|
|
100
|
+
* The gateway may validate output and trigger repair/fallback when it fails.
|
|
101
|
+
*/
|
|
102
|
+
outputSchema?: Record<string, PromptVariable>;
|
|
103
|
+
/**
|
|
104
|
+
* Active prompt template for this intent.
|
|
105
|
+
* Versioned + hashed for reproducibility.
|
|
106
|
+
*/
|
|
107
|
+
defaultPrompt: PromptTemplate;
|
|
108
|
+
/**
|
|
109
|
+
* Optional alternate prompt template for canary/A/B testing.
|
|
110
|
+
*/
|
|
111
|
+
canaryPrompt?: PromptTemplate;
|
|
112
|
+
/**
|
|
113
|
+
* Weight for selecting the canary prompt (e.g., 0.1 for 10% traffic).
|
|
114
|
+
* The gateway should use this to randomly route requests to the canary prompt.
|
|
115
|
+
*/
|
|
116
|
+
canaryPromptWeight?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Execution policy for selecting and prioritizing implementations.
|
|
119
|
+
*/
|
|
120
|
+
executionPolicy?: ExecutionPolicy;
|
|
121
|
+
/**
|
|
122
|
+
* Retry/fallback policy for this intent.
|
|
123
|
+
* This should be centrally configured from your backend UI.
|
|
124
|
+
*/
|
|
125
|
+
retryPolicy: RetryPolicy;
|
|
126
|
+
/**
|
|
127
|
+
* Implementations available for this intent.
|
|
128
|
+
* The gateway selects candidates based on the execution policy first,
|
|
129
|
+
* then applies retry/fallback logic if needed.
|
|
130
|
+
*/
|
|
131
|
+
implementations: ImplementationContract[];
|
|
132
|
+
/**
|
|
133
|
+
* Optional tags for future filtering (e.g., sector, "strict_json", etc.).
|
|
134
|
+
*/
|
|
135
|
+
tags?: string[];
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=intent.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.contract.d.ts","sourceRoot":"","sources":["../src/intent.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAoB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAG5B;;;;;GAKG;AACH,oBAAY,UAAU;IAEpB;;;;;;;;OAQG;IACH,IAAI,SAAS;IAEb;;;;;;;OAOG;IACH,SAAS,cAAc;IAEvB;;;;;;OAMG;IACH,gBAAgB,qBAAqB;IAErC;;;;;;OAMG;IACH,cAAc,mBAAmB;IAEjC;;;;;;OAMG;IACH,cAAc,m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