@aws/agentcore-cdk 0.1.0-alpha.1

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.
Files changed (235) hide show
  1. package/LICENSE +175 -0
  2. package/README.md +95 -0
  3. package/dist/cdk/constants.d.ts +3 -0
  4. package/dist/cdk/constants.d.ts.map +1 -0
  5. package/dist/cdk/constants.js +9 -0
  6. package/dist/cdk/constants.js.map +1 -0
  7. package/dist/cdk/constructs/bundling/index.d.ts +9 -0
  8. package/dist/cdk/constructs/bundling/index.d.ts.map +1 -0
  9. package/dist/cdk/constructs/bundling/index.js +15 -0
  10. package/dist/cdk/constructs/bundling/index.js.map +1 -0
  11. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.d.ts +71 -0
  12. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.d.ts.map +1 -0
  13. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.js +71 -0
  14. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.js.map +1 -0
  15. package/dist/cdk/constructs/bundling/zip/PythonBundledCodeZipAsset.d.ts +15 -0
  16. package/dist/cdk/constructs/bundling/zip/PythonBundledCodeZipAsset.d.ts.map +1 -0
  17. package/dist/cdk/constructs/bundling/zip/PythonBundledCodeZipAsset.js +40 -0
  18. package/dist/cdk/constructs/bundling/zip/PythonBundledCodeZipAsset.js.map +1 -0
  19. package/dist/cdk/constructs/bundling/zip/index.d.ts +3 -0
  20. package/dist/cdk/constructs/bundling/zip/index.d.ts.map +1 -0
  21. package/dist/cdk/constructs/bundling/zip/index.js +8 -0
  22. package/dist/cdk/constructs/bundling/zip/index.js.map +1 -0
  23. package/dist/cdk/constructs/components/base-props.d.ts +8 -0
  24. package/dist/cdk/constructs/components/base-props.d.ts.map +1 -0
  25. package/dist/cdk/constructs/components/base-props.js +3 -0
  26. package/dist/cdk/constructs/components/base-props.js.map +1 -0
  27. package/dist/cdk/constructs/components/index.d.ts +4 -0
  28. package/dist/cdk/constructs/components/index.d.ts.map +1 -0
  29. package/dist/cdk/constructs/components/index.js +19 -0
  30. package/dist/cdk/constructs/components/index.js.map +1 -0
  31. package/dist/cdk/constructs/components/mcp/McpGateway.d.ts +37 -0
  32. package/dist/cdk/constructs/components/mcp/McpGateway.d.ts.map +1 -0
  33. package/dist/cdk/constructs/components/mcp/McpGateway.js +154 -0
  34. package/dist/cdk/constructs/components/mcp/McpGateway.js.map +1 -0
  35. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.d.ts +33 -0
  36. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.d.ts.map +1 -0
  37. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js +85 -0
  38. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js.map +1 -0
  39. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.d.ts +36 -0
  40. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.d.ts.map +1 -0
  41. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js +73 -0
  42. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js.map +1 -0
  43. package/dist/cdk/constructs/components/mcp/index.d.ts +5 -0
  44. package/dist/cdk/constructs/components/mcp/index.d.ts.map +1 -0
  45. package/dist/cdk/constructs/components/mcp/index.js +17 -0
  46. package/dist/cdk/constructs/components/mcp/index.js.map +1 -0
  47. package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts +25 -0
  48. package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts.map +1 -0
  49. package/dist/cdk/constructs/components/mcp/mcp-utils.js +43 -0
  50. package/dist/cdk/constructs/components/mcp/mcp-utils.js.map +1 -0
  51. package/dist/cdk/constructs/components/primitives/index.d.ts +3 -0
  52. package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -0
  53. package/dist/cdk/constructs/components/primitives/index.js +9 -0
  54. package/dist/cdk/constructs/components/primitives/index.js.map +1 -0
  55. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts +64 -0
  56. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts.map +1 -0
  57. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js +191 -0
  58. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js.map +1 -0
  59. package/dist/cdk/constructs/components/primitives/memory/index.d.ts +2 -0
  60. package/dist/cdk/constructs/components/primitives/memory/index.d.ts.map +1 -0
  61. package/dist/cdk/constructs/components/primitives/memory/index.js +6 -0
  62. package/dist/cdk/constructs/components/primitives/memory/index.js.map +1 -0
  63. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts +52 -0
  64. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts.map +1 -0
  65. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js +179 -0
  66. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js.map +1 -0
  67. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntimeRole.d.ts +24 -0
  68. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntimeRole.d.ts.map +1 -0
  69. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntimeRole.js +39 -0
  70. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntimeRole.js.map +1 -0
  71. package/dist/cdk/constructs/components/primitives/runtime/index.d.ts +3 -0
  72. package/dist/cdk/constructs/components/primitives/runtime/index.d.ts.map +1 -0
  73. package/dist/cdk/constructs/components/primitives/runtime/index.js +8 -0
  74. package/dist/cdk/constructs/components/primitives/runtime/index.js.map +1 -0
  75. package/dist/cdk/constructs/index.d.ts +4 -0
  76. package/dist/cdk/constructs/index.d.ts.map +1 -0
  77. package/dist/cdk/constructs/index.js +18 -0
  78. package/dist/cdk/constructs/index.js.map +1 -0
  79. package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +44 -0
  80. package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -0
  81. package/dist/cdk/constructs/l3/AgentCoreApplication.js +121 -0
  82. package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -0
  83. package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts +76 -0
  84. package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +1 -0
  85. package/dist/cdk/constructs/l3/AgentCoreMcp.js +203 -0
  86. package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +1 -0
  87. package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +34 -0
  88. package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +1 -0
  89. package/dist/cdk/constructs/l3/AgentEnvironment.js +66 -0
  90. package/dist/cdk/constructs/l3/AgentEnvironment.js.map +1 -0
  91. package/dist/cdk/constructs/l3/index.d.ts +4 -0
  92. package/dist/cdk/constructs/l3/index.d.ts.map +1 -0
  93. package/dist/cdk/constructs/l3/index.js +10 -0
  94. package/dist/cdk/constructs/l3/index.js.map +1 -0
  95. package/dist/cdk/index.d.ts +4 -0
  96. package/dist/cdk/index.d.ts.map +1 -0
  97. package/dist/cdk/index.js +21 -0
  98. package/dist/cdk/index.js.map +1 -0
  99. package/dist/cdk/logical-ids.d.ts +36 -0
  100. package/dist/cdk/logical-ids.d.ts.map +1 -0
  101. package/dist/cdk/logical-ids.js +88 -0
  102. package/dist/cdk/logical-ids.js.map +1 -0
  103. package/dist/index.d.ts +14 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +64 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/lib/constants.d.ts +24 -0
  108. package/dist/lib/constants.d.ts.map +1 -0
  109. package/dist/lib/constants.js +48 -0
  110. package/dist/lib/constants.js.map +1 -0
  111. package/dist/lib/errors/config.d.ts +49 -0
  112. package/dist/lib/errors/config.d.ts.map +1 -0
  113. package/dist/lib/errors/config.js +167 -0
  114. package/dist/lib/errors/config.js.map +1 -0
  115. package/dist/lib/errors/index.d.ts +2 -0
  116. package/dist/lib/errors/index.d.ts.map +1 -0
  117. package/dist/lib/errors/index.js +18 -0
  118. package/dist/lib/errors/index.js.map +1 -0
  119. package/dist/lib/index.d.ts +7 -0
  120. package/dist/lib/index.d.ts.map +1 -0
  121. package/dist/lib/index.js +37 -0
  122. package/dist/lib/index.js.map +1 -0
  123. package/dist/lib/packaging/errors.d.ts +16 -0
  124. package/dist/lib/packaging/errors.d.ts.map +1 -0
  125. package/dist/lib/packaging/errors.js +36 -0
  126. package/dist/lib/packaging/errors.js.map +1 -0
  127. package/dist/lib/packaging/helpers.d.ts +56 -0
  128. package/dist/lib/packaging/helpers.d.ts.map +1 -0
  129. package/dist/lib/packaging/helpers.js +428 -0
  130. package/dist/lib/packaging/helpers.js.map +1 -0
  131. package/dist/lib/packaging/index.d.ts +24 -0
  132. package/dist/lib/packaging/index.d.ts.map +1 -0
  133. package/dist/lib/packaging/index.js +55 -0
  134. package/dist/lib/packaging/index.js.map +1 -0
  135. package/dist/lib/packaging/python.d.ts +10 -0
  136. package/dist/lib/packaging/python.d.ts.map +1 -0
  137. package/dist/lib/packaging/python.js +94 -0
  138. package/dist/lib/packaging/python.js.map +1 -0
  139. package/dist/lib/packaging/types/index.d.ts +2 -0
  140. package/dist/lib/packaging/types/index.d.ts.map +1 -0
  141. package/dist/lib/packaging/types/index.js +3 -0
  142. package/dist/lib/packaging/types/index.js.map +1 -0
  143. package/dist/lib/packaging/types/packaging.d.ts +36 -0
  144. package/dist/lib/packaging/types/packaging.d.ts.map +1 -0
  145. package/dist/lib/packaging/types/packaging.js +3 -0
  146. package/dist/lib/packaging/types/packaging.js.map +1 -0
  147. package/dist/lib/packaging/uv.d.ts +7 -0
  148. package/dist/lib/packaging/uv.d.ts.map +1 -0
  149. package/dist/lib/packaging/uv.js +40 -0
  150. package/dist/lib/packaging/uv.js.map +1 -0
  151. package/dist/lib/schemas/io/config-io.d.ts +99 -0
  152. package/dist/lib/schemas/io/config-io.d.ts.map +1 -0
  153. package/dist/lib/schemas/io/config-io.js +283 -0
  154. package/dist/lib/schemas/io/config-io.js.map +1 -0
  155. package/dist/lib/schemas/io/index.d.ts +3 -0
  156. package/dist/lib/schemas/io/index.d.ts.map +1 -0
  157. package/dist/lib/schemas/io/index.js +17 -0
  158. package/dist/lib/schemas/io/index.js.map +1 -0
  159. package/dist/lib/schemas/io/path-resolver.d.ts +112 -0
  160. package/dist/lib/schemas/io/path-resolver.d.ts.map +1 -0
  161. package/dist/lib/schemas/io/path-resolver.js +195 -0
  162. package/dist/lib/schemas/io/path-resolver.js.map +1 -0
  163. package/dist/lib/utils/index.d.ts +4 -0
  164. package/dist/lib/utils/index.d.ts.map +1 -0
  165. package/dist/lib/utils/index.js +15 -0
  166. package/dist/lib/utils/index.js.map +1 -0
  167. package/dist/lib/utils/platform.d.ts +2 -0
  168. package/dist/lib/utils/platform.d.ts.map +1 -0
  169. package/dist/lib/utils/platform.js +5 -0
  170. package/dist/lib/utils/platform.js.map +1 -0
  171. package/dist/lib/utils/subprocess.d.ts +29 -0
  172. package/dist/lib/utils/subprocess.d.ts.map +1 -0
  173. package/dist/lib/utils/subprocess.js +94 -0
  174. package/dist/lib/utils/subprocess.js.map +1 -0
  175. package/dist/lib/utils/zod.d.ts +14 -0
  176. package/dist/lib/utils/zod.d.ts.map +1 -0
  177. package/dist/lib/utils/zod.js +32 -0
  178. package/dist/lib/utils/zod.js.map +1 -0
  179. package/dist/schema/constants.d.ts +83 -0
  180. package/dist/schema/constants.d.ts.map +1 -0
  181. package/dist/schema/constants.js +125 -0
  182. package/dist/schema/constants.js.map +1 -0
  183. package/dist/schema/index.d.ts +4 -0
  184. package/dist/schema/index.d.ts.map +1 -0
  185. package/dist/schema/index.js +21 -0
  186. package/dist/schema/index.js.map +1 -0
  187. package/dist/schema/schemas/agent-env.d.ts +75 -0
  188. package/dist/schema/schemas/agent-env.d.ts.map +1 -0
  189. package/dist/schema/schemas/agent-env.js +84 -0
  190. package/dist/schema/schemas/agent-env.js.map +1 -0
  191. package/dist/schema/schemas/agentcore-project.d.ts +90 -0
  192. package/dist/schema/schemas/agentcore-project.d.ts.map +1 -0
  193. package/dist/schema/schemas/agentcore-project.js +82 -0
  194. package/dist/schema/schemas/agentcore-project.js.map +1 -0
  195. package/dist/schema/schemas/aws-targets.d.ts +50 -0
  196. package/dist/schema/schemas/aws-targets.d.ts.map +1 -0
  197. package/dist/schema/schemas/aws-targets.js +49 -0
  198. package/dist/schema/schemas/aws-targets.js.map +1 -0
  199. package/dist/schema/schemas/deployed-state.d.ts +251 -0
  200. package/dist/schema/schemas/deployed-state.d.ts.map +1 -0
  201. package/dist/schema/schemas/deployed-state.js +98 -0
  202. package/dist/schema/schemas/deployed-state.js.map +1 -0
  203. package/dist/schema/schemas/index.d.ts +8 -0
  204. package/dist/schema/schemas/index.d.ts.map +1 -0
  205. package/dist/schema/schemas/index.js +25 -0
  206. package/dist/schema/schemas/index.js.map +1 -0
  207. package/dist/schema/schemas/mcp-defs.d.ts +52 -0
  208. package/dist/schema/schemas/mcp-defs.d.ts.map +1 -0
  209. package/dist/schema/schemas/mcp-defs.js +50 -0
  210. package/dist/schema/schemas/mcp-defs.js.map +1 -0
  211. package/dist/schema/schemas/mcp.d.ts +660 -0
  212. package/dist/schema/schemas/mcp.d.ts.map +1 -0
  213. package/dist/schema/schemas/mcp.js +284 -0
  214. package/dist/schema/schemas/mcp.js.map +1 -0
  215. package/dist/schema/schemas/primitives/index.d.ts +3 -0
  216. package/dist/schema/schemas/primitives/index.d.ts.map +1 -0
  217. package/dist/schema/schemas/primitives/index.js +8 -0
  218. package/dist/schema/schemas/primitives/index.js.map +1 -0
  219. package/dist/schema/schemas/primitives/memory.d.ts +40 -0
  220. package/dist/schema/schemas/primitives/memory.d.ts.map +1 -0
  221. package/dist/schema/schemas/primitives/memory.js +42 -0
  222. package/dist/schema/schemas/primitives/memory.js.map +1 -0
  223. package/dist/schema/schemas/zod-util.d.ts +10 -0
  224. package/dist/schema/schemas/zod-util.d.ts.map +1 -0
  225. package/dist/schema/schemas/zod-util.js +23 -0
  226. package/dist/schema/schemas/zod-util.js.map +1 -0
  227. package/dist/schema/types/index.d.ts +2 -0
  228. package/dist/schema/types/index.d.ts.map +1 -0
  229. package/dist/schema/types/index.js +18 -0
  230. package/dist/schema/types/index.js.map +1 -0
  231. package/dist/schema/types/path.d.ts +27 -0
  232. package/dist/schema/types/path.d.ts.map +1 -0
  233. package/dist/schema/types/path.js +13 -0
  234. package/dist/schema/types/path.js.map +1 -0
  235. package/package.json +97 -0
