@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,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregated registry stats for internal ops.
|
|
3
|
+
*
|
|
4
|
+
* Notes
|
|
5
|
+
* - Intended for server-to-server usage (runtime ↔ backend).
|
|
6
|
+
* - Contains only counts/rollups; does not include per-customer registry payloads.
|
|
7
|
+
*/
|
|
8
|
+
export interface DcdrRegistryStatsCustomersBlock {
|
|
9
|
+
active: number;
|
|
10
|
+
total: number;
|
|
11
|
+
}
|
|
12
|
+
export interface DcdrRegistryStatsRegistriesBlock {
|
|
13
|
+
activeCustomersWithRegistry: number;
|
|
14
|
+
totalCustomersWithRegistry: number;
|
|
15
|
+
}
|
|
16
|
+
export interface DcdrRegistryStatsRecentUsageWindow {
|
|
17
|
+
sinceISO: string;
|
|
18
|
+
calls: number;
|
|
19
|
+
customersWithCalls: number;
|
|
20
|
+
customersPct: number;
|
|
21
|
+
}
|
|
22
|
+
export interface DcdrRegistryStatsRecentUsageBlock {
|
|
23
|
+
last1h: DcdrRegistryStatsRecentUsageWindow;
|
|
24
|
+
last6h: DcdrRegistryStatsRecentUsageWindow;
|
|
25
|
+
last24h: DcdrRegistryStatsRecentUsageWindow;
|
|
26
|
+
}
|
|
27
|
+
export interface DcdrRegistryStatsWorkloadBlock {
|
|
28
|
+
totalIntents: number;
|
|
29
|
+
totalImplementations: number;
|
|
30
|
+
recentAICallLogsUsage: DcdrRegistryStatsRecentUsageBlock;
|
|
31
|
+
}
|
|
32
|
+
export interface DcdrInternalRegistryStatsResponse {
|
|
33
|
+
sampledAt: string;
|
|
34
|
+
includeInactive: boolean;
|
|
35
|
+
customers: DcdrRegistryStatsCustomersBlock;
|
|
36
|
+
registries: DcdrRegistryStatsRegistriesBlock;
|
|
37
|
+
workload: DcdrRegistryStatsWorkloadBlock;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=registry.stats.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.stats.contract.d.ts","sourceRoot":"","sources":["../src/registry.stats.contract.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gCAAgC;IAC/C,2BAA2B,EAAE,MAAM,CAAC;IACpC,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,kCAAkC,CAAC;IAC3C,MAAM,EAAE,kCAAkC,CAAC;IAC3C,OAAO,EAAE,kCAAkC,CAAC;CAC7C;AAED,MAAM,WAAW,8BAA8B;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,iCAAiC,CAAC;CAC1D;AAED,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,+BAA+B,CAAC;IAC3C,UAAU,EAAE,gCAAgC,CAAC;IAC7C,QAAQ,EAAE,8BAA8B,CAAC;CAC1C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Aggregated registry stats for internal ops.
|
|
4
|
+
*
|
|
5
|
+
* Notes
|
|
6
|
+
* - Intended for server-to-server usage (runtime ↔ backend).
|
|
7
|
+
* - Contains only counts/rollups; does not include per-customer registry payloads.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { ExecuteIntentRequest, ExecuteIntentResponse, ExecutionStreamDeltaEvent, ExecutionStreamErrorEvent, ExecutionStreamFinalEvent, ExecutionStreamMetaEvent } from "./execution.contract";
|
|
2
|
+
import { DcdrEntitlementsContract } from "./entitlements.contract";
|
|
3
|
+
/**
|
|
4
|
+
* Options for `DcdrRuntimeClient.executeIntentStream`.
|
|
5
|
+
*/
|
|
6
|
+
export interface DcdrRuntimeClientStreamOptions {
|
|
7
|
+
/** Optional request timeout override (ms). Defaults to client timeoutMs. */
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
/** Optional abort signal for client-side cancellation. */
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Runtime healthcheck response shape.
|
|
14
|
+
*
|
|
15
|
+
* Notes
|
|
16
|
+
* - This is intentionally minimal and tolerant to additional fields.
|
|
17
|
+
*/
|
|
18
|
+
export interface DcdrRuntimeHealthcheckResponse {
|
|
19
|
+
status: "OK" | "UNAVAILABLE" | "ERROR";
|
|
20
|
+
availability?: number;
|
|
21
|
+
freeMemGB?: string;
|
|
22
|
+
load1m?: number[];
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Runtime version/build response shape.
|
|
27
|
+
*
|
|
28
|
+
* Notes
|
|
29
|
+
* - This is intended for diagnostics and supportability.
|
|
30
|
+
* - The runtime may add fields over time; consumers should treat unknown fields as ignorable.
|
|
31
|
+
* - Some fields are intentionally omitted in cloud mode (multi-tenant) to avoid leaking host details.
|
|
32
|
+
*/
|
|
33
|
+
export interface DcdrRuntimeVersionResponse {
|
|
34
|
+
/** CI build identifier (Azure Pipelines `Build.BuildNumber`), e.g. `20260416.1`. */
|
|
35
|
+
buildNumber?: string;
|
|
36
|
+
/** Build date (typically ISO 8601), e.g. `2026-04-16` or `2026-04-16T12:34:56Z`. */
|
|
37
|
+
buildDate?: string;
|
|
38
|
+
/** Source revision identifier (short or full SHA), e.g. `42b224f5`. */
|
|
39
|
+
gitSha?: string;
|
|
40
|
+
/** Present in runtime mode (`--registry`). Intentionally omitted in cloud mode. */
|
|
41
|
+
nodeVersion?: string;
|
|
42
|
+
/** Present in runtime mode (`--registry`). Intentionally omitted in cloud mode. */
|
|
43
|
+
uptimeSeconds?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Minimal dry-run response shape.
|
|
47
|
+
*
|
|
48
|
+
* Notes
|
|
49
|
+
* - Runtime may return extra fields; keep this tolerant.
|
|
50
|
+
*/
|
|
51
|
+
export interface DcdrRuntimeDryRunResponse {
|
|
52
|
+
status: string;
|
|
53
|
+
error?: {
|
|
54
|
+
message?: string;
|
|
55
|
+
} | string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Minimal eval response shape.
|
|
59
|
+
*
|
|
60
|
+
* Notes
|
|
61
|
+
* - Eval is cloud-only; runtime/freeware mode may return a 403 error.
|
|
62
|
+
*/
|
|
63
|
+
export interface DcdrRuntimeEvalResponse {
|
|
64
|
+
intent: string;
|
|
65
|
+
total: number;
|
|
66
|
+
results: Array<{
|
|
67
|
+
ok: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Circuit breaker status snapshot returned by the runtime.
|
|
72
|
+
*/
|
|
73
|
+
export interface DcdrRuntimeCircuitBreakerStatusSnapshot {
|
|
74
|
+
/** Tenant/customer identifier used for scoping breaker state. */
|
|
75
|
+
tenantCid: string;
|
|
76
|
+
provider: string;
|
|
77
|
+
model?: string;
|
|
78
|
+
failures: number;
|
|
79
|
+
blockedUntilMs?: number;
|
|
80
|
+
blocked: boolean;
|
|
81
|
+
blockedTtlMs?: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Minimal response for a breaker reset operation.
|
|
85
|
+
*/
|
|
86
|
+
export interface DcdrRuntimeCircuitBreakerResetResponse {
|
|
87
|
+
ok: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Status for optional entitlements data returned by the auth check endpoint.
|
|
91
|
+
*/
|
|
92
|
+
export declare enum DcdrRuntimeAuthCheckEntitlementsStatus {
|
|
93
|
+
OK = "OK",
|
|
94
|
+
ERROR = "ERROR",
|
|
95
|
+
SKIPPED = "SKIPPED"
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Response shape for token validation diagnostics.
|
|
99
|
+
*
|
|
100
|
+
* Notes
|
|
101
|
+
* - This endpoint is intended for customer integrations to verify that their configured token is accepted by the runtime.
|
|
102
|
+
* - The runtime may add extra fields over time; consumers should treat unknown fields as ignorable.
|
|
103
|
+
*/
|
|
104
|
+
export interface DcdrRuntimeAuthCheckResponse {
|
|
105
|
+
valid: boolean;
|
|
106
|
+
authMode?: "internal" | "customer";
|
|
107
|
+
nowMs: number;
|
|
108
|
+
/** Present for customer tokens. */
|
|
109
|
+
cid?: string;
|
|
110
|
+
/** Present for customer tokens. */
|
|
111
|
+
session?: {
|
|
112
|
+
id: string;
|
|
113
|
+
aid: string;
|
|
114
|
+
cid?: string;
|
|
115
|
+
iat: number;
|
|
116
|
+
exp: number;
|
|
117
|
+
scopes: string[];
|
|
118
|
+
};
|
|
119
|
+
/** Present for customer tokens when snapshot allowlist info is available. */
|
|
120
|
+
allowlist?: {
|
|
121
|
+
snapshotAgeMs: number;
|
|
122
|
+
};
|
|
123
|
+
/** Present for customer tokens when backend entitlements are enabled. */
|
|
124
|
+
entitlementsStatus?: DcdrRuntimeAuthCheckEntitlementsStatus;
|
|
125
|
+
entitlements?: DcdrEntitlementsContract;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Configuration for `DcdrRuntimeClient`.
|
|
129
|
+
*/
|
|
130
|
+
export interface DcdrRuntimeClientConfig {
|
|
131
|
+
/**
|
|
132
|
+
* Base URL for the runtime, e.g. `https://dcdr.my-company.com`.
|
|
133
|
+
*
|
|
134
|
+
* Defaults to `https://runtime.dcdr.ai` when omitted.
|
|
135
|
+
*/
|
|
136
|
+
baseUrl?: string;
|
|
137
|
+
/** Customer-mode auth: backend-issued DcdrSessionToken. */
|
|
138
|
+
bearerToken?: string;
|
|
139
|
+
/** Internal-mode auth: runtime API token (dev/ops/backplane). */
|
|
140
|
+
apiToken?: string;
|
|
141
|
+
/** Optional session bypass token (only when server explicitly allows it). */
|
|
142
|
+
sessionBypassToken?: string;
|
|
143
|
+
/** Optional request timeout; defaults to 10 seconds. */
|
|
144
|
+
timeoutMs?: number;
|
|
145
|
+
/** Optional additional headers to send on all requests. */
|
|
146
|
+
extraHeaders?: Record<string, string>;
|
|
147
|
+
/**
|
|
148
|
+
* Optional `fetch` implementation.
|
|
149
|
+
* Useful for tests or non-standard runtimes.
|
|
150
|
+
*/
|
|
151
|
+
fetchFn?: (input: string, init?: RequestInit) => Promise<Response>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* HTTP client for interacting with the DCDR Runtime REST API.
|
|
155
|
+
*
|
|
156
|
+
* @remarks
|
|
157
|
+
* `DcdrRuntimeClient` wraps a `fetch` implementation and provides typed convenience methods for common runtime endpoints
|
|
158
|
+
* (execution, system info, health, metrics, circuit breaker inspection/reset). It supports request timeouts via
|
|
159
|
+
* {@link AbortController} and can be configured with additional headers.
|
|
160
|
+
*
|
|
161
|
+
* This client is intentionally small and dependency-free:
|
|
162
|
+
* - It does not attempt retries or circuit breaking (those are runtime concerns).
|
|
163
|
+
* - It does not validate payload schemas beyond basic response shape parsing.
|
|
164
|
+
*
|
|
165
|
+
* ## Authentication
|
|
166
|
+
* Exactly one of the following auth modes should be used:
|
|
167
|
+
* - **Bearer token**: sets `Authorization: Bearer <token>`
|
|
168
|
+
* - **API token**: sets `token: <token>` and optionally `x-session-bypass: <token>` when `sessionBypassToken` is provided
|
|
169
|
+
*
|
|
170
|
+
* If both `bearerToken` and `apiToken` are provided, construction throws.
|
|
171
|
+
*
|
|
172
|
+
* ## Timeouts
|
|
173
|
+
* Requests are aborted after `timeoutMs` (default: `10_000`) using `AbortController`.
|
|
174
|
+
*
|
|
175
|
+
* ## Error behavior
|
|
176
|
+
* - Non-OK HTTP responses throw an {@link Error} including method, path, status, and a short body preview.
|
|
177
|
+
* - JSON endpoints require `content-type: application/json` (runtime should set this).
|
|
178
|
+
* - Abort/timeout failures surface as a thrown {@link Error} from the underlying `fetch` implementation.
|
|
179
|
+
*
|
|
180
|
+
* ## Version / build info
|
|
181
|
+
* The {@link DcdrRuntimeClient.version} method calls `GET /api/system/version` and returns a {@link DcdrRuntimeVersionResponse}
|
|
182
|
+
* intended for support diagnostics (build number/date/SHA and, in runtime mode only, node version + uptime).
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* // Customer mode (cloud)
|
|
187
|
+
* const client = new DcdrRuntimeClient({
|
|
188
|
+
* bearerToken: process.env.DCDR_SESSION_TOKEN,
|
|
189
|
+
* });
|
|
190
|
+
*
|
|
191
|
+
* const hc = await client.healthcheck();
|
|
192
|
+
* const res = await client.executeIntent("MY_INTENT", { vars: { name: "Ada" } });
|
|
193
|
+
* const ver = await client.version();
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* // Internal mode (dev/ops)
|
|
199
|
+
* const client = new DcdrRuntimeClient({
|
|
200
|
+
* baseUrl: "http://localhost:8000",
|
|
201
|
+
* apiToken: "dev-token",
|
|
202
|
+
* sessionBypassToken: "bypass-token",
|
|
203
|
+
* });
|
|
204
|
+
*
|
|
205
|
+
* const ver = await client.version();
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* @public
|
|
209
|
+
*/
|
|
210
|
+
export declare class DcdrRuntimeClient {
|
|
211
|
+
private readonly baseUrl;
|
|
212
|
+
private readonly bearerToken?;
|
|
213
|
+
private readonly apiToken?;
|
|
214
|
+
private readonly sessionBypassToken?;
|
|
215
|
+
private readonly timeoutMs;
|
|
216
|
+
private readonly extraHeaders;
|
|
217
|
+
private readonly fetchFn;
|
|
218
|
+
/**
|
|
219
|
+
* Creates a new runtime client.
|
|
220
|
+
* @param cfg Client configuration.
|
|
221
|
+
*/
|
|
222
|
+
constructor(cfg: DcdrRuntimeClientConfig);
|
|
223
|
+
/**
|
|
224
|
+
* Calls `POST /api/execution/run/:intent`.
|
|
225
|
+
* @param intent Intent name.
|
|
226
|
+
* @param request Execute request payload.
|
|
227
|
+
* @returns Execution result.
|
|
228
|
+
*/
|
|
229
|
+
executeIntent(intent: string, request: ExecuteIntentRequest): Promise<ExecuteIntentResponse>;
|
|
230
|
+
/**
|
|
231
|
+
* Calls `POST /api/execution/stream/:intent` and yields SSE events.
|
|
232
|
+
*
|
|
233
|
+
* Notes
|
|
234
|
+
* - The streaming endpoint is additive; `executeIntent()` remains the stable JSON path.
|
|
235
|
+
* - v1 streams a minimal envelope (`meta` then `final`). Providers without native streaming
|
|
236
|
+
* may yield zero `delta` events.
|
|
237
|
+
*
|
|
238
|
+
* @param intent Intent name.
|
|
239
|
+
* @param request Execute request payload.
|
|
240
|
+
* @param opts Streaming options (timeout/signal).
|
|
241
|
+
*/
|
|
242
|
+
executeIntentStream(intent: string, request: ExecuteIntentRequest, opts?: DcdrRuntimeClientStreamOptions): AsyncGenerator<ExecutionStreamMetaEvent | ExecutionStreamDeltaEvent | ExecutionStreamFinalEvent | ExecutionStreamErrorEvent, void, void>;
|
|
243
|
+
/**
|
|
244
|
+
* Parses a ReadableStream of SSE bytes into discrete `{event,data}` frames.
|
|
245
|
+
*/
|
|
246
|
+
private parseSseStream;
|
|
247
|
+
/**
|
|
248
|
+
* Parses a single SSE event frame.
|
|
249
|
+
*/
|
|
250
|
+
private parseSseEvent;
|
|
251
|
+
/**
|
|
252
|
+
* Calls `POST /api/execution/demo/:intent`.
|
|
253
|
+
* @param intent Demo intent (e.g. `DCDR_LOCAL_DEMO`).
|
|
254
|
+
* @param request Execute request payload.
|
|
255
|
+
* @returns Execution result.
|
|
256
|
+
*/
|
|
257
|
+
demo(intent: string, request: ExecuteIntentRequest): Promise<ExecuteIntentResponse>;
|
|
258
|
+
/**
|
|
259
|
+
* Calls `GET /api/system/healthcheck`.
|
|
260
|
+
* @returns Healthcheck response.
|
|
261
|
+
*/
|
|
262
|
+
healthcheck(): Promise<DcdrRuntimeHealthcheckResponse>;
|
|
263
|
+
/**
|
|
264
|
+
* Calls `GET /api/system/version`.
|
|
265
|
+
* @returns Runtime version/build info.
|
|
266
|
+
*/
|
|
267
|
+
version(): Promise<DcdrRuntimeVersionResponse>;
|
|
268
|
+
/**
|
|
269
|
+
* Calls `GET /api/system/metrics`.
|
|
270
|
+
* Returns the raw Prometheus exposition format text.
|
|
271
|
+
*
|
|
272
|
+
* @param token Optional metrics query token (`?token=...`) when the runtime is configured to require it.
|
|
273
|
+
* @returns Metrics text.
|
|
274
|
+
*/
|
|
275
|
+
metrics(token?: string): Promise<string>;
|
|
276
|
+
/**
|
|
277
|
+
* Calls `GET /api/auth/check`.
|
|
278
|
+
*
|
|
279
|
+
* Notes
|
|
280
|
+
* - This endpoint is intended for customer integrations to verify their auth configuration.
|
|
281
|
+
* - It performs the same validation path as execution calls, but does not execute an Intent.
|
|
282
|
+
*/
|
|
283
|
+
authCheck(): Promise<DcdrRuntimeAuthCheckResponse>;
|
|
284
|
+
/**
|
|
285
|
+
* Calls `POST /api/execution/dry-run/:intent`.
|
|
286
|
+
* @param intent Intent name.
|
|
287
|
+
* @param vars Template variables.
|
|
288
|
+
* @returns Dry-run response.
|
|
289
|
+
*/
|
|
290
|
+
dryRun(intent: string, vars: Record<string, unknown>): Promise<DcdrRuntimeDryRunResponse>;
|
|
291
|
+
/**
|
|
292
|
+
* Calls `POST /api/execution/eval/:intent`.
|
|
293
|
+
*
|
|
294
|
+
* Notes
|
|
295
|
+
* - Eval is disabled in freeware runtime mode (`--registry`).
|
|
296
|
+
*
|
|
297
|
+
* @param intent Intent name.
|
|
298
|
+
* @param vars Template variables.
|
|
299
|
+
* @returns Eval response.
|
|
300
|
+
*/
|
|
301
|
+
eval(intent: string, vars: Record<string, unknown>): Promise<DcdrRuntimeEvalResponse>;
|
|
302
|
+
/**
|
|
303
|
+
* Calls `GET /api/execution/circuit-breakers?provider=...&model=...`.
|
|
304
|
+
*
|
|
305
|
+
* Notes
|
|
306
|
+
* - Breakers are tenant-scoped server-side based on auth.
|
|
307
|
+
* - In internal mode, you may optionally pass `tenantCid` to inspect a specific tenant.
|
|
308
|
+
*
|
|
309
|
+
* @param provider Provider name.
|
|
310
|
+
* @param model Optional model.
|
|
311
|
+
* @param tenantCid Optional tenant/customer identifier (internal mode only).
|
|
312
|
+
* @returns Circuit breaker snapshot.
|
|
313
|
+
*/
|
|
314
|
+
circuitBreakerStatus(provider: string, model?: string, tenantCid?: string): Promise<DcdrRuntimeCircuitBreakerStatusSnapshot>;
|
|
315
|
+
/**
|
|
316
|
+
* Calls `PUT /api/execution/circuit-breakers/reset`.
|
|
317
|
+
*
|
|
318
|
+
* Notes
|
|
319
|
+
* - Internal-only endpoint.
|
|
320
|
+
* - Breakers are tenant-scoped server-side.
|
|
321
|
+
* - In internal mode, you may optionally pass `tenantCid` to reset a specific tenant.
|
|
322
|
+
*
|
|
323
|
+
* @param provider Provider name.
|
|
324
|
+
* @param model Optional model.
|
|
325
|
+
* @param tenantCid Optional tenant/customer identifier (internal mode only).
|
|
326
|
+
* @returns Reset operation result.
|
|
327
|
+
*/
|
|
328
|
+
resetCircuitBreaker(provider: string, model?: string, tenantCid?: string): Promise<DcdrRuntimeCircuitBreakerResetResponse>;
|
|
329
|
+
/**
|
|
330
|
+
* Performs an HTTP request and parses a JSON response.
|
|
331
|
+
*
|
|
332
|
+
* @remarks
|
|
333
|
+
* - Requires `content-type: application/json` on successful responses.
|
|
334
|
+
* - Allows an empty response body and treats it as `{}` (for endpoints that may return no content).
|
|
335
|
+
* - Applies auth headers based on the configured auth mode.
|
|
336
|
+
* - Aborts the request after `timeoutMs` via {@link AbortController}.
|
|
337
|
+
*
|
|
338
|
+
* @param args Request parameters.
|
|
339
|
+
* @returns Parsed JSON body.
|
|
340
|
+
* @throws {@link Error} If the HTTP response is not OK, if the response is not JSON, or if JSON parsing fails.
|
|
341
|
+
*/
|
|
342
|
+
private requestJson;
|
|
343
|
+
/**
|
|
344
|
+
* Performs an HTTP request and returns the response body as plain text.
|
|
345
|
+
*
|
|
346
|
+
* @remarks
|
|
347
|
+
* Builds the request URL by concatenating {@link DcdrRuntimeClient.baseUrl} with {@link RequestTextArgs.path}.
|
|
348
|
+
* Merges {@link DcdrRuntimeClient.extraHeaders} into the request headers and applies authentication:
|
|
349
|
+
* - If {@link DcdrRuntimeClient.bearerToken} is set, adds an `Authorization: Bearer <token>` header.
|
|
350
|
+
* - Otherwise, if {@link DcdrRuntimeClient.apiToken} is set, adds a `token: <token>` header and, if present,
|
|
351
|
+
* adds `x-session-bypass: <token>` from {@link DcdrRuntimeClient.sessionBypassToken}.
|
|
352
|
+
*
|
|
353
|
+
* Uses an {@link AbortController} to abort the request after {@link RequestTextArgs.timeoutMs} milliseconds.
|
|
354
|
+
*
|
|
355
|
+
* @param args - Request configuration including method, path, and timeout.
|
|
356
|
+
* @returns The response body as text.
|
|
357
|
+
* @throws {@link Error} If the response status is not OK (`resp.ok === false`). The error message includes the
|
|
358
|
+
* HTTP method, path, status code, and a bounded preview of the response body.
|
|
359
|
+
*/
|
|
360
|
+
private requestText;
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=runtime.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.client.d.ts","sourceRoot":"","sources":["../src/runtime.client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EAEzB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAgBD;;;;;GAKG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,IAAI,GAAG,aAAa,GAAG,OAAO,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,mFAAmF;IACnF,WAAW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