cdk-local 0.147.0 → 0.147.2
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 +10 -2
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/{docker-cmd-C6h4cSxa.js → docker-cmd-DLX1TqVw.js} +1 -1
- package/dist/{docker-cmd-C6h4cSxa.js.map → docker-cmd-DLX1TqVw.js.map} +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/internal.d.ts +879 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/{local-studio-DcBEEMJp.d.ts → local-studio-BBA_8Xvk.d.ts} +2 -881
- package/dist/local-studio-BBA_8Xvk.d.ts.map +1 -0
- package/dist/{local-studio-BlxJWcDQ.js → local-studio-BjknISUv.js} +109 -118
- package/dist/local-studio-BjknISUv.js.map +1 -0
- package/package.json +5 -6
- package/dist/local-studio-BlxJWcDQ.js.map +0 -1
- package/dist/local-studio-DcBEEMJp.d.ts.map +0 -1
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,884 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $ as serviceStrategy, $t as RouteWithAuth, A as addListSpecificOptions, An as formatStateRemedy, At as TargetEntry, B as normalizeKvsFileKeys, Bt as ResolvedEcsTask, C as StudioEventBus, Cn as AgentCoreWsResult, Ct as FrontDoorForwardTarget, D as StudioTargetKind, Dn as invokeAgentCoreWs, Dt as DEFAULT_SHADOW_READY_TIMEOUT_MS, E as StudioServeEvent, En as bridgeAgentCoreWs, Et as resolveAlbFrontDoor, Ft as LocalInvokeBuildError, G as addAlbSpecificOptions, H as parseOriginOverrides, In as ResolvedArnLambdaLayer, J as parseLbPortOverrides, Jt as AuthorizerInfo, K as albStrategy, Kt as createWatchPredicates, L as LocalStartCloudFrontError, Ln as StackInfo, Lt as addRunTaskSpecificOptions, Mn as tryResolveImageFnJoin, On as ImageResolutionContext, Ot as SOFT_RELOAD_COMPLETION_LOG_SUFFIX, P as addStartAgentCoreSpecificOptions, Pn as addInvokeSpecificOptions, Pt as CdkLocalError, Qt as LambdaTokenAuthorizer, R as addStartCloudFrontSpecificOptions, S as createStudioDispatcher, Sn as AgentCoreWsBridgeHandle, St as runEcsServiceEmulator, T as StudioLogEvent, Tn as InvokeAgentCoreWsOptions, Tt as isApplicationLoadBalancer, U as resolveCloudFrontTarget, Ut as WatchPredicates, V as parseKvsFileOverrides, Vt as ApiTargetSubset, Wt as addStartApiSpecificOptions, Xt as JwtAuthorizer, Y as resolveAlbTarget, Yt as CognitoUserPoolAuthorizer, Z as addStartServiceSpecificOptions, Zt as LambdaRequestAuthorizer, _ as startStudioProxy, _n as CdkWatchConfig, _t as ecsClusterOption, a as coerceServeRequest, an as discoverWebSocketApisOrThrow, at as PlannedEcsForwardTarget, b as StudioRunRequest, bn as addInvokeAgentCoreSpecificOptions, bt as resolveEcsAssumeRoleOption, c as resolveServeBaseUrl, cn as webSocketApiMatchesIdentifier, ct as PlannedForwardTarget, d as StudioServeRequest, dn as discoverRoutes, dt as PlannedRedirectAction, en as attachAuthorizers, et as EcsServiceEmulatorOptions, f as StudioServeState, fn as IntegrationResponseEntry, fr as CloudFormationTemplate, ft as ServiceBoot, g as StudioProxyConfig, gn as tryParseStatus, gt as buildEcsImageResolutionContext, h as RunningStudioProxy, hn as selectIntegrationResponse, ht as addImageOverrideOptions, i as coerceRunRequest, in as discoverWebSocketApis, it as PlannedAction, jn as substituteImagePlaceholders, jt as TargetListing, kn as derivePseudoParametersFromRegion, kt as setShadowReadyTimeoutMs, l as StudioServeManager, ln as DiscoveredRoute, lt as PlannedFrontDoorListener, m as createStudioServeManager, mn as pickResponseTemplate, mt as addEcsAssumeRoleOptions, n as StudioServeRequestPayload, nn as WebSocketRouteEntry, nt as FrontDoorPlan, o as coerceStopRequest, on as filterWebSocketApisByIdentifiers, ot as PlannedFixedResponseAction, p as StudioStopRequest, pn as evaluateResponseParameters, pr as TemplateResource, pt as addCommonEcsServiceOptions, qt as resolveApiTargetSubset, r as addStudioSpecificOptions, rn as availableWebSocketApiIdentifiers, rt as MAX_TASKS_SUBNET_RANGE_CAP, sn as parseSelectionExpressionPath, st as PlannedForwardAction, tn as DiscoveredWebSocketApi, tt as EmulatorStrategy, u as StudioServeManagerConfig, un as RestV1IntegrationConfig, ut as PlannedLambdaForwardTarget, v as StudioDispatchConfig, vn as resolveWatchConfig, vt as parseMaxTasks, w as StudioInvocationEvent, wn as BridgeAgentCoreWsOptions, wt as ResolvedListenerAction, x as StudioRunResult, xt as resolveSharedSidecarCredentials, y as StudioDispatcher, yt as parseRestartPolicy, zt as EcsTaskResolutionError } from "./local-studio-BBA_8Xvk.js";
|
|
2
2
|
import { WebSocket } from "ws";
|
|
3
3
|
import { IncomingHttpHeaders, IncomingMessage, Server, ServerResponse } from "node:http";
|
|
4
|
+
import * as vm from "node:vm";
|
|
5
|
+
import "@aws-sdk/signature-v4a";
|
|
6
|
+
//#region src/local/file-watcher.d.ts
|
|
7
|
+
interface FileWatcher {
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
interface FileWatcherOptions {
|
|
11
|
+
paths: readonly string[];
|
|
12
|
+
onChange: (changedPaths: readonly string[]) => void;
|
|
13
|
+
debounceMs?: number;
|
|
14
|
+
ignoreInitial?: boolean;
|
|
15
|
+
ignored?: (path: string) => boolean;
|
|
16
|
+
shouldTrigger?: (path: string) => boolean;
|
|
17
|
+
}
|
|
18
|
+
declare function createFileWatcher(options: FileWatcherOptions): FileWatcher;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/local/source-change-classifier.d.ts
|
|
21
|
+
interface ReloadAssetContext {
|
|
22
|
+
oldAssetHash?: string;
|
|
23
|
+
newAssetHash: string;
|
|
24
|
+
newAssetSourceDir: string;
|
|
25
|
+
dockerFile: string;
|
|
26
|
+
}
|
|
27
|
+
type ReloadVerdict = {
|
|
28
|
+
kind: 'rebuild';
|
|
29
|
+
reason: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'soft-reload';
|
|
32
|
+
reason: string;
|
|
33
|
+
newAssetSourceDir: string;
|
|
34
|
+
};
|
|
35
|
+
declare function classifySourceChange(changedPaths: readonly string[], ctx: ReloadAssetContext | undefined): ReloadVerdict;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/local/agentcore-resolver.d.ts
|
|
38
|
+
declare const AGENTCORE_RUNTIME_TYPE = "AWS::BedrockAgentCore::Runtime";
|
|
39
|
+
declare const AGENTCORE_HTTP_PROTOCOL = "HTTP";
|
|
40
|
+
declare const AGENTCORE_MCP_PROTOCOL = "MCP";
|
|
41
|
+
declare const AGENTCORE_A2A_PROTOCOL = "A2A";
|
|
42
|
+
declare const AGENTCORE_AGUI_PROTOCOL = "AGUI";
|
|
43
|
+
interface ResolvedAgentCoreRuntime {
|
|
44
|
+
stack: StackInfo;
|
|
45
|
+
logicalId: string;
|
|
46
|
+
resource: TemplateResource;
|
|
47
|
+
containerUri?: string;
|
|
48
|
+
codeArtifact?: AgentCoreCodeArtifact;
|
|
49
|
+
environmentVariables: Record<string, unknown>;
|
|
50
|
+
roleArn?: string;
|
|
51
|
+
protocol: string;
|
|
52
|
+
jwtAuthorizer?: AgentCoreJwtAuthorizer;
|
|
53
|
+
}
|
|
54
|
+
interface AgentCoreJwtAuthorizer {
|
|
55
|
+
discoveryUrl: string;
|
|
56
|
+
allowedAudience?: string[];
|
|
57
|
+
allowedClients?: string[];
|
|
58
|
+
allowedScopes?: string[];
|
|
59
|
+
customClaims?: AgentCoreCustomClaim[];
|
|
60
|
+
}
|
|
61
|
+
interface AgentCoreCustomClaim {
|
|
62
|
+
name: string;
|
|
63
|
+
valueType: 'STRING' | 'STRING_ARRAY';
|
|
64
|
+
operator: 'EQUALS' | 'CONTAINS' | 'CONTAINS_ANY';
|
|
65
|
+
value: string | string[];
|
|
66
|
+
}
|
|
67
|
+
interface AgentCoreCodeArtifact {
|
|
68
|
+
runtime: string;
|
|
69
|
+
entryPoint: string[];
|
|
70
|
+
codeAssetHash: string;
|
|
71
|
+
s3Source?: {
|
|
72
|
+
bucket?: string;
|
|
73
|
+
bucketIntrinsic?: unknown;
|
|
74
|
+
key: string;
|
|
75
|
+
versionId?: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
declare class AgentCoreResolutionError extends Error {
|
|
79
|
+
constructor(message: string);
|
|
80
|
+
}
|
|
81
|
+
declare function resolveAgentCoreTarget(target: string, stacks: StackInfo[], imageContext?: ImageResolutionContext): ResolvedAgentCoreRuntime;
|
|
82
|
+
declare function pickAgentCoreCandidateStack(target: string, stacks: StackInfo[]): StackInfo | undefined;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/local/agentcore-sigv4-sign.d.ts
|
|
85
|
+
declare const AGENTCORE_SIGV4_SERVICE = "bedrock-agentcore";
|
|
86
|
+
interface SigV4Credentials {
|
|
87
|
+
accessKeyId: string;
|
|
88
|
+
secretAccessKey: string;
|
|
89
|
+
sessionToken?: string;
|
|
90
|
+
}
|
|
91
|
+
interface SignAgentCoreInvocationOptions {
|
|
92
|
+
credentials: SigV4Credentials;
|
|
93
|
+
region: string;
|
|
94
|
+
host: string;
|
|
95
|
+
port: number;
|
|
96
|
+
path: string;
|
|
97
|
+
body: string | Buffer;
|
|
98
|
+
sessionId: string;
|
|
99
|
+
method?: string;
|
|
100
|
+
now?: () => number;
|
|
101
|
+
}
|
|
102
|
+
interface SignedAgentCoreHeaders {
|
|
103
|
+
authorization: string;
|
|
104
|
+
amzDate: string;
|
|
105
|
+
amzContentSha256: string;
|
|
106
|
+
amzSecurityToken?: string;
|
|
107
|
+
}
|
|
108
|
+
declare function signAgentCoreInvocation(opts: SignAgentCoreInvocationOptions): Promise<SignedAgentCoreHeaders>;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/local/agentcore-client.d.ts
|
|
111
|
+
declare const AGENTCORE_SESSION_ID_HEADER = "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id";
|
|
112
|
+
interface AgentCoreInvokeResult {
|
|
113
|
+
status: number;
|
|
114
|
+
contentType: string | null;
|
|
115
|
+
raw: string;
|
|
116
|
+
streamed: boolean;
|
|
117
|
+
}
|
|
118
|
+
declare function waitForAgentCorePing(host: string, port: number, timeoutMs?: number): Promise<void>;
|
|
119
|
+
declare function waitForAgentCoreHttpReady(host: string, port: number, path: string, timeoutMs?: number): Promise<void>;
|
|
120
|
+
interface InvokeAgentCoreOptions {
|
|
121
|
+
sessionId: string;
|
|
122
|
+
timeoutMs: number;
|
|
123
|
+
authorization?: string;
|
|
124
|
+
additionalHeaders?: Record<string, string>;
|
|
125
|
+
onChunk?: (text: string) => void;
|
|
126
|
+
}
|
|
127
|
+
declare function invokeAgentCore(host: string, port: number, event: unknown, options: InvokeAgentCoreOptions): Promise<AgentCoreInvokeResult>;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/local/agentcore-mcp-client.d.ts
|
|
130
|
+
declare const MCP_CONTAINER_PORT = 8000;
|
|
131
|
+
declare const MCP_PATH = "/mcp";
|
|
132
|
+
declare const MCP_PROTOCOL_VERSION = "2025-06-18";
|
|
133
|
+
interface McpJsonRpcRequest {
|
|
134
|
+
method: string;
|
|
135
|
+
params?: unknown;
|
|
136
|
+
}
|
|
137
|
+
interface McpInvokeResult {
|
|
138
|
+
ok: boolean;
|
|
139
|
+
raw: string;
|
|
140
|
+
}
|
|
141
|
+
interface McpInvokeOptions {
|
|
142
|
+
readyTimeoutMs?: number;
|
|
143
|
+
requestTimeoutMs?: number;
|
|
144
|
+
fetchImpl?: typeof fetch;
|
|
145
|
+
}
|
|
146
|
+
declare function mcpInvokeOnce(host: string, port: number, request: McpJsonRpcRequest, options?: McpInvokeOptions): Promise<McpInvokeResult>;
|
|
147
|
+
declare function parseSseForJsonRpc(text: string, id: number): unknown;
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/local/agentcore-a2a-client.d.ts
|
|
150
|
+
declare const A2A_CONTAINER_PORT = 9000;
|
|
151
|
+
declare const A2A_PATH = "/";
|
|
152
|
+
interface A2aJsonRpcRequest {
|
|
153
|
+
method: string;
|
|
154
|
+
params?: unknown;
|
|
155
|
+
}
|
|
156
|
+
interface A2aInvokeResult {
|
|
157
|
+
ok: boolean;
|
|
158
|
+
raw: string;
|
|
159
|
+
}
|
|
160
|
+
interface A2aInvokeOptions {
|
|
161
|
+
readyTimeoutMs?: number;
|
|
162
|
+
requestTimeoutMs?: number;
|
|
163
|
+
fetchImpl?: typeof fetch;
|
|
164
|
+
}
|
|
165
|
+
declare function a2aInvokeOnce(host: string, port: number, request: A2aJsonRpcRequest, options?: A2aInvokeOptions): Promise<A2aInvokeResult>;
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/local/env-resolver.d.ts
|
|
168
|
+
interface EnvResolutionResult {
|
|
169
|
+
resolved: Record<string, string>;
|
|
170
|
+
unresolved: string[];
|
|
171
|
+
}
|
|
172
|
+
interface EnvOverrideFile {
|
|
173
|
+
Parameters?: Record<string, string | null>;
|
|
174
|
+
[logicalIdOrDisplayPath: string]: Record<string, string | null> | undefined;
|
|
175
|
+
}
|
|
176
|
+
declare function resolveEnvVars(logicalId: string, displayPath: string | undefined, templateEnv: Record<string, unknown> | undefined, overrides?: EnvOverrideFile): EnvResolutionResult;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/types/assets.d.ts
|
|
179
|
+
interface DockerImageAssetSource {
|
|
180
|
+
directory?: string;
|
|
181
|
+
executable?: string[];
|
|
182
|
+
dockerFile?: string;
|
|
183
|
+
dockerBuildTarget?: string;
|
|
184
|
+
dockerBuildArgs?: Record<string, string>;
|
|
185
|
+
dockerBuildContexts?: Record<string, string>;
|
|
186
|
+
dockerBuildSsh?: string;
|
|
187
|
+
dockerBuildSecrets?: Record<string, string>;
|
|
188
|
+
networkMode?: string;
|
|
189
|
+
platform?: string;
|
|
190
|
+
dockerOutputs?: string[];
|
|
191
|
+
cacheFrom?: DockerCacheOption[];
|
|
192
|
+
cacheTo?: DockerCacheOption;
|
|
193
|
+
cacheDisabled?: boolean;
|
|
194
|
+
}
|
|
195
|
+
interface DockerCacheOption {
|
|
196
|
+
type: string;
|
|
197
|
+
params?: Record<string, string>;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/utils/profile-resolver.d.ts
|
|
201
|
+
declare function resolveProfileCredentials(profile: string): Promise<{
|
|
202
|
+
accessKeyId: string;
|
|
203
|
+
secretAccessKey: string;
|
|
204
|
+
sessionToken?: string;
|
|
205
|
+
region?: string;
|
|
206
|
+
}>;
|
|
207
|
+
declare function buildStsClientConfig(args: {
|
|
208
|
+
region?: string | undefined;
|
|
209
|
+
profile?: string | undefined;
|
|
210
|
+
}): {
|
|
211
|
+
region?: string;
|
|
212
|
+
profile?: string;
|
|
213
|
+
};
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/local/container-pool.d.ts
|
|
216
|
+
interface ContainerHandle {
|
|
217
|
+
logicalId: string;
|
|
218
|
+
containerId: string;
|
|
219
|
+
containerName: string;
|
|
220
|
+
hostPort: number;
|
|
221
|
+
containerHost: string;
|
|
222
|
+
stopLogStream: () => void;
|
|
223
|
+
}
|
|
224
|
+
interface ContainerPool {
|
|
225
|
+
acquire(logicalId: string): Promise<ContainerHandle>;
|
|
226
|
+
release(handle: ContainerHandle): void;
|
|
227
|
+
dispose(): Promise<void>;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/local/vtl-engine.d.ts
|
|
231
|
+
declare class VtlEvaluationError extends Error {
|
|
232
|
+
constructor(message: string);
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/local/cors-handler.d.ts
|
|
236
|
+
interface CorsConfig {
|
|
237
|
+
AllowOrigins: string[];
|
|
238
|
+
AllowMethods: string[];
|
|
239
|
+
AllowHeaders: string[];
|
|
240
|
+
ExposeHeaders: string[];
|
|
241
|
+
MaxAge?: number;
|
|
242
|
+
AllowCredentials?: boolean;
|
|
243
|
+
}
|
|
244
|
+
declare function buildCorsConfigByApiId(template: CloudFormationTemplate): Map<string, CorsConfig>;
|
|
245
|
+
declare function buildCorsConfigFromCloudFrontChain(template: CloudFormationTemplate): Map<string, CorsConfig>;
|
|
246
|
+
declare function isFunctionUrlOacFronted(template: CloudFormationTemplate, fnUrlLogicalId: string): boolean;
|
|
247
|
+
interface PreflightResponse {
|
|
248
|
+
statusCode: number;
|
|
249
|
+
headers: Record<string, string>;
|
|
250
|
+
}
|
|
251
|
+
declare function matchPreflight(req: {
|
|
252
|
+
method: string;
|
|
253
|
+
headers: Record<string, string[]>;
|
|
254
|
+
}, config: CorsConfig): PreflightResponse | null;
|
|
255
|
+
declare function applyCorsResponseHeaders(res: ServerResponse, apiLogicalId: string | undefined, corsConfigByApiId: Map<string, CorsConfig>, requestOrigin: string | undefined): void;
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/local/authorizer-cache.d.ts
|
|
258
|
+
interface CachedAuthorizerResult {
|
|
259
|
+
allow: boolean;
|
|
260
|
+
principalId?: string;
|
|
261
|
+
context?: Record<string, unknown>;
|
|
262
|
+
policy?: unknown;
|
|
263
|
+
}
|
|
264
|
+
interface AuthorizerCache {
|
|
265
|
+
get(authorizerLogicalId: string, identityHash: string): CachedAuthorizerResult | undefined;
|
|
266
|
+
set(authorizerLogicalId: string, identityHash: string, ttlSeconds: number, result: CachedAuthorizerResult): void;
|
|
267
|
+
clear(): void;
|
|
268
|
+
size(): number;
|
|
269
|
+
}
|
|
270
|
+
declare function createAuthorizerCache(opts?: {
|
|
271
|
+
now?: () => number;
|
|
272
|
+
}): AuthorizerCache;
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/local/cognito-jwt.d.ts
|
|
275
|
+
interface JwksKey {
|
|
276
|
+
kid: string;
|
|
277
|
+
n: string;
|
|
278
|
+
e: string;
|
|
279
|
+
alg?: string;
|
|
280
|
+
kty: string;
|
|
281
|
+
use?: string;
|
|
282
|
+
}
|
|
283
|
+
interface JwksCacheEntry {
|
|
284
|
+
byKid: Map<string, JwksKey>;
|
|
285
|
+
expiresAt: number;
|
|
286
|
+
passThrough: boolean;
|
|
287
|
+
}
|
|
288
|
+
interface JwksCache {
|
|
289
|
+
fetchAndCache(jwksUrl: string): Promise<JwksCacheEntry>;
|
|
290
|
+
peek(jwksUrl: string): JwksCacheEntry | undefined;
|
|
291
|
+
clear(): void;
|
|
292
|
+
}
|
|
293
|
+
type WarnedAt = Map<string, number>;
|
|
294
|
+
declare function createJwksCache(opts?: {
|
|
295
|
+
fetchImpl?: (url: string) => Promise<{
|
|
296
|
+
ok: boolean;
|
|
297
|
+
status: number;
|
|
298
|
+
text: () => Promise<string>;
|
|
299
|
+
}>;
|
|
300
|
+
now?: () => number;
|
|
301
|
+
ttlMs?: number;
|
|
302
|
+
failureTtlMs?: number;
|
|
303
|
+
}): JwksCache;
|
|
304
|
+
declare function buildCognitoJwksUrl(region: string, userPoolId: string): string;
|
|
305
|
+
declare function buildJwksUrlFromIssuer(issuer: string): string;
|
|
306
|
+
declare function verifyCognitoJwt(authorizer: CognitoUserPoolAuthorizer, authorizationHeader: string | undefined, jwksCache: JwksCache, opts?: {
|
|
307
|
+
now?: () => number;
|
|
308
|
+
warnedAt?: WarnedAt;
|
|
309
|
+
}): Promise<CachedAuthorizerResult & {
|
|
310
|
+
identityHash: string | undefined;
|
|
311
|
+
ttlSeconds: number;
|
|
312
|
+
}>;
|
|
313
|
+
declare function verifyJwtAuthorizer(authorizer: JwtAuthorizer, authorizationHeader: string | undefined, jwksCache: JwksCache, opts?: {
|
|
314
|
+
now?: () => number;
|
|
315
|
+
warnedAt?: WarnedAt;
|
|
316
|
+
}): Promise<CachedAuthorizerResult & {
|
|
317
|
+
identityHash: string | undefined;
|
|
318
|
+
ttlSeconds: number;
|
|
319
|
+
}>;
|
|
320
|
+
interface DiscoveryJwtAuthorizer {
|
|
321
|
+
discoveryUrl: string;
|
|
322
|
+
allowedAudience?: readonly string[];
|
|
323
|
+
allowedClients?: readonly string[];
|
|
324
|
+
allowedScopes?: readonly string[];
|
|
325
|
+
customClaims?: readonly JwtCustomClaim[];
|
|
326
|
+
}
|
|
327
|
+
interface JwtCustomClaim {
|
|
328
|
+
name: string;
|
|
329
|
+
valueType: 'STRING' | 'STRING_ARRAY';
|
|
330
|
+
operator: 'EQUALS' | 'CONTAINS' | 'CONTAINS_ANY';
|
|
331
|
+
value: string | string[];
|
|
332
|
+
}
|
|
333
|
+
declare function verifyJwtViaDiscovery(authorizer: DiscoveryJwtAuthorizer, authorizationHeader: string | undefined, jwksCache: JwksCache, opts?: {
|
|
334
|
+
now?: () => number;
|
|
335
|
+
warnedAt?: WarnedAt;
|
|
336
|
+
fetchImpl?: (url: string) => Promise<{
|
|
337
|
+
ok: boolean;
|
|
338
|
+
status: number;
|
|
339
|
+
text: () => Promise<string>;
|
|
340
|
+
}>;
|
|
341
|
+
}): Promise<CachedAuthorizerResult & {
|
|
342
|
+
identityHash: string | undefined;
|
|
343
|
+
ttlSeconds: number;
|
|
344
|
+
}>;
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/local/sigv4-verify.d.ts
|
|
347
|
+
interface ResolvedCredentials {
|
|
348
|
+
accessKeyId: string;
|
|
349
|
+
secretAccessKey: string;
|
|
350
|
+
sessionToken?: string | undefined;
|
|
351
|
+
}
|
|
352
|
+
type CredentialsLoader = () => Promise<ResolvedCredentials>;
|
|
353
|
+
declare function defaultCredentialsLoader(): CredentialsLoader;
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/local/http-server.d.ts
|
|
356
|
+
interface ServerState {
|
|
357
|
+
routes: readonly RouteWithAuth[];
|
|
358
|
+
pool: ContainerPool;
|
|
359
|
+
corsConfigByApiId: Map<string, CorsConfig>;
|
|
360
|
+
}
|
|
361
|
+
interface StartApiServerOptions {
|
|
362
|
+
state: ServerState;
|
|
363
|
+
rieTimeoutMs: number;
|
|
364
|
+
host: string;
|
|
365
|
+
port: number;
|
|
366
|
+
authorizerCache?: AuthorizerCache;
|
|
367
|
+
jwksCache?: JwksCache;
|
|
368
|
+
jwksWarnedAt?: WarnedAt;
|
|
369
|
+
mtls?: MtlsServerConfig;
|
|
370
|
+
sigV4CredentialsLoader?: CredentialsLoader;
|
|
371
|
+
sigV4WarnedForeignIds?: Set<string>;
|
|
372
|
+
sigV4Strict?: boolean;
|
|
373
|
+
defaultRegion?: string;
|
|
374
|
+
preDispatch?: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
|
|
375
|
+
}
|
|
376
|
+
interface MtlsServerConfig {
|
|
377
|
+
caPem: Buffer;
|
|
378
|
+
certPem: Buffer;
|
|
379
|
+
keyPem: Buffer;
|
|
380
|
+
}
|
|
381
|
+
interface StartedApiServer {
|
|
382
|
+
port: number;
|
|
383
|
+
host: string;
|
|
384
|
+
scheme: 'http' | 'https';
|
|
385
|
+
server: Server;
|
|
386
|
+
close: () => Promise<void>;
|
|
387
|
+
setServerState: (next: ServerState) => ServerState;
|
|
388
|
+
getServerState: () => ServerState;
|
|
389
|
+
}
|
|
390
|
+
declare function startApiServer(opts: StartApiServerOptions): Promise<StartedApiServer>;
|
|
391
|
+
declare function readMtlsMaterialsFromDisk(opts: {
|
|
392
|
+
truststorePath: string;
|
|
393
|
+
certPath: string;
|
|
394
|
+
keyPath: string;
|
|
395
|
+
}): MtlsServerConfig;
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/local/ecs-service-resolver.d.ts
|
|
398
|
+
interface ResolvedServiceConnect {
|
|
399
|
+
namespaceName: string;
|
|
400
|
+
services: ReadonlyArray<{
|
|
401
|
+
portName: string;
|
|
402
|
+
containerPort: number;
|
|
403
|
+
discoveryName: string;
|
|
404
|
+
clientAliases: ReadonlyArray<{
|
|
405
|
+
dnsName?: string;
|
|
406
|
+
port: number;
|
|
407
|
+
}>;
|
|
408
|
+
}>;
|
|
409
|
+
}
|
|
410
|
+
interface ResolvedServiceRegistry {
|
|
411
|
+
cloudMapServiceLogicalId: string;
|
|
412
|
+
containerName?: string;
|
|
413
|
+
containerPort?: number;
|
|
414
|
+
}
|
|
415
|
+
interface ResolvedEcsService {
|
|
416
|
+
stack: StackInfo;
|
|
417
|
+
serviceLogicalId: string;
|
|
418
|
+
resource: TemplateResource;
|
|
419
|
+
serviceName: string;
|
|
420
|
+
serviceDisplayName: string;
|
|
421
|
+
desiredCount: number;
|
|
422
|
+
healthCheckGracePeriodSeconds: number;
|
|
423
|
+
task: ResolvedEcsTask;
|
|
424
|
+
serviceConnect?: ResolvedServiceConnect;
|
|
425
|
+
serviceRegistries: ReadonlyArray<ResolvedServiceRegistry>;
|
|
426
|
+
warnings: string[];
|
|
427
|
+
}
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/local/cloud-map-registry.d.ts
|
|
430
|
+
interface RegisteredEndpoint {
|
|
431
|
+
ip: string;
|
|
432
|
+
port: number;
|
|
433
|
+
ownerKey: string;
|
|
434
|
+
}
|
|
435
|
+
interface RegistrationHandle {
|
|
436
|
+
readonly fqdn: string;
|
|
437
|
+
readonly ownerKey: string;
|
|
438
|
+
}
|
|
439
|
+
interface RegistryListing {
|
|
440
|
+
namespace: string;
|
|
441
|
+
discoveryName: string;
|
|
442
|
+
endpoints: ReadonlyArray<RegisteredEndpoint>;
|
|
443
|
+
isAlias: boolean;
|
|
444
|
+
}
|
|
445
|
+
declare class CloudMapRegistry {
|
|
446
|
+
private readonly byFqdn;
|
|
447
|
+
private readonly aliasIndex;
|
|
448
|
+
register(namespace: string, discoveryName: string, endpoint: RegisteredEndpoint): RegistrationHandle;
|
|
449
|
+
registerAlias(alias: string, targetFqdn: string): void;
|
|
450
|
+
unregister(handle: RegistrationHandle): boolean;
|
|
451
|
+
unregisterByOwner(ownerKeyPrefix: string): number;
|
|
452
|
+
lookup(namespace: string, discoveryName: string): ReadonlyArray<RegisteredEndpoint> | undefined;
|
|
453
|
+
lookupAlias(alias: string): ReadonlyArray<RegisteredEndpoint> | undefined;
|
|
454
|
+
buildAddHostFlags(excludeOwnerKeyPrefix?: string): string[];
|
|
455
|
+
list(): ReadonlyArray<RegistryListing>;
|
|
456
|
+
isEmpty(): boolean;
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/local/cloud-map-resolver.d.ts
|
|
460
|
+
interface ResolvedCloudMapNamespace {
|
|
461
|
+
logicalId: string;
|
|
462
|
+
name: string;
|
|
463
|
+
}
|
|
464
|
+
interface ResolvedCloudMapService {
|
|
465
|
+
logicalId: string;
|
|
466
|
+
namespaceLogicalId: string;
|
|
467
|
+
namespaceName: string;
|
|
468
|
+
name: string;
|
|
469
|
+
dnsRecords: ReadonlyArray<{
|
|
470
|
+
type: 'A' | 'SRV';
|
|
471
|
+
ttlSeconds: number;
|
|
472
|
+
}>;
|
|
473
|
+
}
|
|
474
|
+
interface CloudMapIndex {
|
|
475
|
+
namespacesByLogicalId: Map<string, ResolvedCloudMapNamespace>;
|
|
476
|
+
namespacesByName: Map<string, ResolvedCloudMapNamespace>;
|
|
477
|
+
servicesByLogicalId: Map<string, ResolvedCloudMapService>;
|
|
478
|
+
warnings: string[];
|
|
479
|
+
}
|
|
480
|
+
declare function buildCloudMapIndex(stack: StackInfo): CloudMapIndex;
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/local/cloudfront-kvs.d.ts
|
|
483
|
+
interface KvsDataSource {
|
|
484
|
+
readonly label: string;
|
|
485
|
+
readonly kvsId?: string;
|
|
486
|
+
getValue(key: string): Promise<string | undefined>;
|
|
487
|
+
}
|
|
488
|
+
interface CloudFrontKvsHandle {
|
|
489
|
+
get(key: string, options?: {
|
|
490
|
+
format?: 'string' | 'json';
|
|
491
|
+
}): Promise<unknown>;
|
|
492
|
+
exists(key: string): Promise<boolean>;
|
|
493
|
+
meta(): Promise<never>;
|
|
494
|
+
count(): Promise<never>;
|
|
495
|
+
}
|
|
496
|
+
interface CloudFrontModule {
|
|
497
|
+
kvs(kvsId?: string): CloudFrontKvsHandle;
|
|
498
|
+
}
|
|
499
|
+
declare function createCloudFrontModule(sources: readonly KvsDataSource[]): CloudFrontModule;
|
|
500
|
+
declare function createUnboundCloudFrontModule(functionLogicalId: string): CloudFrontModule;
|
|
501
|
+
declare function createLocalFileKvsDataSource(args: {
|
|
502
|
+
id: string;
|
|
503
|
+
filePath: string;
|
|
504
|
+
}): KvsDataSource;
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/local/cloudfront-function-runtime.d.ts
|
|
507
|
+
interface CfValue {
|
|
508
|
+
value: string;
|
|
509
|
+
multiValue?: Array<{
|
|
510
|
+
value: string;
|
|
511
|
+
}>;
|
|
512
|
+
}
|
|
513
|
+
interface CfRequest {
|
|
514
|
+
method: string;
|
|
515
|
+
uri: string;
|
|
516
|
+
querystring: Record<string, CfValue>;
|
|
517
|
+
headers: Record<string, CfValue>;
|
|
518
|
+
cookies: Record<string, CfValue>;
|
|
519
|
+
}
|
|
520
|
+
interface CfResponse {
|
|
521
|
+
statusCode: number;
|
|
522
|
+
statusDescription?: string;
|
|
523
|
+
headers: Record<string, CfValue>;
|
|
524
|
+
cookies?: Record<string, CfValue>;
|
|
525
|
+
body?: string | {
|
|
526
|
+
encoding?: 'text' | 'base64';
|
|
527
|
+
data?: string;
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
interface CfViewerRequestEvent {
|
|
531
|
+
version: '1.0';
|
|
532
|
+
context: {
|
|
533
|
+
distributionDomainName: string;
|
|
534
|
+
distributionId: string;
|
|
535
|
+
eventType: string;
|
|
536
|
+
requestId: string;
|
|
537
|
+
};
|
|
538
|
+
viewer: {
|
|
539
|
+
ip: string;
|
|
540
|
+
};
|
|
541
|
+
request: CfRequest;
|
|
542
|
+
}
|
|
543
|
+
interface CfViewerResponseEvent extends CfViewerRequestEvent {
|
|
544
|
+
response: CfResponse;
|
|
545
|
+
}
|
|
546
|
+
interface CloudFrontKvsAssociation {
|
|
547
|
+
arnValue: unknown;
|
|
548
|
+
kvsLogicalId?: string;
|
|
549
|
+
}
|
|
550
|
+
interface CompiledCloudFrontFunction {
|
|
551
|
+
logicalId: string;
|
|
552
|
+
runtime: string;
|
|
553
|
+
script: vm.Script;
|
|
554
|
+
cloudfrontBindingName?: string;
|
|
555
|
+
kvsAssociations?: CloudFrontKvsAssociation[];
|
|
556
|
+
cloudfrontModule?: CloudFrontModule;
|
|
557
|
+
}
|
|
558
|
+
declare function stripCloudFrontImport(code: string): {
|
|
559
|
+
code: string;
|
|
560
|
+
bindingName?: string;
|
|
561
|
+
};
|
|
562
|
+
declare function compileCloudFrontFunction(logicalId: string, code: string, runtime: string): CompiledCloudFrontFunction;
|
|
563
|
+
type ViewerRequestOutcome = {
|
|
564
|
+
kind: 'continue';
|
|
565
|
+
request: CfRequest;
|
|
566
|
+
} | {
|
|
567
|
+
kind: 'response';
|
|
568
|
+
response: CfResponse;
|
|
569
|
+
};
|
|
570
|
+
declare function runViewerRequest(fn: CompiledCloudFrontFunction, event: CfViewerRequestEvent): Promise<ViewerRequestOutcome>;
|
|
571
|
+
declare function runViewerResponse(fn: CompiledCloudFrontFunction, event: CfViewerResponseEvent): Promise<CfResponse>;
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region src/local/cloudfront-static-origin.d.ts
|
|
574
|
+
interface ResolvedCustomErrorResponse {
|
|
575
|
+
errorCode: number;
|
|
576
|
+
responsePagePath?: string;
|
|
577
|
+
responseCode?: number;
|
|
578
|
+
}
|
|
579
|
+
interface StaticOriginResult {
|
|
580
|
+
statusCode: number;
|
|
581
|
+
headers: Record<string, string>;
|
|
582
|
+
body: Buffer;
|
|
583
|
+
}
|
|
584
|
+
declare function serveFromStaticOrigin(input: {
|
|
585
|
+
localDirs: readonly string[];
|
|
586
|
+
uri: string;
|
|
587
|
+
defaultRootObject?: string;
|
|
588
|
+
customErrorResponses?: readonly ResolvedCustomErrorResponse[];
|
|
589
|
+
}): StaticOriginResult;
|
|
590
|
+
interface ErrorResponseCandidate {
|
|
591
|
+
errorKey: string;
|
|
592
|
+
responseCode: number;
|
|
593
|
+
}
|
|
594
|
+
declare function resolveErrorResponseCandidates(customErrorResponses?: readonly ResolvedCustomErrorResponse[]): ErrorResponseCandidate[];
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region src/local/cloudfront-resolver.d.ts
|
|
597
|
+
interface ResolvedCloudFrontFunction extends CompiledCloudFrontFunction {}
|
|
598
|
+
interface ResolvedLambdaEdgeAssoc {
|
|
599
|
+
functionLogicalId: string;
|
|
600
|
+
includeBody: boolean;
|
|
601
|
+
}
|
|
602
|
+
interface ResolvedLambdaEdge {
|
|
603
|
+
viewerRequest?: ResolvedLambdaEdgeAssoc;
|
|
604
|
+
originRequest?: ResolvedLambdaEdgeAssoc;
|
|
605
|
+
originResponse?: ResolvedLambdaEdgeAssoc;
|
|
606
|
+
viewerResponse?: ResolvedLambdaEdgeAssoc;
|
|
607
|
+
}
|
|
608
|
+
interface ResolvedBehavior {
|
|
609
|
+
pathPattern?: string;
|
|
610
|
+
targetOriginId: string;
|
|
611
|
+
viewerProtocolPolicy?: string;
|
|
612
|
+
viewerRequest?: ResolvedCloudFrontFunction;
|
|
613
|
+
viewerResponse?: ResolvedCloudFrontFunction;
|
|
614
|
+
lambdaEdge?: ResolvedLambdaEdge;
|
|
615
|
+
cors?: CorsConfig;
|
|
616
|
+
}
|
|
617
|
+
type ResolvedOrigin = {
|
|
618
|
+
kind: 's3';
|
|
619
|
+
originId: string;
|
|
620
|
+
localDirs: string[];
|
|
621
|
+
} | {
|
|
622
|
+
kind: 's3-unresolved';
|
|
623
|
+
originId: string;
|
|
624
|
+
bucketLogicalId?: string;
|
|
625
|
+
bucketName?: string;
|
|
626
|
+
deployedConfigOnly?: boolean;
|
|
627
|
+
} | {
|
|
628
|
+
kind: 's3-deployed';
|
|
629
|
+
originId: string;
|
|
630
|
+
bucketName: string;
|
|
631
|
+
} | {
|
|
632
|
+
kind: 'lambda-url';
|
|
633
|
+
originId: string;
|
|
634
|
+
functionLogicalId: string;
|
|
635
|
+
functionUrlLogicalId: string;
|
|
636
|
+
} | {
|
|
637
|
+
kind: 'custom';
|
|
638
|
+
originId: string;
|
|
639
|
+
domainName: string;
|
|
640
|
+
};
|
|
641
|
+
interface ResolvedDistribution {
|
|
642
|
+
logicalId: string;
|
|
643
|
+
stackName: string;
|
|
644
|
+
defaultRootObject?: string;
|
|
645
|
+
behaviors: ResolvedBehavior[];
|
|
646
|
+
origins: Map<string, ResolvedOrigin>;
|
|
647
|
+
customErrorResponses: ResolvedCustomErrorResponse[];
|
|
648
|
+
}
|
|
649
|
+
declare const CLOUDFRONT_DISTRIBUTION_TYPE = "AWS::CloudFront::Distribution";
|
|
650
|
+
declare function resolveCloudFrontDistribution(args: {
|
|
651
|
+
stack: StackInfo;
|
|
652
|
+
logicalId: string;
|
|
653
|
+
originOverrides?: Map<string, string>;
|
|
654
|
+
}): ResolvedDistribution;
|
|
655
|
+
declare function extractKvsAssociations(functionConfig: Record<string, unknown>): CloudFrontKvsAssociation[];
|
|
656
|
+
declare function pickKvsLogicalIdFromArn(value: unknown): string | undefined;
|
|
657
|
+
declare function pickLambdaEdgeFunctionLogicalId(value: unknown, template: CloudFormationTemplate): string | undefined;
|
|
658
|
+
declare function describeS3OriginDomain(value: unknown): {
|
|
659
|
+
isS3: boolean;
|
|
660
|
+
bucketName?: string;
|
|
661
|
+
};
|
|
662
|
+
declare function pickFunctionUrlLogicalIdFromOrigin(value: unknown): string | undefined;
|
|
663
|
+
declare function pickTargetFunctionLogicalId(value: unknown): string | undefined;
|
|
664
|
+
declare function isCloudFrontDistribution(resource: TemplateResource): boolean;
|
|
665
|
+
//#endregion
|
|
666
|
+
//#region src/local/cloudfront-s3-origin.d.ts
|
|
667
|
+
interface S3OriginCredentials {
|
|
668
|
+
accessKeyId: string;
|
|
669
|
+
secretAccessKey: string;
|
|
670
|
+
sessionToken?: string;
|
|
671
|
+
}
|
|
672
|
+
type S3FetchResult = {
|
|
673
|
+
kind: 'found';
|
|
674
|
+
body: Buffer;
|
|
675
|
+
} | {
|
|
676
|
+
kind: 'not-found';
|
|
677
|
+
} | {
|
|
678
|
+
kind: 'denied';
|
|
679
|
+
} | {
|
|
680
|
+
kind: 'error';
|
|
681
|
+
message: string;
|
|
682
|
+
};
|
|
683
|
+
type S3ObjectFetcher = (key: string) => Promise<S3FetchResult>;
|
|
684
|
+
interface S3OriginReaderOptions {
|
|
685
|
+
region?: string;
|
|
686
|
+
credentials?: S3OriginCredentials;
|
|
687
|
+
cache?: boolean;
|
|
688
|
+
fetchObject?: S3ObjectFetcher;
|
|
689
|
+
}
|
|
690
|
+
interface S3OriginReader {
|
|
691
|
+
(input: {
|
|
692
|
+
uri: string;
|
|
693
|
+
defaultRootObject?: string;
|
|
694
|
+
customErrorResponses?: readonly ResolvedCustomErrorResponse[];
|
|
695
|
+
}): Promise<StaticOriginResult>;
|
|
696
|
+
close(): Promise<void>;
|
|
697
|
+
clearCache(): void;
|
|
698
|
+
}
|
|
699
|
+
declare function createS3OriginReader(bucketName: string, options?: S3OriginReaderOptions): S3OriginReader;
|
|
700
|
+
declare function classifyS3Error(err: unknown): S3FetchResult;
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region src/local/front-door-tls.d.ts
|
|
703
|
+
interface FrontDoorTlsMaterials {
|
|
704
|
+
certPem: Buffer;
|
|
705
|
+
keyPem: Buffer;
|
|
706
|
+
}
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/local/cloudfront-server.d.ts
|
|
709
|
+
type LambdaUrlInvokerMap = Map<string, (event: Record<string, unknown>) => Promise<unknown>>;
|
|
710
|
+
interface StartedCloudFrontServer {
|
|
711
|
+
url: string;
|
|
712
|
+
port: number;
|
|
713
|
+
scheme: 'http' | 'https';
|
|
714
|
+
update(distribution: ResolvedDistribution): void;
|
|
715
|
+
close(): Promise<void>;
|
|
716
|
+
}
|
|
717
|
+
interface StartCloudFrontServerOptions {
|
|
718
|
+
distribution: ResolvedDistribution;
|
|
719
|
+
host: string;
|
|
720
|
+
port: number;
|
|
721
|
+
tls?: FrontDoorTlsMaterials;
|
|
722
|
+
lambdaInvokers?: LambdaUrlInvokerMap;
|
|
723
|
+
edgeInvokers?: LambdaUrlInvokerMap;
|
|
724
|
+
s3OriginReaders?: Map<string, S3OriginReader>;
|
|
725
|
+
}
|
|
726
|
+
declare function startCloudFrontServer(options: StartCloudFrontServerOptions): Promise<StartedCloudFrontServer>;
|
|
727
|
+
declare function matchBehavior(behaviors: readonly ResolvedBehavior[], uri: string): ResolvedBehavior | undefined;
|
|
728
|
+
//#endregion
|
|
729
|
+
//#region src/local/agentcore-serve-auth.d.ts
|
|
730
|
+
interface AgentCoreServeAuthResult {
|
|
731
|
+
allow: boolean;
|
|
732
|
+
status?: number;
|
|
733
|
+
message?: string;
|
|
734
|
+
authorization?: string;
|
|
735
|
+
}
|
|
736
|
+
type AgentCoreServeAuthCheck = (headers: IncomingHttpHeaders) => Promise<AgentCoreServeAuthResult>;
|
|
737
|
+
interface BuildAgentCoreServeAuthCheckOptions {
|
|
738
|
+
noVerifyAuth?: boolean;
|
|
739
|
+
bearerToken?: string;
|
|
740
|
+
jwksCache?: JwksCache;
|
|
741
|
+
warnedAt?: WarnedAt;
|
|
742
|
+
}
|
|
743
|
+
declare function buildAgentCoreServeAuthCheck(authorizer: AgentCoreJwtAuthorizer, opts?: BuildAgentCoreServeAuthCheckOptions): AgentCoreServeAuthCheck;
|
|
744
|
+
interface ServeInboundAuthPlan {
|
|
745
|
+
authCheck?: AgentCoreServeAuthCheck;
|
|
746
|
+
bridgeAuthorization?: string;
|
|
747
|
+
sign: boolean;
|
|
748
|
+
}
|
|
749
|
+
declare function selectServeInboundAuth(resolved: Pick<ResolvedAgentCoreRuntime, 'jwtAuthorizer'>, options: {
|
|
750
|
+
bearerToken?: string;
|
|
751
|
+
verifyAuth?: boolean;
|
|
752
|
+
}, sigv4Active: boolean, buildAuthCheck?: typeof buildAgentCoreServeAuthCheck): ServeInboundAuthPlan;
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/local/agentcore-http-server.d.ts
|
|
755
|
+
interface AgentCoreServeRoute {
|
|
756
|
+
method: string;
|
|
757
|
+
path: string;
|
|
758
|
+
}
|
|
759
|
+
type AgentCoreServeSignRequest = (opts: {
|
|
760
|
+
method: string;
|
|
761
|
+
path: string;
|
|
762
|
+
body: Buffer;
|
|
763
|
+
sessionId: string;
|
|
764
|
+
}) => Promise<Record<string, string>>;
|
|
765
|
+
interface AgentCoreHttpServerConfig {
|
|
766
|
+
containerHost: string;
|
|
767
|
+
containerPort: number;
|
|
768
|
+
host?: string;
|
|
769
|
+
port?: number;
|
|
770
|
+
sessionId?: string;
|
|
771
|
+
authorization?: string;
|
|
772
|
+
routes?: AgentCoreServeRoute[];
|
|
773
|
+
attachWs?: boolean;
|
|
774
|
+
authCheck?: AgentCoreServeAuthCheck;
|
|
775
|
+
signRequest?: AgentCoreServeSignRequest;
|
|
776
|
+
}
|
|
777
|
+
interface RunningAgentCoreHttpServer {
|
|
778
|
+
httpUrl: string;
|
|
779
|
+
wsUrl?: string;
|
|
780
|
+
port: number;
|
|
781
|
+
setContainerPort(port: number): void;
|
|
782
|
+
close(): Promise<void>;
|
|
783
|
+
}
|
|
784
|
+
declare function startAgentCoreHttpServer(config: AgentCoreHttpServerConfig): Promise<RunningAgentCoreHttpServer>;
|
|
785
|
+
//#endregion
|
|
786
|
+
//#region src/local/studio-store.d.ts
|
|
787
|
+
interface StudioStoreOptions {
|
|
788
|
+
maxInvocations?: number;
|
|
789
|
+
maxLogs?: number;
|
|
790
|
+
bindGraceMs?: number;
|
|
791
|
+
}
|
|
792
|
+
interface StudioHistory {
|
|
793
|
+
invocations: StudioInvocationEvent[];
|
|
794
|
+
logs: StudioLogEvent[];
|
|
795
|
+
}
|
|
796
|
+
interface StudioLogSearchOptions {
|
|
797
|
+
target?: string;
|
|
798
|
+
limit?: number;
|
|
799
|
+
}
|
|
800
|
+
interface StudioStore {
|
|
801
|
+
history: () => StudioHistory;
|
|
802
|
+
searchLogs: (query: string, opts?: StudioLogSearchOptions) => StudioLogEvent[];
|
|
803
|
+
logsForInvocation: (id: string) => StudioLogEvent[];
|
|
804
|
+
invocation: (id: string) => StudioInvocationEvent | undefined;
|
|
805
|
+
dispose: () => void;
|
|
806
|
+
}
|
|
807
|
+
declare function createStudioStore(bus: StudioEventBus, options?: StudioStoreOptions): StudioStore;
|
|
808
|
+
//#endregion
|
|
809
|
+
//#region src/local/studio-server.d.ts
|
|
810
|
+
interface StudioTarget {
|
|
811
|
+
id: string;
|
|
812
|
+
qualifiedId: string;
|
|
813
|
+
surface?: string;
|
|
814
|
+
servable?: boolean;
|
|
815
|
+
pinned?: boolean;
|
|
816
|
+
pinUnresolved?: boolean;
|
|
817
|
+
backingPinnedServices?: {
|
|
818
|
+
id: string;
|
|
819
|
+
label: string;
|
|
820
|
+
}[];
|
|
821
|
+
agentCoreHasWs?: boolean;
|
|
822
|
+
agentCoreContractPath?: string;
|
|
823
|
+
}
|
|
824
|
+
interface StudioTargetGroup {
|
|
825
|
+
kind: 'lambda' | 'api' | 'alb' | 'ecs' | 'ecs-task' | 'cloudfront' | 'agentcore' | 'agentcore-ws';
|
|
826
|
+
title: string;
|
|
827
|
+
entries: StudioTarget[];
|
|
828
|
+
}
|
|
829
|
+
declare function toStudioTargetGroups(listing: TargetListing): StudioTargetGroup[];
|
|
830
|
+
declare function annotatePinnedEcsTargets(groups: StudioTargetGroup[], classify: (targetId: string) => boolean): boolean;
|
|
831
|
+
declare function annotateEcsTaskPinnedTargets(groups: StudioTargetGroup[], classify: (targetId: string) => boolean): boolean;
|
|
832
|
+
declare function annotateAlbPinnedBackingServices(groups: StudioTargetGroup[], resolveBackingPinned: (albEntry: StudioTarget) => {
|
|
833
|
+
id: string;
|
|
834
|
+
label: string;
|
|
835
|
+
}[]): boolean;
|
|
836
|
+
declare function filterStudioTargetGroups(groups: StudioTargetGroup[], globs: string[] | undefined): StudioTargetGroup[];
|
|
837
|
+
interface StudioServerOptions {
|
|
838
|
+
port: number;
|
|
839
|
+
host?: string;
|
|
840
|
+
bus: StudioEventBus;
|
|
841
|
+
targetGroups: StudioTargetGroup[];
|
|
842
|
+
dockerfiles?: string[];
|
|
843
|
+
appLabel: string;
|
|
844
|
+
cliName: string;
|
|
845
|
+
maxPortBump?: number;
|
|
846
|
+
onRun?: (body: unknown) => Promise<unknown>;
|
|
847
|
+
onStop?: (body: unknown) => Promise<unknown>;
|
|
848
|
+
onServeRequest?: (body: unknown) => Promise<unknown>;
|
|
849
|
+
onReinvoke?: (body: unknown) => Promise<unknown>;
|
|
850
|
+
getRunning?: () => unknown;
|
|
851
|
+
store?: StudioStore;
|
|
852
|
+
getConfig?: () => unknown;
|
|
853
|
+
patchConfig?: (body: unknown) => Promise<unknown>;
|
|
854
|
+
}
|
|
855
|
+
interface RunningStudioServer {
|
|
856
|
+
url: string;
|
|
857
|
+
port: number;
|
|
858
|
+
close: () => Promise<void>;
|
|
859
|
+
setTargets: (groups: StudioTargetGroup[], dockerfiles?: string[]) => void;
|
|
860
|
+
}
|
|
861
|
+
declare function startStudioServer(options: StudioServerOptions): Promise<RunningStudioServer>;
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region src/local/studio-request-relay.d.ts
|
|
864
|
+
interface ServeRequestInput {
|
|
865
|
+
baseUrl: string;
|
|
866
|
+
method: string;
|
|
867
|
+
path?: string;
|
|
868
|
+
headers?: Record<string, string>;
|
|
869
|
+
body?: string;
|
|
870
|
+
timeoutMs?: number;
|
|
871
|
+
maxBodyChars?: number;
|
|
872
|
+
}
|
|
873
|
+
interface ServeRequestResult {
|
|
874
|
+
status: number;
|
|
875
|
+
headers: Record<string, string>;
|
|
876
|
+
body: string;
|
|
877
|
+
truncated: boolean;
|
|
878
|
+
durationMs: number;
|
|
879
|
+
}
|
|
880
|
+
declare function relayServeRequest(input: ServeRequestInput, fetchFn?: typeof fetch, clock?: () => number): Promise<ServeRequestResult>;
|
|
881
|
+
//#endregion
|
|
4
882
|
//#region src/local/intrinsic-utils.d.ts
|
|
5
883
|
declare function pickRefLogicalId(value: unknown): string | null;
|
|
6
884
|
//#endregion
|