@@ -0,0 +1,283 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigIO = void 0;
4
+ exports.createConfigIO = createConfigIO;
5
+ const schema_1 = require("../../../schema");
6
+ const errors_1 = require("../../errors");
7
+ const path_resolver_1 = require("./path-resolver");
8
+ const client_sts_1 = require("@aws-sdk/client-sts");
9
+ const credential_providers_1 = require("@aws-sdk/credential-providers");
10
+ const shared_ini_file_loader_1 = require("@smithy/shared-ini-file-loader");
11
+ const fs_1 = require("fs");
12
+ const promises_1 = require("fs/promises");
13
+ const path_1 = require("path");
14
+ /**
15
+ * Detect AWS account ID from current credentials.
16
+ * Returns null if credentials are not available or invalid.
17
+ */
18
+ async function detectAwsAccount() {
19
+ try {
20
+ const client = new client_sts_1.STSClient({
21
+ credentials: (0, credential_providers_1.fromNodeProviderChain)(),
22
+ region: process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? 'us-east-1',
23
+ });
24
+ const response = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
25
+ return response.Account ?? null;
26
+ }
27
+ catch {
28
+ return null;
29
+ }
30
+ }
31
+ /**
32
+ * Manages reading, writing, and validation of AgentCore configuration files
33
+ */
34
+ class ConfigIO {
35
+ pathResolver;
36
+ /**
37
+ * Create a ConfigIO instance.
38
+ * If no baseDir is provided, automatically discovers the project using findConfigRoot().
39
+ */
40
+ constructor(pathConfig) {
41
+ // Auto-discover config root if no baseDir provided
42
+ if (!pathConfig?.baseDir) {
43
+ const discoveredRoot = (0, path_resolver_1.findConfigRoot)();
44
+ if (discoveredRoot) {
45
+ pathConfig = { ...pathConfig, baseDir: discoveredRoot };
46
+ }
47
+ }
48
+ this.pathResolver = new path_resolver_1.PathResolver(pathConfig);
49
+ }
50
+ /**
51
+ * Get the current path resolver
52
+ */
53
+ getPathResolver() {
54
+ return this.pathResolver;
55
+ }
56
+ /**
57
+ * Update the base directory for config files
58
+ */
59
+ setBaseDir(baseDir) {
60
+ this.pathResolver.setBaseDir(baseDir);
61
+ }
62
+ /**
63
+ * Get the project root directory (parent of agentcore/)
64
+ */
65
+ getProjectRoot() {
66
+ return this.pathResolver.getProjectRoot();
67
+ }
68
+ /**
69
+ * Get the config root directory (the agentcore/ directory)
70
+ */
71
+ getConfigRoot() {
72
+ return this.pathResolver.getBaseDir();
73
+ }
74
+ /**
75
+ * Read and validate the project configuration.
76
+ */
77
+ async readProjectSpec() {
78
+ const filePath = this.pathResolver.getAgentConfigPath();
79
+ return this.readAndValidate(filePath, 'AgentCore Project Config', schema_1.AgentCoreProjectSpecSchema);
80
+ }
81
+ /**
82
+ * Write and validate the project configuration file.
83
+ */
84
+ async writeProjectSpec(data) {
85
+ const filePath = this.pathResolver.getAgentConfigPath();
86
+ await this.validateAndWrite(filePath, 'AgentCore Project Config', schema_1.AgentCoreProjectSpecSchema, data);
87
+ }
88
+ /**
89
+ * Read and validate the AWS configuration file.
90
+ * Applies overrides following AWS SDK precedence:
91
+ * - Account: from current credentials if AWS_PROFILE is set
92
+ * - Region: AWS_REGION > AWS_DEFAULT_REGION > profile config > saved value
93
+ */
94
+ async readAWSDeploymentTargets() {
95
+ const filePath = this.pathResolver.getAWSTargetsConfigPath();
96
+ let targets = await this.readAndValidate(filePath, 'AWS Targets', schema_1.AwsDeploymentTargetsSchema);
97
+ // Override account from credentials if AWS_PROFILE is set
98
+ if (process.env.AWS_PROFILE) {
99
+ const account = await detectAwsAccount();
100
+ if (account) {
101
+ targets = targets.map(t => ({ ...t, account }));
102
+ }
103
+ }
104
+ // Override region from env vars
105
+ const envRegion = process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION;
106
+ if (envRegion && schema_1.AgentCoreRegionSchema.safeParse(envRegion).success) {
107
+ return targets.map(t => ({ ...t, region: envRegion }));
108
+ }
109
+ // Check profile config for region
110
+ try {
111
+ const profile = process.env.AWS_PROFILE ?? 'default';
112
+ const config = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)();
113
+ const profileRegion = config.configFile?.[profile]?.region;
114
+ if (profileRegion && schema_1.AgentCoreRegionSchema.safeParse(profileRegion).success) {
115
+ return targets.map(t => ({ ...t, region: profileRegion }));
116
+ }
117
+ }
118
+ catch {
119
+ // Config file not available - use current targets
120
+ }
121
+ return targets;
122
+ }
123
+ /**
124
+ * Write and validate the AWS configuration file
125
+ */
126
+ async writeAWSDeploymentTargets(data) {
127
+ const filePath = this.pathResolver.getAWSTargetsConfigPath();
128
+ await this.validateAndWrite(filePath, 'AWS Targets', schema_1.AwsDeploymentTargetsSchema, data);
129
+ }
130
+ /**
131
+ * Read and validate the deployed state file.
132
+ * Validates that all target keys exist in aws-targets.
133
+ */
134
+ async readDeployedState() {
135
+ const targets = await this.readAWSDeploymentTargets();
136
+ const targetNames = targets.map(t => t.name);
137
+ const schema = (0, schema_1.createValidatedDeployedStateSchema)(targetNames);
138
+ const filePath = this.pathResolver.getStatePath();
139
+ return this.readAndValidate(filePath, 'State', schema);
140
+ }
141
+ /**
142
+ * Write and validate the deployed state file.
143
+ * Validates that all target keys exist in aws-targets.
144
+ */
145
+ async writeDeployedState(data) {
146
+ const targets = await this.readAWSDeploymentTargets();
147
+ const targetNames = targets.map(t => t.name);
148
+ const schema = (0, schema_1.createValidatedDeployedStateSchema)(targetNames);
149
+ const filePath = this.pathResolver.getStatePath();
150
+ await this.validateAndWrite(filePath, 'State', schema, data);
151
+ }
152
+ /**
153
+ * Read and validate the MCP configuration file
154
+ */
155
+ async readMcpSpec() {
156
+ const filePath = this.pathResolver.getMcpConfigPath();
157
+ return this.readAndValidate(filePath, 'MCP Config', schema_1.AgentCoreMcpSpecSchema);
158
+ }
159
+ /**
160
+ * Write and validate the MCP configuration file
161
+ */
162
+ async writeMcpSpec(data) {
163
+ const filePath = this.pathResolver.getMcpConfigPath();
164
+ await this.validateAndWrite(filePath, 'MCP Config', schema_1.AgentCoreMcpSpecSchema, data);
165
+ }
166
+ /**
167
+ * Read and validate the MCP definitions file
168
+ */
169
+ async readMcpDefs() {
170
+ const filePath = this.pathResolver.getMcpDefsPath();
171
+ return this.readAndValidate(filePath, 'MCP Definitions', schema_1.AgentCoreCliMcpDefsSchema);
172
+ }
173
+ /**
174
+ * Write and validate the MCP definitions file
175
+ */
176
+ async writeMcpDefs(data) {
177
+ const filePath = this.pathResolver.getMcpDefsPath();
178
+ await this.validateAndWrite(filePath, 'MCP Definitions', schema_1.AgentCoreCliMcpDefsSchema, data);
179
+ }
180
+ /**
181
+ * Check if the base directory exists
182
+ */
183
+ baseDirExists() {
184
+ return (0, fs_1.existsSync)(this.pathResolver.getBaseDir());
185
+ }
186
+ /**
187
+ * Check if a specific config file exists
188
+ */
189
+ configExists(type) {
190
+ const pathMap = {
191
+ project: this.pathResolver.getAgentConfigPath(),
192
+ awsTargets: this.pathResolver.getAWSTargetsConfigPath(),
193
+ state: this.pathResolver.getStatePath(),
194
+ mcp: this.pathResolver.getMcpConfigPath(),
195
+ mcpDefs: this.pathResolver.getMcpDefsPath(),
196
+ };
197
+ return (0, fs_1.existsSync)(pathMap[type]);
198
+ }
199
+ /**
200
+ * Initialize the base directory and CLI system subdirectory
201
+ */
202
+ async initializeBaseDir() {
203
+ const baseDir = this.pathResolver.getBaseDir();
204
+ const cliSystemDir = this.pathResolver.getCliSystemDir();
205
+ try {
206
+ await (0, promises_1.mkdir)(baseDir, { recursive: true });
207
+ await (0, promises_1.mkdir)(cliSystemDir, { recursive: true });
208
+ }
209
+ catch (err) {
210
+ const normalizedError = err instanceof Error ? err : new Error('Unknown error');
211
+ throw new errors_1.ConfigWriteError(baseDir, normalizedError);
212
+ }
213
+ }
214
+ /**
215
+ * Generic read and validate method
216
+ */
217
+ async readAndValidate(filePath, fileType, schema) {
218
+ // Check if file exists
219
+ if (!(0, fs_1.existsSync)(filePath)) {
220
+ throw new errors_1.ConfigNotFoundError(filePath, fileType);
221
+ }
222
+ // Read file
223
+ let fileContent;
224
+ try {
225
+ fileContent = await (0, promises_1.readFile)(filePath, 'utf-8');
226
+ }
227
+ catch (err) {
228
+ const normalizedError = err instanceof Error ? err : new Error('Unknown error');
229
+ throw new errors_1.ConfigReadError(filePath, normalizedError);
230
+ }
231
+ // Parse JSON
232
+ let parsed;
233
+ try {
234
+ parsed = JSON.parse(fileContent);
235
+ }
236
+ catch (err) {
237
+ const normalizedError = err instanceof Error ? err : new Error('Invalid JSON');
238
+ throw new errors_1.ConfigParseError(filePath, normalizedError);
239
+ }
240
+ // Validate with Zod schema
241
+ const result = schema.safeParse(parsed);
242
+ if (!result.success) {
243
+ throw new errors_1.ConfigValidationError(filePath, fileType, result.error);
244
+ }
245
+ return result.data;
246
+ }
247
+ /**
248
+ * Generic validate and write method
249
+ */
250
+ async validateAndWrite(filePath, fileType, schema, data) {
251
+ // Validate data with Zod schema
252
+ const result = schema.safeParse(data);
253
+ if (!result.success) {
254
+ throw new errors_1.ConfigValidationError(filePath, fileType, result.error);
255
+ }
256
+ // Ensure directory exists
257
+ const dir = (0, path_1.dirname)(filePath);
258
+ try {
259
+ await (0, promises_1.mkdir)(dir, { recursive: true });
260
+ }
261
+ catch (err) {
262
+ const normalizedError = err instanceof Error ? err : new Error('Unknown error');
263
+ throw new errors_1.ConfigWriteError(filePath, normalizedError);
264
+ }
265
+ // Write file with pretty formatting
266
+ try {
267
+ const jsonContent = JSON.stringify(result.data, null, 2);
268
+ await (0, promises_1.writeFile)(filePath, jsonContent, 'utf-8');
269
+ }
270
+ catch (err) {
271
+ const normalizedError = err instanceof Error ? err : new Error('Unknown error');
272
+ throw new errors_1.ConfigWriteError(filePath, normalizedError);
273
+ }
274
+ }
275
+ }
276
+ exports.ConfigIO = ConfigIO;
277
+ /**
278
+ * Create a new ConfigIO instance
279
+ */
280
+ function createConfigIO(pathConfig) {
281
+ return new ConfigIO(pathConfig);
282
+ }
283
+ //# sourceMappingURL=config-io.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-io.js","sourceRoot":"","sources":["../../../../src/lib/schemas/io/config-io.ts"],"names":[],"mappings":";;;AAmUA,wCAEC;AA9TD,4CAOyB;AACzB,yCAMsB;AACtB,mDAAgF;AAChF,oDAA0E;AAC1E,wEAAsE;AACtE,2EAAuE;AACvE,2BAAgC;AAChC,0CAAyD;AACzD,+BAA+B;AAG/B;;;GAGG;AACH,KAAK,UAAU,gBAAgB;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC;YAC3B,WAAW,EAAE,IAAA,4CAAqB,GAAE;YACpC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW;SAChF,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,qCAAwB,CAAC,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAa,QAAQ;IACF,YAAY,CAAe;IAE5C;;;OAGG;IACH,YAAY,UAAgC;QAC1C,mDAAmD;QACnD,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC;YACzB,MAAM,cAAc,GAAG,IAAA,8BAAc,GAAE,CAAC;YACxC,IAAI,cAAc,EAAE,CAAC;gBACnB,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;YAC1D,CAAC;QACH,CAAC;QACD,IAAI,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YACH,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACzD,MAAM,IAAA,oBAAS,EAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,MAAM,eAAe,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YAChF,MAAM,IAAI,yBAAgB,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CACF;AA3QD,4BA2QC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,UAAgC;IAC7D,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { PathResolver, DEFAULT_PATH_CONFIG, findConfigRoot, findProjectRoot, setSessionProjectRoot, getSessionProjectRoot, getWorkingDirectory, requireConfigRoot, NoProjectError, type PathConfig, } from './path-resolver';
2
+ export { ConfigIO, createConfigIO } from './config-io';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/schemas/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createConfigIO = exports.ConfigIO = exports.NoProjectError = exports.requireConfigRoot = exports.getWorkingDirectory = exports.getSessionProjectRoot = exports.setSessionProjectRoot = exports.findProjectRoot = exports.findConfigRoot = exports.DEFAULT_PATH_CONFIG = exports.PathResolver = void 0;
4
+ var path_resolver_1 = require("./path-resolver");
5
+ Object.defineProperty(exports, "PathResolver", { enumerable: true, get: function () { return path_resolver_1.PathResolver; } });
6
+ Object.defineProperty(exports, "DEFAULT_PATH_CONFIG", { enumerable: true, get: function () { return path_resolver_1.DEFAULT_PATH_CONFIG; } });
7
+ Object.defineProperty(exports, "findConfigRoot", { enumerable: true, get: function () { return path_resolver_1.findConfigRoot; } });
8
+ Object.defineProperty(exports, "findProjectRoot", { enumerable: true, get: function () { return path_resolver_1.findProjectRoot; } });
9
+ Object.defineProperty(exports, "setSessionProjectRoot", { enumerable: true, get: function () { return path_resolver_1.setSessionProjectRoot; } });
10
+ Object.defineProperty(exports, "getSessionProjectRoot", { enumerable: true, get: function () { return path_resolver_1.getSessionProjectRoot; } });
11
+ Object.defineProperty(exports, "getWorkingDirectory", { enumerable: true, get: function () { return path_resolver_1.getWorkingDirectory; } });
12
+ Object.defineProperty(exports, "requireConfigRoot", { enumerable: true, get: function () { return path_resolver_1.requireConfigRoot; } });
13
+ Object.defineProperty(exports, "NoProjectError", { enumerable: true, get: function () { return path_resolver_1.NoProjectError; } });
14
+ var config_io_1 = require("./config-io");
15
+ Object.defineProperty(exports, "ConfigIO", { enumerable: true, get: function () { return config_io_1.ConfigIO; } });
16
+ Object.defineProperty(exports, "createConfigIO", { enumerable: true, get: function () { return config_io_1.createConfigIO; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/schemas/io/index.ts"],"names":[],"mappings":";;;AAAA,iDAWyB;AAVvB,6GAAA,YAAY,OAAA;AACZ,oHAAA,mBAAmB,OAAA;AACnB,+GAAA,cAAc,OAAA;AACd,gHAAA,eAAe,OAAA;AACf,sHAAA,qBAAqB,OAAA;AACrB,sHAAA,qBAAqB,OAAA;AACrB,oHAAA,mBAAmB,OAAA;AACnB,kHAAA,iBAAiB,OAAA;AACjB,+GAAA,cAAc,OAAA;AAGhB,yCAAuD;AAA9C,qGAAA,QAAQ,OAAA;AAAE,2GAAA,cAAc,OAAA"}
@@ -0,0 +1,112 @@
1
+ export declare const CONFIG_FILES: {
2
+ readonly AGENT_ENV: "agentcore.json";
3
+ readonly AWS_TARGETS: "aws-targets.json";
4
+ readonly DEPLOYED_STATE: "deployed-state.json";
5
+ readonly MCP: "mcp.json";
6
+ readonly MCP_DEFS: "mcp-defs.json";
7
+ };
8
+ /**
9
+ * Error thrown when no AgentCore project is found.
10
+ */
11
+ export declare class NoProjectError extends Error {
12
+ constructor(message?: string);
13
+ }
14
+ /**
15
+ * Get the working directory where the user invoked the CLI.
16
+ *
17
+ * When running via npm/bun scripts (e.g., `npm run cli`), the package manager
18
+ * changes process.cwd() to the package root. INIT_CWD preserves the original
19
+ * directory where the user ran the command.
20
+ *
21
+ * For globally installed CLIs, INIT_CWD is not set, so we fall back to process.cwd().
22
+ */
23
+ export declare function getWorkingDirectory(): string;
24
+ /**
25
+ * Find the config root, throwing NoProjectError if not found.
26
+ * Use this when a project is required to proceed.
27
+ */
28
+ export declare function requireConfigRoot(startDir?: string): string;
29
+ /**
30
+ * Set the project root for the current session.
31
+ * Call this after init creates a new project at cwd/projectName/.
32
+ * Subsequent calls to findConfigRoot() will check this location first.
33
+ */
34
+ export declare function setSessionProjectRoot(projectRoot: string): void;
35
+ /**
36
+ * Get the current session project root, if set.
37
+ */
38
+ export declare function getSessionProjectRoot(): string | null;
39
+ /**
40
+ * Configuration for where AgentCore files are stored
41
+ */
42
+ export interface PathConfig {
43
+ /** Base directory for all AgentCore files */
44
+ baseDir: string;
45
+ }
46
+ /**
47
+ * Walk up the directory tree from startDir looking for an agentcore directory.
48
+ * If a session project was set (via setSessionProjectRoot), checks there first.
49
+ * Returns the path to the agentcore directory if found, or null if not found.
50
+ */
51
+ export declare function findConfigRoot(startDir?: string): string | null;
52
+ /**
53
+ * Get the project root directory (parent of agentcore/).
54
+ * Returns null if no project is found.
55
+ */
56
+ export declare function findProjectRoot(startDir?: string): string | null;
57
+ /**
58
+ * Default configuration uses agentcore/ in current working directory.
59
+ */
60
+ export declare const DEFAULT_PATH_CONFIG: PathConfig;
61
+ /**
62
+ * Utility class for resolving AgentCore file paths
63
+ */
64
+ export declare class PathResolver {
65
+ private config;
66
+ constructor(config?: Partial<PathConfig>);
67
+ /**
68
+ * Get the base directory path (the agentcore/ config directory)
69
+ */
70
+ getBaseDir(): string;
71
+ /**
72
+ * Get the project root directory (parent of agentcore/)
73
+ */
74
+ getProjectRoot(): string;
75
+ /**
76
+ * Get the path to the agent config file (agentcore.json)
77
+ */
78
+ getAgentConfigPath(): string;
79
+ /**
80
+ * Get the path to the AWS targets config file (aws-targets.json)
81
+ */
82
+ getAWSTargetsConfigPath(): string;
83
+ /**
84
+ * Get the path to the CLI system directory (agentcore/.cli/)
85
+ */
86
+ getCliSystemDir(): string;
87
+ /**
88
+ * Get the path to the logs directory (agentcore/.cli/logs/)
89
+ */
90
+ getLogsDir(): string;
91
+ /**
92
+ * Get the path to the invoke logs directory (agentcore/.cli/logs/invoke/)
93
+ */
94
+ getInvokeLogsDir(): string;
95
+ /**
96
+ * Get the path to the deployed state file (agentcore/.cli/deployed-state.json)
97
+ */
98
+ getStatePath(): string;
99
+ /**
100
+ * Get the path to the MCP config file (mcp.json)
101
+ */
102
+ getMcpConfigPath(): string;
103
+ /**
104
+ * Get the path to the MCP definitions file (mcp-defs.json)
105
+ */
106
+ getMcpDefsPath(): string;
107
+ /**
108
+ * Update the base directory
109
+ */
110
+ setBaseDir(baseDir: string): void;
111
+ }
112
+ //# sourceMappingURL=path-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-resolver.d.ts","sourceRoot":"","sources":["../../../../src/lib/schemas/io/path-resolver.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;CA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AAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAGlC"}
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PathResolver = exports.DEFAULT_PATH_CONFIG = exports.NoProjectError = exports.CONFIG_FILES = void 0;
4
+ exports.getWorkingDirectory = getWorkingDirectory;
5
+ exports.requireConfigRoot = requireConfigRoot;
6
+ exports.setSessionProjectRoot = setSessionProjectRoot;
7
+ exports.getSessionProjectRoot = getSessionProjectRoot;
8
+ exports.findConfigRoot = findConfigRoot;
9
+ exports.findProjectRoot = findProjectRoot;
10
+ const constants_1 = require("../../constants");
11
+ const fs_1 = require("fs");
12
+ const path_1 = require("path");
13
+ // Re-export for backward compatibility
14
+ exports.CONFIG_FILES = constants_1.CONFIG_FILES;
15
+ /**
16
+ * Error thrown when no AgentCore project is found.
17
+ */
18
+ class NoProjectError extends Error {
19
+ constructor(message) {
20
+ super(message ?? 'No agentcore project found. Run "agentcore create" first.');
21
+ this.name = 'NoProjectError';
22
+ }
23
+ }
24
+ exports.NoProjectError = NoProjectError;
25
+ /**
26
+ * Get the working directory where the user invoked the CLI.
27
+ *
28
+ * When running via npm/bun scripts (e.g., `npm run cli`), the package manager
29
+ * changes process.cwd() to the package root. INIT_CWD preserves the original
30
+ * directory where the user ran the command.
31
+ *
32
+ * For globally installed CLIs, INIT_CWD is not set, so we fall back to process.cwd().
33
+ */
34
+ function getWorkingDirectory() {
35
+ return process.env.INIT_CWD ?? process.cwd();
36
+ }
37
+ /**
38
+ * Find the config root, throwing NoProjectError if not found.
39
+ * Use this when a project is required to proceed.
40
+ */
41
+ function requireConfigRoot(startDir) {
42
+ const configRoot = findConfigRoot(startDir);
43
+ if (!configRoot) {
44
+ throw new NoProjectError();
45
+ }
46
+ return configRoot;
47
+ }
48
+ /**
49
+ * Session-level project root override.
50
+ * Set this after init creates a project so subsequent discovery finds it.
51
+ */
52
+ let sessionProjectRoot = null;
53
+ /**
54
+ * Set the project root for the current session.
55
+ * Call this after init creates a new project at cwd/projectName/.
56
+ * Subsequent calls to findConfigRoot() will check this location first.
57
+ */
58
+ function setSessionProjectRoot(projectRoot) {
59
+ sessionProjectRoot = projectRoot;
60
+ }
61
+ /**
62
+ * Get the current session project root, if set.
63
+ */
64
+ function getSessionProjectRoot() {
65
+ return sessionProjectRoot;
66
+ }
67
+ /**
68
+ * Check if a directory is a valid AgentCore config directory.
69
+ * A valid config directory contains agentcore.json.
70
+ */
71
+ function isValidConfigDir(configPath) {
72
+ return (0, fs_1.existsSync)((0, path_1.join)(configPath, constants_1.CONFIG_FILES.AGENT_ENV));
73
+ }
74
+ /**
75
+ * Walk up the directory tree from startDir looking for an agentcore directory.
76
+ * If a session project was set (via setSessionProjectRoot), checks there first.
77
+ * Returns the path to the agentcore directory if found, or null if not found.
78
+ */
79
+ function findConfigRoot(startDir = getWorkingDirectory()) {
80
+ // Check session project first (set after init creates a project)
81
+ if (sessionProjectRoot) {
82
+ const sessionConfigPath = (0, path_1.join)(sessionProjectRoot, constants_1.CONFIG_DIR);
83
+ if ((0, fs_1.existsSync)(sessionConfigPath) && isValidConfigDir(sessionConfigPath)) {
84
+ return sessionConfigPath;
85
+ }
86
+ }
87
+ // Fall back to walking up the directory tree
88
+ let currentDir = startDir;
89
+ while (true) {
90
+ const configPath = (0, path_1.join)(currentDir, constants_1.CONFIG_DIR);
91
+ if ((0, fs_1.existsSync)(configPath) && isValidConfigDir(configPath)) {
92
+ return configPath;
93
+ }
94
+ const parentDir = (0, path_1.dirname)(currentDir);
95
+ // Reached filesystem root
96
+ if (parentDir === currentDir) {
97
+ return null;
98
+ }
99
+ currentDir = parentDir;
100
+ }
101
+ }
102
+ /**
103
+ * Get the project root directory (parent of agentcore/).
104
+ * Returns null if no project is found.
105
+ */
106
+ function findProjectRoot(startDir = process.cwd()) {
107
+ const configRoot = findConfigRoot(startDir);
108
+ return configRoot ? (0, path_1.dirname)(configRoot) : null;
109
+ }
110
+ /**
111
+ * Default configuration uses agentcore/ in current working directory.
112
+ */
113
+ exports.DEFAULT_PATH_CONFIG = {
114
+ baseDir: (0, path_1.join)(getWorkingDirectory(), constants_1.CONFIG_DIR),
115
+ };
116
+ /**
117
+ * Utility class for resolving AgentCore file paths
118
+ */
119
+ class PathResolver {
120
+ config;
121
+ constructor(config) {
122
+ this.config = {
123
+ ...exports.DEFAULT_PATH_CONFIG,
124
+ ...config,
125
+ };
126
+ }
127
+ /**
128
+ * Get the base directory path (the agentcore/ config directory)
129
+ */
130
+ getBaseDir() {
131
+ return this.config.baseDir;
132
+ }
133
+ /**
134
+ * Get the project root directory (parent of agentcore/)
135
+ */
136
+ getProjectRoot() {
137
+ return (0, path_1.dirname)(this.config.baseDir);
138
+ }
139
+ /**
140
+ * Get the path to the agent config file (agentcore.json)
141
+ */
142
+ getAgentConfigPath() {
143
+ return (0, path_1.join)(this.config.baseDir, exports.CONFIG_FILES.AGENT_ENV);
144
+ }
145
+ /**
146
+ * Get the path to the AWS targets config file (aws-targets.json)
147
+ */
148
+ getAWSTargetsConfigPath() {
149
+ return (0, path_1.join)(this.config.baseDir, exports.CONFIG_FILES.AWS_TARGETS);
150
+ }
151
+ /**
152
+ * Get the path to the CLI system directory (agentcore/.cli/)
153
+ */
154
+ getCliSystemDir() {
155
+ return (0, path_1.join)(this.config.baseDir, constants_1.CLI_SYSTEM_DIR);
156
+ }
157
+ /**
158
+ * Get the path to the logs directory (agentcore/.cli/logs/)
159
+ */
160
+ getLogsDir() {
161
+ return (0, path_1.join)(this.config.baseDir, constants_1.CLI_SYSTEM_DIR, constants_1.CLI_LOGS_DIR);
162
+ }
163
+ /**
164
+ * Get the path to the invoke logs directory (agentcore/.cli/logs/invoke/)
165
+ */
166
+ getInvokeLogsDir() {
167
+ return (0, path_1.join)(this.config.baseDir, constants_1.CLI_SYSTEM_DIR, constants_1.CLI_LOGS_DIR, 'invoke');
168
+ }
169
+ /**
170
+ * Get the path to the deployed state file (agentcore/.cli/deployed-state.json)
171
+ */
172
+ getStatePath() {
173
+ return (0, path_1.join)(this.config.baseDir, constants_1.CLI_SYSTEM_DIR, exports.CONFIG_FILES.DEPLOYED_STATE);
174
+ }
175
+ /**
176
+ * Get the path to the MCP config file (mcp.json)
177
+ */
178
+ getMcpConfigPath() {
179
+ return (0, path_1.join)(this.config.baseDir, exports.CONFIG_FILES.MCP);
180
+ }
181
+ /**
182
+ * Get the path to the MCP definitions file (mcp-defs.json)
183
+ */
184
+ getMcpDefsPath() {
185
+ return (0, path_1.join)(this.config.baseDir, exports.CONFIG_FILES.MCP_DEFS);
186
+ }
187
+ /**
188
+ * Update the base directory
189
+ */
190
+ setBaseDir(baseDir) {
191
+ this.config.baseDir = baseDir;
192
+ }
193
+ }
194
+ exports.PathResolver = PathResolver;
195
+ //# sourceMappingURL=path-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-resolver.js","sourceRoot":"","sources":["../../../../src/lib/schemas/io/path-resolver.ts"],"names":[],"mappings":";;;AA0BA,kDAEC;AAMD,8CAMC;AAaD,sDAEC;AAKD,sDAEC;AAuBD,wCAyBC;AAMD,0CAGC;AAvHD,+CAA0G;AAC1G,2BAAgC;AAChC,+BAAqC;AAErC,uCAAuC;AAC1B,QAAA,YAAY,GAAG,wBAAa,CAAC;AAE1C;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,2DAA2D,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAED;;;;;;;;GAQG;AACH,SAAgB,mBAAmB;IACjC,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,QAAiB;IACjD,MAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,U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AAO,EAAE,0BAAc,EAAE,wBAAY,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAA,WAAI,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,0BAAc,EAAE,wBAAY,EAAE,QAAQ,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,IAAA,WAAI,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,0BAAc,EAAE,oBAAY,CAAC,cAAc,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAA,WAAI,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,oBAAY,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAA,WAAI,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,oBAAY,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,OAAe;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC;CACF;AAtFD,oCAsFC"}
@@ -0,0 +1,4 @@
1
+ export { isWindows } from './platform';
2
+ export { runSubprocess, checkSubprocess, runSubprocessCapture, runSubprocessCaptureSync, checkSubprocessSync, type SubprocessOptions, type SubprocessResult, } from './subprocess';
3
+ export { validateAgentSchema, validateProjectSchema } from './zod';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC"}