@aws/agentcore 0.3.0-preview.1.0
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 +175 -0
- package/README.md +147 -0
- package/dist/assets/README.md +79 -0
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +2862 -0
- package/dist/assets/__tests__/assets.snapshot.test.ts +139 -0
- package/dist/assets/agents/AGENTS.md +102 -0
- package/dist/assets/cdk/.prettierrc +8 -0
- package/dist/assets/cdk/README.md +14 -0
- package/dist/assets/cdk/bin/cdk.ts +50 -0
- package/dist/assets/cdk/cdk.json +88 -0
- package/dist/assets/cdk/gitignore.template +9 -0
- package/dist/assets/cdk/jest.config.js +9 -0
- package/dist/assets/cdk/lib/cdk-stack.ts +38 -0
- package/dist/assets/cdk/npmignore.template +6 -0
- package/dist/assets/cdk/package.json +30 -0
- package/dist/assets/cdk/test/cdk.test.ts +16 -0
- package/dist/assets/cdk/tsconfig.json +28 -0
- package/dist/assets/mcp/python/README.md +27 -0
- package/dist/assets/mcp/python/pyproject.toml +22 -0
- package/dist/assets/mcp/python/server.py +117 -0
- package/dist/assets/mcp/python-lambda/README.md +22 -0
- package/dist/assets/mcp/python-lambda/handler.py +144 -0
- package/dist/assets/mcp/python-lambda/pyproject.toml +15 -0
- package/dist/assets/python/autogen/base/README.md +41 -0
- package/dist/assets/python/autogen/base/gitignore.template +40 -0
- package/dist/assets/python/autogen/base/main.py +52 -0
- package/dist/assets/python/autogen/base/mcp_client/client.py +18 -0
- package/dist/assets/python/autogen/base/model/load.py +136 -0
- package/dist/assets/python/autogen/base/pyproject.toml +35 -0
- package/dist/assets/python/crewai/base/README.md +41 -0
- package/dist/assets/python/crewai/base/gitignore.template +40 -0
- package/dist/assets/python/crewai/base/main.py +55 -0
- package/dist/assets/python/crewai/base/model/load.py +133 -0
- package/dist/assets/python/crewai/base/pyproject.toml +32 -0
- package/dist/assets/python/googleadk/base/README.md +39 -0
- package/dist/assets/python/googleadk/base/gitignore.template +40 -0
- package/dist/assets/python/googleadk/base/main.py +84 -0
- package/dist/assets/python/googleadk/base/mcp_client/client.py +15 -0
- package/dist/assets/python/googleadk/base/model/load.py +41 -0
- package/dist/assets/python/googleadk/base/pyproject.toml +21 -0
- package/dist/assets/python/langchain_langgraph/base/README.md +41 -0
- package/dist/assets/python/langchain_langgraph/base/gitignore.template +40 -0
- package/dist/assets/python/langchain_langgraph/base/main.py +51 -0
- package/dist/assets/python/langchain_langgraph/base/mcp_client/client.py +19 -0
- package/dist/assets/python/langchain_langgraph/base/model/load.py +123 -0
- package/dist/assets/python/langchain_langgraph/base/pyproject.toml +37 -0
- package/dist/assets/python/openaiagents/base/README.md +39 -0
- package/dist/assets/python/openaiagents/base/gitignore.template +40 -0
- package/dist/assets/python/openaiagents/base/main.py +56 -0
- package/dist/assets/python/openaiagents/base/mcp_client/client.py +14 -0
- package/dist/assets/python/openaiagents/base/model/load.py +37 -0
- package/dist/assets/python/openaiagents/base/pyproject.toml +20 -0
- package/dist/assets/python/strands/base/README.md +41 -0
- package/dist/assets/python/strands/base/gitignore.template +41 -0
- package/dist/assets/python/strands/base/main.py +76 -0
- package/dist/assets/python/strands/base/mcp_client/client.py +12 -0
- package/dist/assets/python/strands/base/model/load.py +123 -0
- package/dist/assets/python/strands/base/pyproject.toml +23 -0
- package/dist/assets/python/strands/capabilities/memory/session.py +39 -0
- package/dist/assets/typescript/.gitkeep +0 -0
- package/dist/cli/index.mjs +985 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/constants.d.ts +25 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +49 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/errors/config.d.ts +49 -0
- package/dist/lib/errors/config.d.ts.map +1 -0
- package/dist/lib/errors/config.js +167 -0
- package/dist/lib/errors/config.js.map +1 -0
- package/dist/lib/errors/index.d.ts +2 -0
- package/dist/lib/errors/index.d.ts.map +1 -0
- package/dist/lib/errors/index.js +18 -0
- package/dist/lib/errors/index.js.map +1 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +39 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/packaging/errors.d.ts +16 -0
- package/dist/lib/packaging/errors.d.ts.map +1 -0
- package/dist/lib/packaging/errors.js +36 -0
- package/dist/lib/packaging/errors.js.map +1 -0
- package/dist/lib/packaging/helpers.d.ts +54 -0
- package/dist/lib/packaging/helpers.d.ts.map +1 -0
- package/dist/lib/packaging/helpers.js +461 -0
- package/dist/lib/packaging/helpers.js.map +1 -0
- package/dist/lib/packaging/index.d.ts +36 -0
- package/dist/lib/packaging/index.d.ts.map +1 -0
- package/dist/lib/packaging/index.js +89 -0
- package/dist/lib/packaging/index.js.map +1 -0
- package/dist/lib/packaging/node.d.ts +17 -0
- package/dist/lib/packaging/node.d.ts.map +1 -0
- package/dist/lib/packaging/node.js +108 -0
- package/dist/lib/packaging/node.js.map +1 -0
- package/dist/lib/packaging/python.d.ts +17 -0
- package/dist/lib/packaging/python.d.ts.map +1 -0
- package/dist/lib/packaging/python.js +162 -0
- package/dist/lib/packaging/python.js.map +1 -0
- package/dist/lib/packaging/types/index.d.ts +2 -0
- package/dist/lib/packaging/types/index.d.ts.map +1 -0
- package/dist/lib/packaging/types/index.js +3 -0
- package/dist/lib/packaging/types/index.js.map +1 -0
- package/dist/lib/packaging/types/packaging.d.ts +57 -0
- package/dist/lib/packaging/types/packaging.d.ts.map +1 -0
- package/dist/lib/packaging/types/packaging.js +3 -0
- package/dist/lib/packaging/types/packaging.js.map +1 -0
- package/dist/lib/packaging/uv.d.ts +7 -0
- package/dist/lib/packaging/uv.d.ts.map +1 -0
- package/dist/lib/packaging/uv.js +40 -0
- package/dist/lib/packaging/uv.js.map +1 -0
- package/dist/lib/schemas/io/config-io.d.ts +106 -0
- package/dist/lib/schemas/io/config-io.d.ts.map +1 -0
- package/dist/lib/schemas/io/config-io.js +293 -0
- package/dist/lib/schemas/io/config-io.js.map +1 -0
- package/dist/lib/schemas/io/index.d.ts +3 -0
- package/dist/lib/schemas/io/index.d.ts.map +1 -0
- package/dist/lib/schemas/io/index.js +17 -0
- package/dist/lib/schemas/io/index.js.map +1 -0
- package/dist/lib/schemas/io/path-resolver.d.ts +112 -0
- package/dist/lib/schemas/io/path-resolver.d.ts.map +1 -0
- package/dist/lib/schemas/io/path-resolver.js +195 -0
- package/dist/lib/schemas/io/path-resolver.js.map +1 -0
- package/dist/lib/utils/aws-account.d.ts +7 -0
- package/dist/lib/utils/aws-account.d.ts.map +1 -0
- package/dist/lib/utils/aws-account.js +24 -0
- package/dist/lib/utils/aws-account.js.map +1 -0
- package/dist/lib/utils/credentials.d.ts +86 -0
- package/dist/lib/utils/credentials.d.ts.map +1 -0
- package/dist/lib/utils/credentials.js +153 -0
- package/dist/lib/utils/credentials.js.map +1 -0
- package/dist/lib/utils/env.d.ts +22 -0
- package/dist/lib/utils/env.d.ts.map +1 -0
- package/dist/lib/utils/env.js +65 -0
- package/dist/lib/utils/env.js.map +1 -0
- package/dist/lib/utils/index.d.ts +7 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/index.js +23 -0
- package/dist/lib/utils/index.js.map +1 -0
- package/dist/lib/utils/platform.d.ts +63 -0
- package/dist/lib/utils/platform.d.ts.map +1 -0
- package/dist/lib/utils/platform.js +88 -0
- package/dist/lib/utils/platform.js.map +1 -0
- package/dist/lib/utils/subprocess.d.ts +29 -0
- package/dist/lib/utils/subprocess.d.ts.map +1 -0
- package/dist/lib/utils/subprocess.js +94 -0
- package/dist/lib/utils/subprocess.js.map +1 -0
- package/dist/lib/utils/zod.d.ts +14 -0
- package/dist/lib/utils/zod.d.ts.map +1 -0
- package/dist/lib/utils/zod.js +32 -0
- package/dist/lib/utils/zod.js.map +1 -0
- package/dist/schema/constants.d.ts +82 -0
- package/dist/schema/constants.d.ts.map +1 -0
- package/dist/schema/constants.js +117 -0
- package/dist/schema/constants.js.map +1 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +21 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/schemas/agent-env.d.ts +75 -0
- package/dist/schema/schemas/agent-env.d.ts.map +1 -0
- package/dist/schema/schemas/agent-env.js +84 -0
- package/dist/schema/schemas/agent-env.js.map +1 -0
- package/dist/schema/schemas/agentcore-project.d.ts +88 -0
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -0
- package/dist/schema/schemas/agentcore-project.js +83 -0
- package/dist/schema/schemas/agentcore-project.js.map +1 -0
- package/dist/schema/schemas/aws-targets.d.ts +50 -0
- package/dist/schema/schemas/aws-targets.d.ts.map +1 -0
- package/dist/schema/schemas/aws-targets.js +49 -0
- package/dist/schema/schemas/aws-targets.js.map +1 -0
- package/dist/schema/schemas/deployed-state.d.ts +260 -0
- package/dist/schema/schemas/deployed-state.d.ts.map +1 -0
- package/dist/schema/schemas/deployed-state.js +100 -0
- package/dist/schema/schemas/deployed-state.js.map +1 -0
- package/dist/schema/schemas/index.d.ts +8 -0
- package/dist/schema/schemas/index.d.ts.map +1 -0
- package/dist/schema/schemas/index.js +25 -0
- package/dist/schema/schemas/index.js.map +1 -0
- package/dist/schema/schemas/mcp-defs.d.ts +52 -0
- package/dist/schema/schemas/mcp-defs.d.ts.map +1 -0
- package/dist/schema/schemas/mcp-defs.js +50 -0
- package/dist/schema/schemas/mcp-defs.js.map +1 -0
- package/dist/schema/schemas/mcp.d.ts +659 -0
- package/dist/schema/schemas/mcp.d.ts.map +1 -0
- package/dist/schema/schemas/mcp.js +283 -0
- package/dist/schema/schemas/mcp.js.map +1 -0
- package/dist/schema/schemas/primitives/index.d.ts +3 -0
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/index.js +9 -0
- package/dist/schema/schemas/primitives/index.js.map +1 -0
- package/dist/schema/schemas/primitives/memory.d.ts +42 -0
- package/dist/schema/schemas/primitives/memory.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/memory.js +50 -0
- package/dist/schema/schemas/primitives/memory.js.map +1 -0
- package/dist/schema/schemas/zod-util.d.ts +10 -0
- package/dist/schema/schemas/zod-util.d.ts.map +1 -0
- package/dist/schema/schemas/zod-util.js +23 -0
- package/dist/schema/schemas/zod-util.js.map +1 -0
- package/dist/schema/types/index.d.ts +2 -0
- package/dist/schema/types/index.d.ts.map +1 -0
- package/dist/schema/types/index.js +18 -0
- package/dist/schema/types/index.js.map +1 -0
- package/dist/schema/types/path.d.ts +27 -0
- package/dist/schema/types/path.d.ts.map +1 -0
- package/dist/schema/types/path.js +13 -0
- package/dist/schema/types/path.js.map +1 -0
- package/package.json +111 -0
- package/scripts/bump-version.ts +442 -0
- package/scripts/check-old-cli.mjs +26 -0
- package/scripts/copy-assets.mjs +50 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentCoreMcpSpecSchema = exports.AgentCoreMcpRuntimeToolSchema = exports.McpRuntimeBindingSchema = exports.AgentCoreGatewaySchema = exports.AgentCoreGatewayTargetSchema = exports.ToolComputeConfigSchema = exports.RuntimeConfigSchema = exports.IamPolicyDocumentSchema = exports.ToolImplementationBindingSchema = exports.ComputeHostSchema = exports.McpImplLanguageSchema = exports.GatewayAuthorizerConfigSchema = exports.CustomJwtAuthorizerConfigSchema = exports.GatewayAuthorizerTypeSchema = exports.GatewayTargetTypeSchema = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const agent_env_1 = require("./agent-env");
|
|
6
|
+
const mcp_defs_1 = require("./mcp-defs");
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// MCP-Specific Schemas
|
|
10
|
+
// ============================================================================
|
|
11
|
+
exports.GatewayTargetTypeSchema = zod_1.z.enum(['lambda', 'mcpServer', 'openApiSchema', 'smithyModel']);
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Gateway Authorization Schemas
|
|
14
|
+
// ============================================================================
|
|
15
|
+
exports.GatewayAuthorizerTypeSchema = zod_1.z.enum(['NONE', 'CUSTOM_JWT']);
|
|
16
|
+
/** OIDC well-known configuration endpoint suffix (per OpenID Connect Discovery 1.0 spec) */
|
|
17
|
+
const OIDC_WELL_KNOWN_SUFFIX = '/.well-known/openid-configuration';
|
|
18
|
+
/**
|
|
19
|
+
* OIDC Discovery URL schema.
|
|
20
|
+
* Must be a valid URL ending with the standard OIDC well-known endpoint.
|
|
21
|
+
* @see https://openid.net/specs/openid-connect-discovery-1_0.html
|
|
22
|
+
*/
|
|
23
|
+
const OidcDiscoveryUrlSchema = zod_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.url('Must be a valid URL')
|
|
26
|
+
.refine(url => url.endsWith(OIDC_WELL_KNOWN_SUFFIX), {
|
|
27
|
+
message: `OIDC discovery URL must end with '${OIDC_WELL_KNOWN_SUFFIX}'`,
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Custom JWT authorizer configuration.
|
|
31
|
+
* Used when authorizerType is 'CUSTOM_JWT'.
|
|
32
|
+
*/
|
|
33
|
+
exports.CustomJwtAuthorizerConfigSchema = zod_1.z.object({
|
|
34
|
+
/** OIDC discovery URL (e.g., https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/openid-configuration) */
|
|
35
|
+
discoveryUrl: OidcDiscoveryUrlSchema,
|
|
36
|
+
/** List of allowed audiences (typically client IDs). Empty array means no audience validation. */
|
|
37
|
+
allowedAudience: zod_1.z.array(zod_1.z.string().min(1)),
|
|
38
|
+
/** List of allowed client IDs */
|
|
39
|
+
allowedClients: zod_1.z.array(zod_1.z.string().min(1)).min(1),
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Gateway authorizer configuration container.
|
|
43
|
+
*/
|
|
44
|
+
exports.GatewayAuthorizerConfigSchema = zod_1.z.object({
|
|
45
|
+
customJwtAuthorizer: exports.CustomJwtAuthorizerConfigSchema.optional(),
|
|
46
|
+
});
|
|
47
|
+
exports.McpImplLanguageSchema = zod_1.z.enum(['TypeScript', 'Python']);
|
|
48
|
+
exports.ComputeHostSchema = zod_1.z.enum(['Lambda', 'AgentCoreRuntime']);
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Branded Path Schemas
|
|
51
|
+
// ============================================================================
|
|
52
|
+
// Branded path schemas - cast string output to branded path types
|
|
53
|
+
const DirectoryPathSchema = zod_1.z.string().min(1);
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// Tool Implementation Binding
|
|
56
|
+
// ============================================================================
|
|
57
|
+
/**
|
|
58
|
+
* Code-based tool implementation (Python, TypeScript).
|
|
59
|
+
*
|
|
60
|
+
* The CLI is responsible for:
|
|
61
|
+
* - installing dependencies
|
|
62
|
+
* - building / bundling
|
|
63
|
+
* - creating a zip artifact
|
|
64
|
+
* - uploading artifacts to S3
|
|
65
|
+
*/
|
|
66
|
+
exports.ToolImplementationBindingSchema = zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
language: zod_1.z.enum(['TypeScript', 'Python']),
|
|
69
|
+
path: zod_1.z.string().min(1),
|
|
70
|
+
handler: zod_1.z.string().min(1),
|
|
71
|
+
})
|
|
72
|
+
.strict();
|
|
73
|
+
// ============================================================================
|
|
74
|
+
// IAM Policy Document
|
|
75
|
+
// ============================================================================
|
|
76
|
+
/**
|
|
77
|
+
* Opaque IAM policy document.
|
|
78
|
+
*
|
|
79
|
+
* This is passed through verbatim to CloudFormation / IAM.
|
|
80
|
+
* AgentCore does not validate, transform, or provide compatibility guarantees.
|
|
81
|
+
*/
|
|
82
|
+
exports.IamPolicyDocumentSchema = zod_1.z
|
|
83
|
+
.object({
|
|
84
|
+
Version: zod_1.z.string(),
|
|
85
|
+
Statement: zod_1.z.array(zod_1.z.unknown()),
|
|
86
|
+
})
|
|
87
|
+
.passthrough(); // Allow additional IAM policy fields
|
|
88
|
+
// ============================================================================
|
|
89
|
+
// Runtime Configuration
|
|
90
|
+
// ============================================================================
|
|
91
|
+
/**
|
|
92
|
+
* AgentCore Runtime name validation.
|
|
93
|
+
* Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}
|
|
94
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrockagentcore-runtime.html#cfn-bedrockagentcore-runtime-agentruntimename
|
|
95
|
+
*/
|
|
96
|
+
const AgentRuntimeNameSchema = zod_1.z
|
|
97
|
+
.string()
|
|
98
|
+
.min(1)
|
|
99
|
+
.max(48)
|
|
100
|
+
.regex(/^[a-zA-Z][a-zA-Z0-9_]{0,47}$/, 'Must begin with a letter and contain only alphanumeric characters and underscores (max 48 chars)');
|
|
101
|
+
/**
|
|
102
|
+
* Python entrypoint validation for Runtime codeConfiguration.
|
|
103
|
+
* Format: "file.py" or "file.py:handler" or "path/file.py:handler"
|
|
104
|
+
*/
|
|
105
|
+
const PythonEntrypointSchema = zod_1.z
|
|
106
|
+
.string()
|
|
107
|
+
.min(1)
|
|
108
|
+
.regex(/^[a-zA-Z0-9_][a-zA-Z0-9_/.-]*\.py(:[a-zA-Z_][a-zA-Z0-9_]*)?$/, 'Must be a Python file path with optional handler (e.g., "main.py:agent" or "src/handler.py:app")');
|
|
109
|
+
/**
|
|
110
|
+
* Instrumentation configuration for runtime observability.
|
|
111
|
+
*/
|
|
112
|
+
const InstrumentationSchema = zod_1.z.object({
|
|
113
|
+
/**
|
|
114
|
+
* Enable OpenTelemetry instrumentation using opentelemetry-distro.
|
|
115
|
+
* When enabled, the runtime entrypoint is wrapped with opentelemetry-instrument.
|
|
116
|
+
* Defaults to true for new runtimes.
|
|
117
|
+
*/
|
|
118
|
+
enableOtel: zod_1.z.boolean().default(true),
|
|
119
|
+
});
|
|
120
|
+
const CodeZipRuntimeConfigSchema = zod_1.z
|
|
121
|
+
.object({
|
|
122
|
+
artifact: zod_1.z.literal('CodeZip'),
|
|
123
|
+
pythonVersion: constants_1.PythonRuntimeSchema,
|
|
124
|
+
name: AgentRuntimeNameSchema,
|
|
125
|
+
entrypoint: PythonEntrypointSchema,
|
|
126
|
+
codeLocation: DirectoryPathSchema,
|
|
127
|
+
/** Instrumentation settings for observability. Defaults to OTel enabled. */
|
|
128
|
+
instrumentation: InstrumentationSchema.optional(),
|
|
129
|
+
networkMode: constants_1.NetworkModeSchema.optional().default('PUBLIC'),
|
|
130
|
+
description: zod_1.z.string().optional(),
|
|
131
|
+
})
|
|
132
|
+
.strict();
|
|
133
|
+
/**
|
|
134
|
+
* Runtime configuration for AgentCore Runtime (MCP mode).
|
|
135
|
+
* Explicit CodeZip artifact configuration - no CLI-managed defaults.
|
|
136
|
+
*/
|
|
137
|
+
exports.RuntimeConfigSchema = CodeZipRuntimeConfigSchema;
|
|
138
|
+
// ============================================================================
|
|
139
|
+
// Compute Configuration
|
|
140
|
+
// ============================================================================
|
|
141
|
+
/**
|
|
142
|
+
* Lambda compute configuration schema.
|
|
143
|
+
* Lambda supports both Python and TypeScript.
|
|
144
|
+
*/
|
|
145
|
+
const LambdaComputeConfigSchema = zod_1.z
|
|
146
|
+
.object({
|
|
147
|
+
host: zod_1.z.literal('Lambda'),
|
|
148
|
+
implementation: exports.ToolImplementationBindingSchema,
|
|
149
|
+
nodeVersion: constants_1.NodeRuntimeSchema.optional(),
|
|
150
|
+
pythonVersion: constants_1.PythonRuntimeSchema.optional(),
|
|
151
|
+
timeout: zod_1.z.number().int().min(1).max(900).optional(),
|
|
152
|
+
memorySize: zod_1.z.number().int().min(128).max(10240).optional(),
|
|
153
|
+
iamPolicy: exports.IamPolicyDocumentSchema.optional(),
|
|
154
|
+
})
|
|
155
|
+
.strict()
|
|
156
|
+
.refine(data => {
|
|
157
|
+
// TypeScript requires nodeVersion
|
|
158
|
+
if (data.implementation.language === 'TypeScript' && !data.nodeVersion) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
// Python requires pythonVersion
|
|
162
|
+
if (data.implementation.language === 'Python' && !data.pythonVersion) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
// Other (container) does not require runtime version - uses container image
|
|
166
|
+
return true;
|
|
167
|
+
}, {
|
|
168
|
+
message: 'TypeScript Lambda must specify nodeVersion, Python Lambda must specify pythonVersion',
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* AgentCore Runtime compute configuration schema.
|
|
172
|
+
* AgentCore Runtime ONLY supports Python.
|
|
173
|
+
*/
|
|
174
|
+
const AgentCoreRuntimeComputeConfigSchema = zod_1.z
|
|
175
|
+
.object({
|
|
176
|
+
host: zod_1.z.literal('AgentCoreRuntime'),
|
|
177
|
+
implementation: exports.ToolImplementationBindingSchema,
|
|
178
|
+
runtime: exports.RuntimeConfigSchema.optional(),
|
|
179
|
+
iamPolicy: exports.IamPolicyDocumentSchema.optional(),
|
|
180
|
+
})
|
|
181
|
+
.strict()
|
|
182
|
+
.refine(data => data.implementation.language === 'Python', {
|
|
183
|
+
message: 'AgentCore Runtime only supports Python',
|
|
184
|
+
});
|
|
185
|
+
/**
|
|
186
|
+
* Tool compute configuration (discriminated union).
|
|
187
|
+
*/
|
|
188
|
+
exports.ToolComputeConfigSchema = zod_1.z.discriminatedUnion('host', [
|
|
189
|
+
LambdaComputeConfigSchema,
|
|
190
|
+
AgentCoreRuntimeComputeConfigSchema,
|
|
191
|
+
]);
|
|
192
|
+
// ============================================================================
|
|
193
|
+
// Gateway Target
|
|
194
|
+
// ============================================================================
|
|
195
|
+
/**
|
|
196
|
+
* A gateway target binds one or more ToolDefinitions to compute that services them.
|
|
197
|
+
*
|
|
198
|
+
* A single Lambda or AgentCoreRuntime can expose multiple tools. The gateway routes
|
|
199
|
+
* tool invocations to the appropriate target based on tool name.
|
|
200
|
+
*
|
|
201
|
+
* If compute is omitted, the tools are treated as external or abstract targets.
|
|
202
|
+
*/
|
|
203
|
+
exports.AgentCoreGatewayTargetSchema = zod_1.z
|
|
204
|
+
.object({
|
|
205
|
+
name: zod_1.z.string().min(1),
|
|
206
|
+
targetType: exports.GatewayTargetTypeSchema,
|
|
207
|
+
toolDefinitions: zod_1.z.array(mcp_defs_1.ToolDefinitionSchema).min(1),
|
|
208
|
+
compute: exports.ToolComputeConfigSchema.optional(),
|
|
209
|
+
})
|
|
210
|
+
.strict();
|
|
211
|
+
// ============================================================================
|
|
212
|
+
// Gateway
|
|
213
|
+
// ============================================================================
|
|
214
|
+
/**
|
|
215
|
+
* Gateway abstraction with opinionated defaults.
|
|
216
|
+
* Supports NONE (default) or CUSTOM_JWT authorizer types.
|
|
217
|
+
*/
|
|
218
|
+
exports.AgentCoreGatewaySchema = zod_1.z
|
|
219
|
+
.object({
|
|
220
|
+
name: agent_env_1.GatewayNameSchema,
|
|
221
|
+
description: zod_1.z.string().optional(),
|
|
222
|
+
targets: zod_1.z.array(exports.AgentCoreGatewayTargetSchema),
|
|
223
|
+
/** Authorization type for the gateway. Defaults to 'NONE'. */
|
|
224
|
+
authorizerType: exports.GatewayAuthorizerTypeSchema.default('NONE'),
|
|
225
|
+
/** Authorizer configuration. Required when authorizerType is 'CUSTOM_JWT'. */
|
|
226
|
+
authorizerConfiguration: exports.GatewayAuthorizerConfigSchema.optional(),
|
|
227
|
+
})
|
|
228
|
+
.strict()
|
|
229
|
+
.refine(data => {
|
|
230
|
+
// If authorizerType is CUSTOM_JWT, customJwtAuthorizer config must be provided
|
|
231
|
+
if (data.authorizerType === 'CUSTOM_JWT') {
|
|
232
|
+
return data.authorizerConfiguration?.customJwtAuthorizer !== undefined;
|
|
233
|
+
}
|
|
234
|
+
return true;
|
|
235
|
+
}, {
|
|
236
|
+
message: 'customJwtAuthorizer configuration is required when authorizerType is CUSTOM_JWT',
|
|
237
|
+
path: ['authorizerConfiguration'],
|
|
238
|
+
});
|
|
239
|
+
// ============================================================================
|
|
240
|
+
// MCP Runtime Tool
|
|
241
|
+
// ============================================================================
|
|
242
|
+
/**
|
|
243
|
+
* Binding from an MCP runtime tool to an agent.
|
|
244
|
+
* When present, the agent is granted InvokeAgentRuntime permission
|
|
245
|
+
* and receives the runtime ARN in the specified environment variable.
|
|
246
|
+
*/
|
|
247
|
+
exports.McpRuntimeBindingSchema = zod_1.z
|
|
248
|
+
.object({
|
|
249
|
+
agentName: zod_1.z.string().min(1),
|
|
250
|
+
envVarName: agent_env_1.EnvVarNameSchema,
|
|
251
|
+
})
|
|
252
|
+
.strict();
|
|
253
|
+
/**
|
|
254
|
+
* AgentCore MCP Runtime tool servers.
|
|
255
|
+
*
|
|
256
|
+
* These are not behind a Gateway. They are deployed as AgentCoreRuntime compute
|
|
257
|
+
* and are directly addressable by agents via the generated DNS endpoint.
|
|
258
|
+
*
|
|
259
|
+
* Use the `bindings` array to grant agents permission to invoke this tool.
|
|
260
|
+
* Each binding grants InvokeAgentRuntime permission and sets an environment variable
|
|
261
|
+
* with the runtime ARN on the bound agent.
|
|
262
|
+
*/
|
|
263
|
+
exports.AgentCoreMcpRuntimeToolSchema = zod_1.z
|
|
264
|
+
.object({
|
|
265
|
+
name: zod_1.z.string().min(1),
|
|
266
|
+
toolDefinition: mcp_defs_1.ToolDefinitionSchema,
|
|
267
|
+
compute: AgentCoreRuntimeComputeConfigSchema,
|
|
268
|
+
bindings: zod_1.z.array(exports.McpRuntimeBindingSchema).optional(),
|
|
269
|
+
})
|
|
270
|
+
.strict();
|
|
271
|
+
// ============================================================================
|
|
272
|
+
// Top-Level MCP Spec
|
|
273
|
+
// ============================================================================
|
|
274
|
+
/**
|
|
275
|
+
* Top-level MCP schema.
|
|
276
|
+
*/
|
|
277
|
+
exports.AgentCoreMcpSpecSchema = zod_1.z
|
|
278
|
+
.object({
|
|
279
|
+
agentCoreGateways: zod_1.z.array(exports.AgentCoreGatewaySchema),
|
|
280
|
+
mcpRuntimeTools: zod_1.z.array(exports.AgentCoreMcpRuntimeToolSchema).optional(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,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,CAAC;IACN,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,UAAU,EAAE,4BAAgB;CAC7B,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ;;;;;;;;;GASG;AACU,QAAA,6BAA6B,GAAG,OAAC;KAC3C,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,cAAc,EAAE,+BAAoB;IACpC,OAAO,EAAE,mCAAmC;IAC5C,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,+BAAuB,CAAC,CAAC,QAAQ,EAAE;CACtD,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E;;GAEG;AACU,QAAA,sBAAsB,GAAG,OAAC;KACpC,MAAM,CAAC;IACN,iBAAiB,EAAE,OAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC;IAClD,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,qCAA6B,CAAC,CAAC,QAAQ,EAAE;CACnE,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryStrategyTypeSchema = exports.MemoryStrategySchema = exports.MemoryStrategyNameSchema = exports.DEFAULT_STRATEGY_NAMESPACES = void 0;
|
|
4
|
+
var memory_1 = require("./memory");
|
|
5
|
+
Object.defineProperty(exports, "DEFAULT_STRATEGY_NAMESPACES", { enumerable: true, get: function () { return memory_1.DEFAULT_STRATEGY_NAMESPACES; } });
|
|
6
|
+
Object.defineProperty(exports, "MemoryStrategyNameSchema", { enumerable: true, get: function () { return memory_1.MemoryStrategyNameSchema; } });
|
|
7
|
+
Object.defineProperty(exports, "MemoryStrategySchema", { enumerable: true, get: function () { return memory_1.MemoryStrategySchema; } });
|
|
8
|
+
Object.defineProperty(exports, "MemoryStrategyTypeSchema", { enumerable: true, get: function () { return memory_1.MemoryStrategyTypeSchema; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/index.ts"],"names":[],"mappings":";;;AACA,mCAKkB;AAJhB,qHAAA,2BAA2B,OAAA;AAC3B,kHAAA,wBAAwB,OAAA;AACxB,8GAAA,oBAAoB,OAAA;AACpB,kHAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Memory strategy types.
|
|
4
|
+
* Maps to AWS MemoryStrategy types:
|
|
5
|
+
* - SEMANTIC → SemanticMemoryStrategy
|
|
6
|
+
* - SUMMARIZATION → SummaryMemoryStrategy (note: CloudFormation uses "Summary")
|
|
7
|
+
* - USER_PREFERENCE → UserPreferenceMemoryStrategy
|
|
8
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-bedrockagentcore-memory-memorystrategy.html
|
|
9
|
+
*/
|
|
10
|
+
export declare const MemoryStrategyTypeSchema: z.ZodEnum<{
|
|
11
|
+
SEMANTIC: "SEMANTIC";
|
|
12
|
+
SUMMARIZATION: "SUMMARIZATION";
|
|
13
|
+
USER_PREFERENCE: "USER_PREFERENCE";
|
|
14
|
+
}>;
|
|
15
|
+
export type MemoryStrategyType = z.infer<typeof MemoryStrategyTypeSchema>;
|
|
16
|
+
/**
|
|
17
|
+
* Default namespaces for each memory strategy type.
|
|
18
|
+
* These match the patterns generated in CLI session.py templates.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_STRATEGY_NAMESPACES: Partial<Record<MemoryStrategyType, string[]>>;
|
|
21
|
+
/**
|
|
22
|
+
* Memory strategy name validation.
|
|
23
|
+
* Pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,47}$
|
|
24
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrockagentcore-memory.html#cfn-bedrockagentcore-memory-name
|
|
25
|
+
*/
|
|
26
|
+
export declare const MemoryStrategyNameSchema: z.ZodString;
|
|
27
|
+
/**
|
|
28
|
+
* Memory strategy configuration.
|
|
29
|
+
* Each memory can have multiple strategies with optional namespace scoping.
|
|
30
|
+
*/
|
|
31
|
+
export declare const MemoryStrategySchema: z.ZodObject<{
|
|
32
|
+
type: z.ZodEnum<{
|
|
33
|
+
SEMANTIC: "SEMANTIC";
|
|
34
|
+
SUMMARIZATION: "SUMMARIZATION";
|
|
35
|
+
USER_PREFERENCE: "USER_PREFERENCE";
|
|
36
|
+
}>;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
namespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export type MemoryStrategy = z.infer<typeof MemoryStrategySchema>;
|
|
42
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;;EAA2D,CAAC;AACjG,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAIrF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAOlC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;iBAS/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryStrategySchema = exports.MemoryStrategyNameSchema = exports.DEFAULT_STRATEGY_NAMESPACES = exports.MemoryStrategyTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Memory Strategy Types
|
|
7
|
+
// ============================================================================
|
|
8
|
+
/**
|
|
9
|
+
* Memory strategy types.
|
|
10
|
+
* Maps to AWS MemoryStrategy types:
|
|
11
|
+
* - SEMANTIC → SemanticMemoryStrategy
|
|
12
|
+
* - SUMMARIZATION → SummaryMemoryStrategy (note: CloudFormation uses "Summary")
|
|
13
|
+
* - USER_PREFERENCE → UserPreferenceMemoryStrategy
|
|
14
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-bedrockagentcore-memory-memorystrategy.html
|
|
15
|
+
*/
|
|
16
|
+
exports.MemoryStrategyTypeSchema = zod_1.z.enum(['SEMANTIC', 'SUMMARIZATION', 'USER_PREFERENCE']);
|
|
17
|
+
/**
|
|
18
|
+
* Default namespaces for each memory strategy type.
|
|
19
|
+
* These match the patterns generated in CLI session.py templates.
|
|
20
|
+
*/
|
|
21
|
+
exports.DEFAULT_STRATEGY_NAMESPACES = {
|
|
22
|
+
SEMANTIC: ['/users/{actorId}/facts'],
|
|
23
|
+
USER_PREFERENCE: ['/users/{actorId}/preferences'],
|
|
24
|
+
SUMMARIZATION: ['/summaries/{actorId}/{sessionId}'],
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Memory strategy name validation.
|
|
28
|
+
* Pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,47}$
|
|
29
|
+
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-bedrockagentcore-memory.html#cfn-bedrockagentcore-memory-name
|
|
30
|
+
*/
|
|
31
|
+
exports.MemoryStrategyNameSchema = zod_1.z
|
|
32
|
+
.string()
|
|
33
|
+
.min(1)
|
|
34
|
+
.max(48)
|
|
35
|
+
.regex(/^[a-zA-Z][a-zA-Z0-9_]{0,47}$/, 'Must begin with a letter and contain only alphanumeric characters and underscores (max 48 chars)');
|
|
36
|
+
/**
|
|
37
|
+
* Memory strategy configuration.
|
|
38
|
+
* Each memory can have multiple strategies with optional namespace scoping.
|
|
39
|
+
*/
|
|
40
|
+
exports.MemoryStrategySchema = zod_1.z.object({
|
|
41
|
+
/** Strategy type */
|
|
42
|
+
type: exports.MemoryStrategyTypeSchema,
|
|
43
|
+
/** Optional custom name for the strategy */
|
|
44
|
+
name: exports.MemoryStrategyNameSchema.optional(),
|
|
45
|
+
/** Optional description */
|
|
46
|
+
description: zod_1.z.string().optional(),
|
|
47
|
+
/** Optional namespaces for scoping memory access */
|
|
48
|
+
namespaces: zod_1.z.array(zod_1.z.string()).optional(),
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/memory.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E;;;;;;;GAOG;AACU,QAAA,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAGjG;;;GAGG;AACU,QAAA,2BAA2B,GAAkD;IACxF,QAAQ,EAAE,CAAC,wBAAwB,CAAC;IACpC,eAAe,EAAE,CAAC,8BAA8B,CAAC;IACjD,aAAa,EAAE,CAAC,kCAAkC,CAAC;CACpD,CAAC;AAEF;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CACJ,8BAA8B,EAC9B,kGAAkG,CACnG,CAAC;AAEJ;;;GAGG;AACU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,oBAAoB;IACpB,IAAI,EAAE,gCAAwB;IAC9B,4CAA4C;IAC5C,IAAI,EAAE,gCAAwB,CAAC,QAAQ,EAAE;IACzC,2BAA2B;IAC3B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,oDAAoD;IACpD,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a superRefine function that validates array elements are unique by a given key.
|
|
4
|
+
*
|
|
5
|
+
* @param keyFn - Function to extract the key from each element
|
|
6
|
+
* @param errorMessage - Function to generate error message for duplicates
|
|
7
|
+
* @returns A superRefine callback for use with z.array().superRefine()
|
|
8
|
+
*/
|
|
9
|
+
export declare function uniqueBy<T>(keyFn: (item: T) => string, errorMessage: (key: string) => string): (items: T[], ctx: z.RefinementCtx) => void;
|
|
10
|
+
//# sourceMappingURL=zod-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-util.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/zod-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC1B,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GACpC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,KAAK,IAAI,CAW5C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uniqueBy = uniqueBy;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a superRefine function that validates array elements are unique by a given key.
|
|
6
|
+
*
|
|
7
|
+
* @param keyFn - Function to extract the key from each element
|
|
8
|
+
* @param errorMessage - Function to generate error message for duplicates
|
|
9
|
+
* @returns A superRefine callback for use with z.array().superRefine()
|
|
10
|
+
*/
|
|
11
|
+
function uniqueBy(keyFn, errorMessage) {
|
|
12
|
+
return (items, ctx) => {
|
|
13
|
+
const seen = new Set();
|
|
14
|
+
for (const [idx, item] of items.entries()) {
|
|
15
|
+
const key = keyFn(item);
|
|
16
|
+
if (seen.has(key)) {
|
|
17
|
+
ctx.addIssue({ code: 'custom', message: errorMessage(key), path: [idx] });
|
|
18
|
+
}
|
|
19
|
+
seen.add(key);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=zod-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-util.js","sourceRoot":"","sources":["../../../src/schema/schemas/zod-util.ts"],"names":[],"mappings":";;AASA,4BAcC;AArBD;;;;;;GAMG;AACH,SAAgB,QAAQ,CACtB,KAA0B,EAC1B,YAAqC;IAErC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAC/B,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClB,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC5E,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./path"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path type definitions for schema fields.
|
|
3
|
+
*
|
|
4
|
+
* These types indicate whether a string field represents a file path or directory path,
|
|
5
|
+
* enabling the UI to render appropriate path completion (files vs directories only).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const PathTypeSchema: z.ZodEnum<{
|
|
9
|
+
file: "file";
|
|
10
|
+
directory: "directory";
|
|
11
|
+
}>;
|
|
12
|
+
export type PathType = z.infer<typeof PathTypeSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Branded type for file path strings.
|
|
15
|
+
* Used to indicate a schema field expects a path to a file.
|
|
16
|
+
*/
|
|
17
|
+
export type FilePath = string & {
|
|
18
|
+
readonly __brand: 'FilePath';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Branded type for directory path strings.
|
|
22
|
+
* Used to indicate a schema field expects a path to a directory.
|
|
23
|
+
*/
|
|
24
|
+
export type DirectoryPath = string & {
|
|
25
|
+
readonly __brand: 'DirectoryPath';
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/schema/types/path.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;EAAgC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PathTypeSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Path type definitions for schema fields.
|
|
6
|
+
*
|
|
7
|
+
* These types indicate whether a string field represents a file path or directory path,
|
|
8
|
+
* enabling the UI to render appropriate path completion (files vs directories only).
|
|
9
|
+
*/
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
// Path type markers for schema fields
|
|
12
|
+
exports.PathTypeSchema = zod_1.z.enum(['file', 'directory']);
|
|
13
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/schema/types/path.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAAwB;AAExB,sCAAsC;AACzB,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC"}
|