@aws/agentcore 1.0.0-preview.8 → 1.0.0-rc.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 (389) hide show
  1. package/README.md +978 -145
  2. package/dist/assets/agent-inspector/index.css.asset +1 -0
  3. package/dist/assets/agent-inspector/index.js.asset +289 -0
  4. package/dist/assets/cdk/README.md +3 -0
  5. package/dist/assets/cdk/bin/cdk.ts +109 -59
  6. package/dist/assets/cdk/lib/cdk-stack.ts +30 -19
  7. package/dist/assets/cdk/package.json +9 -9
  8. package/dist/assets/cdk/test/cdk.test.ts +94 -2
  9. package/dist/assets/evaluators/autoevals-lambda/README.md +23 -0
  10. package/dist/assets/evaluators/autoevals-lambda/execution-role-policy.json +15 -0
  11. package/dist/assets/evaluators/autoevals-lambda/lambda_function.py +37 -0
  12. package/dist/assets/evaluators/autoevals-lambda/pyproject.toml +23 -0
  13. package/dist/assets/evaluators/deepeval-lambda/README.md +23 -0
  14. package/dist/assets/evaluators/deepeval-lambda/execution-role-policy.json +15 -0
  15. package/dist/assets/evaluators/deepeval-lambda/lambda_function.py +29 -0
  16. package/dist/assets/evaluators/deepeval-lambda/pyproject.toml +22 -0
  17. package/dist/assets/evaluators/python-lambda/README.md +28 -0
  18. package/dist/assets/evaluators/python-lambda/pyproject.toml +1 -1
  19. package/dist/assets/templates/a2a-python-strands/README.md +31 -0
  20. package/dist/assets/templates/a2a-python-strands/main.py +100 -0
  21. package/dist/assets/templates/a2a-python-strands/memory/session.py +35 -0
  22. package/dist/assets/templates/a2a-python-strands/model/load.py +6 -0
  23. package/dist/assets/templates/a2a-python-strands/pyproject.toml +20 -0
  24. package/dist/assets/templates/agent-python-langchain/README.md +55 -0
  25. package/dist/assets/{python/a2a/googleadk/base → templates/agent-python-langchain}/gitignore.template +1 -1
  26. package/dist/assets/templates/agent-python-langchain/main.py +54 -0
  27. package/dist/assets/templates/agent-python-langchain/model/load.py +9 -0
  28. package/dist/assets/templates/agent-python-langchain/pyproject.toml +21 -0
  29. package/dist/assets/templates/agent-python-minimal/README.md +31 -0
  30. package/dist/assets/templates/agent-python-minimal/main.py +13 -0
  31. package/dist/assets/templates/agent-python-minimal/pyproject.toml +18 -0
  32. package/dist/assets/{container/python/Dockerfile → templates/agent-python-strands/Dockerfile.template} +3 -1
  33. package/dist/assets/templates/agent-python-strands/README.md +46 -0
  34. package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-strands}/gitignore.template +1 -1
  35. package/dist/assets/templates/agent-python-strands/main.py +106 -0
  36. package/dist/assets/templates/agent-python-strands/memory/__init__.py +0 -0
  37. package/dist/assets/templates/agent-python-strands/memory/session.py +35 -0
  38. package/dist/assets/{python/http/strands/base → templates/agent-python-strands}/model/load.py +46 -0
  39. package/dist/assets/templates/agent-python-strands/pyproject.toml +24 -0
  40. package/dist/assets/templates/agent-typescript-strands/README.md +29 -0
  41. package/dist/assets/templates/agent-typescript-strands/gitignore.template +22 -0
  42. package/dist/assets/templates/agent-typescript-strands/main.ts +86 -0
  43. package/dist/assets/templates/agent-typescript-strands/mcp_client/client.ts +11 -0
  44. package/dist/assets/templates/agent-typescript-strands/memory/memory.ts +44 -0
  45. package/dist/assets/templates/agent-typescript-strands/model/load.ts +5 -0
  46. package/dist/assets/templates/agent-typescript-strands/package.json.template +29 -0
  47. package/dist/assets/templates/agent-typescript-strands/tsconfig.json +19 -0
  48. package/dist/assets/templates/agent-typescript-vercel/README.md +22 -0
  49. package/dist/assets/templates/agent-typescript-vercel/gitignore.template +22 -0
  50. package/dist/assets/templates/agent-typescript-vercel/main.ts +35 -0
  51. package/dist/assets/templates/agent-typescript-vercel/package.json.template +24 -0
  52. package/dist/assets/templates/agent-typescript-vercel/tsconfig.json +19 -0
  53. package/dist/assets/templates/agui-python-strands/README.md +39 -0
  54. package/dist/assets/{python/a2a/strands/base → templates/agui-python-strands}/gitignore.template +1 -1
  55. package/dist/assets/{python/agui/strands/base → templates/agui-python-strands}/main.py +11 -14
  56. package/dist/assets/templates/agui-python-strands/memory/__init__.py +0 -0
  57. package/dist/assets/templates/agui-python-strands/memory/session.py +35 -0
  58. package/dist/assets/templates/agui-python-strands/model/load.py +6 -0
  59. package/dist/assets/templates/agui-python-strands/pyproject.toml +22 -0
  60. package/dist/assets/{python/http/strands/base → templates/export-harness-python}/README.md +15 -8
  61. package/dist/assets/templates/export-harness-python/gitignore.template +41 -0
  62. package/dist/assets/templates/export-harness-python/main.py +584 -0
  63. package/dist/assets/templates/export-harness-python/mcp_client/client.py +63 -0
  64. package/dist/assets/templates/export-harness-python/memory/__init__.py +0 -0
  65. package/dist/assets/templates/export-harness-python/memory/session.py +47 -0
  66. package/dist/assets/templates/export-harness-python/model/load.py +249 -0
  67. package/dist/assets/templates/export-harness-python/model/mantle_compat.py +21 -0
  68. package/dist/assets/templates/export-harness-python/pyproject.toml +22 -0
  69. package/dist/assets/templates/export-harness-python/skills/fetcher.py +279 -0
  70. package/dist/assets/templates/mcp-python-fastmcp/README.md +32 -0
  71. package/dist/assets/templates/mcp-python-fastmcp/gitignore.template +41 -0
  72. package/dist/assets/templates/mcp-python-fastmcp/main.py +83 -0
  73. package/dist/assets/{python/mcp/standalone/base → templates/mcp-python-fastmcp}/pyproject.toml +3 -2
  74. package/dist/assets/templates/shared/env.local.template +11 -0
  75. package/dist/assets/templates/shared/gitignore.template +19 -0
  76. package/dist/index.js +4 -27
  77. package/dist/main.js +1190 -0
  78. package/package.json +75 -149
  79. package/LICENSE +0 -175
  80. package/dist/agent-inspector/index.css +0 -1
  81. package/dist/agent-inspector/index.js +0 -279
  82. package/dist/assets/README.md +0 -104
  83. package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +0 -5673
  84. package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +0 -77
  85. package/dist/assets/__tests__/assets.snapshot.test.ts +0 -125
  86. package/dist/assets/__tests__/dockerfile-render.test.ts +0 -24
  87. package/dist/assets/agents/AGENTS.md +0 -141
  88. package/dist/assets/harness/invoke.py.template +0 -74
  89. package/dist/assets/mcp/python/README.md +0 -27
  90. package/dist/assets/mcp/python/pyproject.toml +0 -22
  91. package/dist/assets/mcp/python/server.py +0 -117
  92. package/dist/assets/mcp/python-lambda/README.md +0 -22
  93. package/dist/assets/mcp/python-lambda/handler.py +0 -144
  94. package/dist/assets/mcp/python-lambda/pyproject.toml +0 -15
  95. package/dist/assets/python/a2a/googleadk/base/README.md +0 -22
  96. package/dist/assets/python/a2a/googleadk/base/main.py +0 -110
  97. package/dist/assets/python/a2a/googleadk/base/model/load.py +0 -41
  98. package/dist/assets/python/a2a/googleadk/base/pyproject.toml +0 -20
  99. package/dist/assets/python/a2a/langchain_langgraph/base/README.md +0 -22
  100. package/dist/assets/python/a2a/langchain_langgraph/base/main.py +0 -130
  101. package/dist/assets/python/a2a/langchain_langgraph/base/model/load.py +0 -123
  102. package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +0 -25
  103. package/dist/assets/python/a2a/strands/base/README.md +0 -22
  104. package/dist/assets/python/a2a/strands/base/main.py +0 -107
  105. package/dist/assets/python/a2a/strands/base/model/load.py +0 -123
  106. package/dist/assets/python/a2a/strands/base/pyproject.toml +0 -23
  107. package/dist/assets/python/a2a/strands/capabilities/memory/session.py +0 -43
  108. package/dist/assets/python/agui/googleadk/base/README.md +0 -30
  109. package/dist/assets/python/agui/googleadk/base/gitignore.template +0 -41
  110. package/dist/assets/python/agui/googleadk/base/main.py +0 -31
  111. package/dist/assets/python/agui/googleadk/base/model/load.py +0 -41
  112. package/dist/assets/python/agui/googleadk/base/pyproject.toml +0 -24
  113. package/dist/assets/python/agui/langchain_langgraph/base/README.md +0 -22
  114. package/dist/assets/python/agui/langchain_langgraph/base/gitignore.template +0 -41
  115. package/dist/assets/python/agui/langchain_langgraph/base/main.py +0 -74
  116. package/dist/assets/python/agui/langchain_langgraph/base/model/load.py +0 -123
  117. package/dist/assets/python/agui/langchain_langgraph/base/pyproject.toml +0 -30
  118. package/dist/assets/python/agui/strands/base/README.md +0 -22
  119. package/dist/assets/python/agui/strands/base/gitignore.template +0 -41
  120. package/dist/assets/python/agui/strands/base/model/__init__.py +0 -1
  121. package/dist/assets/python/agui/strands/base/model/load.py +0 -123
  122. package/dist/assets/python/agui/strands/base/pyproject.toml +0 -27
  123. package/dist/assets/python/agui/strands/capabilities/memory/__init__.py +0 -1
  124. package/dist/assets/python/agui/strands/capabilities/memory/session.py +0 -43
  125. package/dist/assets/python/http/autogen/base/README.md +0 -39
  126. package/dist/assets/python/http/autogen/base/gitignore.template +0 -41
  127. package/dist/assets/python/http/autogen/base/main.py +0 -112
  128. package/dist/assets/python/http/autogen/base/mcp_client/__init__.py +0 -1
  129. package/dist/assets/python/http/autogen/base/mcp_client/client.py +0 -28
  130. package/dist/assets/python/http/autogen/base/model/__init__.py +0 -1
  131. package/dist/assets/python/http/autogen/base/model/load.py +0 -136
  132. package/dist/assets/python/http/autogen/base/pyproject.toml +0 -34
  133. package/dist/assets/python/http/googleadk/base/README.md +0 -39
  134. package/dist/assets/python/http/googleadk/base/gitignore.template +0 -41
  135. package/dist/assets/python/http/googleadk/base/main.py +0 -160
  136. package/dist/assets/python/http/googleadk/base/mcp_client/__init__.py +0 -1
  137. package/dist/assets/python/http/googleadk/base/mcp_client/client.py +0 -75
  138. package/dist/assets/python/http/googleadk/base/model/__init__.py +0 -1
  139. package/dist/assets/python/http/googleadk/base/model/load.py +0 -41
  140. package/dist/assets/python/http/googleadk/base/pyproject.toml +0 -22
  141. package/dist/assets/python/http/langchain_langgraph/base/README.md +0 -39
  142. package/dist/assets/python/http/langchain_langgraph/base/gitignore.template +0 -41
  143. package/dist/assets/python/http/langchain_langgraph/base/main.py +0 -176
  144. package/dist/assets/python/http/langchain_langgraph/base/mcp_client/__init__.py +0 -1
  145. package/dist/assets/python/http/langchain_langgraph/base/mcp_client/client.py +0 -77
  146. package/dist/assets/python/http/langchain_langgraph/base/model/__init__.py +0 -1
  147. package/dist/assets/python/http/langchain_langgraph/base/model/load.py +0 -123
  148. package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +0 -37
  149. package/dist/assets/python/http/openaiagents/base/README.md +0 -39
  150. package/dist/assets/python/http/openaiagents/base/gitignore.template +0 -41
  151. package/dist/assets/python/http/openaiagents/base/main.py +0 -169
  152. package/dist/assets/python/http/openaiagents/base/mcp_client/__init__.py +0 -1
  153. package/dist/assets/python/http/openaiagents/base/mcp_client/client.py +0 -74
  154. package/dist/assets/python/http/openaiagents/base/model/__init__.py +0 -1
  155. package/dist/assets/python/http/openaiagents/base/model/load.py +0 -37
  156. package/dist/assets/python/http/openaiagents/base/pyproject.toml +0 -21
  157. package/dist/assets/python/http/strands/base/main.py +0 -217
  158. package/dist/assets/python/http/strands/base/mcp_client/__init__.py +0 -1
  159. package/dist/assets/python/http/strands/base/mcp_client/client.py +0 -73
  160. package/dist/assets/python/http/strands/base/model/__init__.py +0 -1
  161. package/dist/assets/python/http/strands/base/pyproject.toml +0 -25
  162. package/dist/assets/python/http/strands/capabilities/memory/__init__.py +0 -1
  163. package/dist/assets/python/http/strands/capabilities/memory/session.py +0 -44
  164. package/dist/assets/python/mcp/standalone/base/README.md +0 -36
  165. package/dist/assets/python/mcp/standalone/base/gitignore.template +0 -41
  166. package/dist/assets/python/mcp/standalone/base/main.py +0 -25
  167. package/dist/cli/index.mjs +0 -1718
  168. package/dist/index.d.ts +0 -9
  169. package/dist/index.d.ts.map +0 -1
  170. package/dist/index.js.map +0 -1
  171. package/dist/lib/constants.d.ts +0 -37
  172. package/dist/lib/constants.d.ts.map +0 -1
  173. package/dist/lib/constants.js +0 -69
  174. package/dist/lib/constants.js.map +0 -1
  175. package/dist/lib/errors/config.d.ts +0 -49
  176. package/dist/lib/errors/config.d.ts.map +0 -1
  177. package/dist/lib/errors/config.js +0 -170
  178. package/dist/lib/errors/config.js.map +0 -1
  179. package/dist/lib/errors/index.d.ts +0 -2
  180. package/dist/lib/errors/index.d.ts.map +0 -1
  181. package/dist/lib/errors/index.js +0 -18
  182. package/dist/lib/errors/index.js.map +0 -1
  183. package/dist/lib/index.d.ts +0 -7
  184. package/dist/lib/index.d.ts.map +0 -1
  185. package/dist/lib/index.js +0 -44
  186. package/dist/lib/index.js.map +0 -1
  187. package/dist/lib/packaging/build-args.d.ts +0 -6
  188. package/dist/lib/packaging/build-args.d.ts.map +0 -1
  189. package/dist/lib/packaging/build-args.js +0 -18
  190. package/dist/lib/packaging/build-args.js.map +0 -1
  191. package/dist/lib/packaging/container.d.ts +0 -10
  192. package/dist/lib/packaging/container.d.ts.map +0 -1
  193. package/dist/lib/packaging/container.js +0 -78
  194. package/dist/lib/packaging/container.js.map +0 -1
  195. package/dist/lib/packaging/errors.d.ts +0 -16
  196. package/dist/lib/packaging/errors.d.ts.map +0 -1
  197. package/dist/lib/packaging/errors.js +0 -36
  198. package/dist/lib/packaging/errors.js.map +0 -1
  199. package/dist/lib/packaging/helpers.d.ts +0 -54
  200. package/dist/lib/packaging/helpers.d.ts.map +0 -1
  201. package/dist/lib/packaging/helpers.js +0 -463
  202. package/dist/lib/packaging/helpers.js.map +0 -1
  203. package/dist/lib/packaging/index.d.ts +0 -40
  204. package/dist/lib/packaging/index.d.ts.map +0 -1
  205. package/dist/lib/packaging/index.js +0 -98
  206. package/dist/lib/packaging/index.js.map +0 -1
  207. package/dist/lib/packaging/node.d.ts +0 -22
  208. package/dist/lib/packaging/node.d.ts.map +0 -1
  209. package/dist/lib/packaging/node.js +0 -109
  210. package/dist/lib/packaging/node.js.map +0 -1
  211. package/dist/lib/packaging/python.d.ts +0 -23
  212. package/dist/lib/packaging/python.d.ts.map +0 -1
  213. package/dist/lib/packaging/python.js +0 -165
  214. package/dist/lib/packaging/python.js.map +0 -1
  215. package/dist/lib/packaging/types/index.d.ts +0 -2
  216. package/dist/lib/packaging/types/index.d.ts.map +0 -1
  217. package/dist/lib/packaging/types/index.js +0 -3
  218. package/dist/lib/packaging/types/index.js.map +0 -1
  219. package/dist/lib/packaging/types/packaging.d.ts +0 -57
  220. package/dist/lib/packaging/types/packaging.d.ts.map +0 -1
  221. package/dist/lib/packaging/types/packaging.js +0 -3
  222. package/dist/lib/packaging/types/packaging.js.map +0 -1
  223. package/dist/lib/packaging/uv.d.ts +0 -7
  224. package/dist/lib/packaging/uv.d.ts.map +0 -1
  225. package/dist/lib/packaging/uv.js +0 -40
  226. package/dist/lib/packaging/uv.js.map +0 -1
  227. package/dist/lib/schemas/io/config-io.d.ts +0 -119
  228. package/dist/lib/schemas/io/config-io.d.ts.map +0 -1
  229. package/dist/lib/schemas/io/config-io.js +0 -323
  230. package/dist/lib/schemas/io/config-io.js.map +0 -1
  231. package/dist/lib/schemas/io/global-config.d.ts +0 -33
  232. package/dist/lib/schemas/io/global-config.d.ts.map +0 -1
  233. package/dist/lib/schemas/io/global-config.js +0 -89
  234. package/dist/lib/schemas/io/global-config.js.map +0 -1
  235. package/dist/lib/schemas/io/index.d.ts +0 -3
  236. package/dist/lib/schemas/io/index.d.ts.map +0 -1
  237. package/dist/lib/schemas/io/index.js +0 -18
  238. package/dist/lib/schemas/io/index.js.map +0 -1
  239. package/dist/lib/schemas/io/path-resolver.d.ts +0 -119
  240. package/dist/lib/schemas/io/path-resolver.d.ts.map +0 -1
  241. package/dist/lib/schemas/io/path-resolver.js +0 -207
  242. package/dist/lib/schemas/io/path-resolver.js.map +0 -1
  243. package/dist/lib/utils/aws-account.d.ts +0 -7
  244. package/dist/lib/utils/aws-account.d.ts.map +0 -1
  245. package/dist/lib/utils/aws-account.js +0 -24
  246. package/dist/lib/utils/aws-account.js.map +0 -1
  247. package/dist/lib/utils/credentials.d.ts +0 -86
  248. package/dist/lib/utils/credentials.d.ts.map +0 -1
  249. package/dist/lib/utils/credentials.js +0 -153
  250. package/dist/lib/utils/credentials.js.map +0 -1
  251. package/dist/lib/utils/env.d.ts +0 -22
  252. package/dist/lib/utils/env.d.ts.map +0 -1
  253. package/dist/lib/utils/env.js +0 -65
  254. package/dist/lib/utils/env.js.map +0 -1
  255. package/dist/lib/utils/index.d.ts +0 -9
  256. package/dist/lib/utils/index.d.ts.map +0 -1
  257. package/dist/lib/utils/index.js +0 -27
  258. package/dist/lib/utils/index.js.map +0 -1
  259. package/dist/lib/utils/json-rpc.d.ts +0 -3
  260. package/dist/lib/utils/json-rpc.d.ts.map +0 -1
  261. package/dist/lib/utils/json-rpc.js +0 -27
  262. package/dist/lib/utils/json-rpc.js.map +0 -1
  263. package/dist/lib/utils/platform.d.ts +0 -63
  264. package/dist/lib/utils/platform.d.ts.map +0 -1
  265. package/dist/lib/utils/platform.js +0 -88
  266. package/dist/lib/utils/platform.js.map +0 -1
  267. package/dist/lib/utils/subprocess.d.ts +0 -29
  268. package/dist/lib/utils/subprocess.d.ts.map +0 -1
  269. package/dist/lib/utils/subprocess.js +0 -116
  270. package/dist/lib/utils/subprocess.js.map +0 -1
  271. package/dist/lib/utils/time-parser.d.ts +0 -11
  272. package/dist/lib/utils/time-parser.d.ts.map +0 -1
  273. package/dist/lib/utils/time-parser.js +0 -47
  274. package/dist/lib/utils/time-parser.js.map +0 -1
  275. package/dist/lib/utils/zod.d.ts +0 -14
  276. package/dist/lib/utils/zod.d.ts.map +0 -1
  277. package/dist/lib/utils/zod.js +0 -32
  278. package/dist/lib/utils/zod.js.map +0 -1
  279. package/dist/schema/constants.d.ts +0 -119
  280. package/dist/schema/constants.d.ts.map +0 -1
  281. package/dist/schema/constants.js +0 -170
  282. package/dist/schema/constants.js.map +0 -1
  283. package/dist/schema/index.d.ts +0 -4
  284. package/dist/schema/index.d.ts.map +0 -1
  285. package/dist/schema/index.js +0 -21
  286. package/dist/schema/index.js.map +0 -1
  287. package/dist/schema/schemas/agent-env.d.ts +0 -186
  288. package/dist/schema/schemas/agent-env.d.ts.map +0 -1
  289. package/dist/schema/schemas/agent-env.js +0 -240
  290. package/dist/schema/schemas/agent-env.js.map +0 -1
  291. package/dist/schema/schemas/agentcore-project.d.ts +0 -838
  292. package/dist/schema/schemas/agentcore-project.d.ts.map +0 -1
  293. package/dist/schema/schemas/agentcore-project.js +0 -335
  294. package/dist/schema/schemas/agentcore-project.js.map +0 -1
  295. package/dist/schema/schemas/auth.d.ts +0 -140
  296. package/dist/schema/schemas/auth.d.ts.map +0 -1
  297. package/dist/schema/schemas/auth.js +0 -114
  298. package/dist/schema/schemas/auth.js.map +0 -1
  299. package/dist/schema/schemas/aws-targets.d.ts +0 -71
  300. package/dist/schema/schemas/aws-targets.d.ts.map +0 -1
  301. package/dist/schema/schemas/aws-targets.js +0 -57
  302. package/dist/schema/schemas/aws-targets.js.map +0 -1
  303. package/dist/schema/schemas/deployed-state.d.ts +0 -725
  304. package/dist/schema/schemas/deployed-state.d.ts.map +0 -1
  305. package/dist/schema/schemas/deployed-state.js +0 -218
  306. package/dist/schema/schemas/deployed-state.js.map +0 -1
  307. package/dist/schema/schemas/index.d.ts +0 -9
  308. package/dist/schema/schemas/index.d.ts.map +0 -1
  309. package/dist/schema/schemas/index.js +0 -26
  310. package/dist/schema/schemas/index.js.map +0 -1
  311. package/dist/schema/schemas/mcp-defs.d.ts +0 -52
  312. package/dist/schema/schemas/mcp-defs.d.ts.map +0 -1
  313. package/dist/schema/schemas/mcp-defs.js +0 -50
  314. package/dist/schema/schemas/mcp-defs.js.map +0 -1
  315. package/dist/schema/schemas/mcp.d.ts +0 -820
  316. package/dist/schema/schemas/mcp.d.ts.map +0 -1
  317. package/dist/schema/schemas/mcp.js +0 -564
  318. package/dist/schema/schemas/mcp.js.map +0 -1
  319. package/dist/schema/schemas/primitives/ab-test.d.ts +0 -141
  320. package/dist/schema/schemas/primitives/ab-test.d.ts.map +0 -1
  321. package/dist/schema/schemas/primitives/ab-test.js +0 -97
  322. package/dist/schema/schemas/primitives/ab-test.js.map +0 -1
  323. package/dist/schema/schemas/primitives/config-bundle.d.ts +0 -31
  324. package/dist/schema/schemas/primitives/config-bundle.d.ts.map +0 -1
  325. package/dist/schema/schemas/primitives/config-bundle.js +0 -38
  326. package/dist/schema/schemas/primitives/config-bundle.js.map +0 -1
  327. package/dist/schema/schemas/primitives/evaluator.d.ts +0 -102
  328. package/dist/schema/schemas/primitives/evaluator.d.ts.map +0 -1
  329. package/dist/schema/schemas/primitives/evaluator.js +0 -84
  330. package/dist/schema/schemas/primitives/evaluator.js.map +0 -1
  331. package/dist/schema/schemas/primitives/harness.d.ts +0 -363
  332. package/dist/schema/schemas/primitives/harness.d.ts.map +0 -1
  333. package/dist/schema/schemas/primitives/harness.js +0 -261
  334. package/dist/schema/schemas/primitives/harness.js.map +0 -1
  335. package/dist/schema/schemas/primitives/http-gateway.d.ts +0 -21
  336. package/dist/schema/schemas/primitives/http-gateway.d.ts.map +0 -1
  337. package/dist/schema/schemas/primitives/http-gateway.js +0 -34
  338. package/dist/schema/schemas/primitives/http-gateway.js.map +0 -1
  339. package/dist/schema/schemas/primitives/index.d.ts +0 -15
  340. package/dist/schema/schemas/primitives/index.d.ts.map +0 -1
  341. package/dist/schema/schemas/primitives/index.js +0 -61
  342. package/dist/schema/schemas/primitives/index.js.map +0 -1
  343. package/dist/schema/schemas/primitives/memory.d.ts +0 -51
  344. package/dist/schema/schemas/primitives/memory.d.ts.map +0 -1
  345. package/dist/schema/schemas/primitives/memory.js +0 -73
  346. package/dist/schema/schemas/primitives/memory.js.map +0 -1
  347. package/dist/schema/schemas/primitives/online-eval-config.d.ts +0 -14
  348. package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +0 -1
  349. package/dist/schema/schemas/primitives/online-eval-config.js +0 -30
  350. package/dist/schema/schemas/primitives/online-eval-config.js.map +0 -1
  351. package/dist/schema/schemas/primitives/policy.d.ts +0 -49
  352. package/dist/schema/schemas/primitives/policy.d.ts.map +0 -1
  353. package/dist/schema/schemas/primitives/policy.js +0 -62
  354. package/dist/schema/schemas/primitives/policy.js.map +0 -1
  355. package/dist/schema/schemas/primitives/tags.d.ts +0 -6
  356. package/dist/schema/schemas/primitives/tags.d.ts.map +0 -1
  357. package/dist/schema/schemas/primitives/tags.js +0 -27
  358. package/dist/schema/schemas/primitives/tags.js.map +0 -1
  359. package/dist/schema/schemas/zod-util.d.ts +0 -10
  360. package/dist/schema/schemas/zod-util.d.ts.map +0 -1
  361. package/dist/schema/schemas/zod-util.js +0 -23
  362. package/dist/schema/schemas/zod-util.js.map +0 -1
  363. package/dist/schema/types/index.d.ts +0 -2
  364. package/dist/schema/types/index.d.ts.map +0 -1
  365. package/dist/schema/types/index.js +0 -18
  366. package/dist/schema/types/index.js.map +0 -1
  367. package/dist/schema/types/path.d.ts +0 -27
  368. package/dist/schema/types/path.d.ts.map +0 -1
  369. package/dist/schema/types/path.js +0 -13
  370. package/dist/schema/types/path.js.map +0 -1
  371. package/scripts/bump-version.ts +0 -393
  372. package/scripts/bundle.mjs +0 -219
  373. package/scripts/check-old-cli.lib.mjs +0 -102
  374. package/scripts/check-old-cli.mjs +0 -10
  375. package/scripts/copy-assets.mjs +0 -64
  376. package/scripts/generate-schema.mjs +0 -40
  377. package/scripts/run-e2e-local.sh +0 -112
  378. package/scripts/start-tui-harness.sh +0 -90
  379. /package/dist/{agent-inspector/favicon.svg → assets/agent-inspector/favicon.svg.asset} +0 -0
  380. /package/dist/{agent-inspector/index.html → assets/agent-inspector/index.html.asset} +0 -0
  381. /package/dist/assets/{python/http/strands/base → templates/a2a-python-strands}/gitignore.template +0 -0
  382. /package/dist/assets/{typescript/.gitkeep → templates/a2a-python-strands/memory/__init__.py} +0 -0
  383. /package/dist/assets/{python/a2a/googleadk/base → templates/a2a-python-strands}/model/__init__.py +0 -0
  384. /package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-langchain}/model/__init__.py +0 -0
  385. /package/dist/assets/{container/python → templates/agent-python-strands}/dockerignore.template +0 -0
  386. /package/dist/assets/{python/a2a/strands/base → templates/agent-python-strands}/model/__init__.py +0 -0
  387. /package/dist/assets/{python/a2a/strands/capabilities/memory → templates/agui-python-strands/model}/__init__.py +0 -0
  388. /package/dist/assets/{python/agui/googleadk/base/model → templates/export-harness-python/mcp_client}/__init__.py +0 -0
  389. /package/dist/assets/{python/agui/langchain_langgraph/base → templates/export-harness-python}/model/__init__.py +0 -0
@@ -1,119 +0,0 @@
1
- import type { AgentCoreCliMcpDefs, AgentCoreProjectSpec, AwsDeploymentTarget, DeployedState, HarnessSpec } from '../../../schema';
2
- import { type PathConfig, PathResolver } from './path-resolver';
3
- /** Supported schema versions. Extend this union as new versions are published. */
4
- type SchemaVersion = 1;
5
- export declare function getSchemaUrlForVersion(version: SchemaVersion): string;
6
- /**
7
- * Manages reading, writing, and validation of AgentCore configuration files
8
- */
9
- export declare class ConfigIO {
10
- private readonly pathResolver;
11
- private readonly projectDiscovered;
12
- /**
13
- * Create a ConfigIO instance.
14
- * If no baseDir is provided, automatically discovers the project using findConfigRoot().
15
- */
16
- constructor(pathConfig?: Partial<PathConfig>);
17
- /**
18
- * Check if this ConfigIO is associated with a discovered or explicitly configured project.
19
- * Returns false if no baseDir was provided and no project was found via auto-discovery.
20
- */
21
- hasProject(): boolean;
22
- /**
23
- * Get the current path resolver
24
- */
25
- getPathResolver(): PathResolver;
26
- /**
27
- * Update the base directory for config files
28
- */
29
- setBaseDir(baseDir: string): void;
30
- /**
31
- * Get the project root directory (parent of agentcore/)
32
- */
33
- getProjectRoot(): string;
34
- /**
35
- * Get the config root directory (the agentcore/ directory)
36
- */
37
- getConfigRoot(): string;
38
- /**
39
- * Read and validate the project configuration.
40
- */
41
- readProjectSpec(): Promise<AgentCoreProjectSpec>;
42
- /**
43
- * Write and validate the project configuration file.
44
- */
45
- writeProjectSpec(data: AgentCoreProjectSpec): Promise<void>;
46
- /**
47
- * Read and validate the AWS configuration file.
48
- * Region is preserved as saved. Use resolveAWSDeploymentTargets() for environment/profile overrides.
49
- * TODO: Account is still overridden via AWS_PROFILE — consider moving to resolveAWSDeploymentTargets() for consistency.
50
- */
51
- readAWSDeploymentTargets(): Promise<AwsDeploymentTarget[]>;
52
- /**
53
- * Read AWS deployment targets with region fallback from environment/profile.
54
- * Region precedence: saved value > AWS_REGION > AWS_DEFAULT_REGION > profile config.
55
- * Environment/profile region is only used as a fallback when no region is saved in aws-targets.json.
56
- */
57
- resolveAWSDeploymentTargets(): Promise<AwsDeploymentTarget[]>;
58
- /**
59
- * Resolve a fallback region from environment variables or AWS profile config.
60
- */
61
- private resolveRegionFallback;
62
- /**
63
- * Write and validate the AWS configuration file
64
- */
65
- writeAWSDeploymentTargets(data: AwsDeploymentTarget[]): Promise<void>;
66
- /**
67
- * Read and validate the deployed state file.
68
- * Validates that all target keys exist in aws-targets.
69
- */
70
- readDeployedState(): Promise<DeployedState>;
71
- /**
72
- * Write and validate the deployed state file.
73
- * Validates that all target keys exist in aws-targets.
74
- */
75
- writeDeployedState(data: DeployedState): Promise<void>;
76
- /**
77
- * Read and validate the MCP definitions file
78
- */
79
- readMcpDefs(): Promise<AgentCoreCliMcpDefs>;
80
- /**
81
- * Write and validate the MCP definitions file
82
- */
83
- writeMcpDefs(data: AgentCoreCliMcpDefs): Promise<void>;
84
- /**
85
- * Read and validate a harness specification file
86
- */
87
- readHarnessSpec(harnessName: string): Promise<HarnessSpec>;
88
- /**
89
- * Write and validate a harness specification file
90
- */
91
- writeHarnessSpec(harnessName: string, data: HarnessSpec): Promise<void>;
92
- /**
93
- * Check if the base directory exists
94
- */
95
- baseDirExists(): boolean;
96
- /**
97
- * Check if a specific config file exists
98
- */
99
- configExists(type: 'project' | 'awsTargets' | 'state' | 'mcpDefs'): boolean;
100
- /**
101
- * Initialize the base directory and CLI system subdirectory.
102
- * Requires that a baseDir was explicitly provided or a project was discovered.
103
- */
104
- initializeBaseDir(): Promise<void>;
105
- /**
106
- * Generic read and validate method
107
- */
108
- private readAndValidate;
109
- /**
110
- * Generic validate and write method
111
- */
112
- private validateAndWrite;
113
- }
114
- /**
115
- * Create a new ConfigIO instance
116
- */
117
- export declare function createConfigIO(pathConfig?: Partial<PathConfig>): ConfigIO;
118
- export {};
119
- //# sourceMappingURL=config-io.d.ts.map
@@ -1 +0,0 @@
1
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AC;IASjD;;;OAGG;IACG,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5D;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAKjD;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;OAEG;IACG,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKhE;;OAEG;IACG,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7E;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO;IAU3E;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBxC;;OAEG;YACW,eAAe;IAiC7B;;OAEG;YACW,gBAAgB;CA8B/B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,QAAQ,CAEzE"}
@@ -1,323 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConfigIO = void 0;
4
- exports.getSchemaUrlForVersion = getSchemaUrlForVersion;
5
- exports.createConfigIO = createConfigIO;
6
- const schema_1 = require("../../../schema");
7
- const errors_1 = require("../../errors");
8
- const utils_1 = require("../../utils");
9
- const path_resolver_1 = require("./path-resolver");
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
- function getSchemaUrlForVersion(version) {
15
- return `https://schema.agentcore.aws.dev/v${version}/agentcore.json`;
16
- }
17
- /**
18
- * Manages reading, writing, and validation of AgentCore configuration files
19
- */
20
- class ConfigIO {
21
- pathResolver;
22
- projectDiscovered;
23
- /**
24
- * Create a ConfigIO instance.
25
- * If no baseDir is provided, automatically discovers the project using findConfigRoot().
26
- */
27
- constructor(pathConfig) {
28
- // Track if baseDir was explicitly provided
29
- const baseDirProvided = !!pathConfig?.baseDir;
30
- // Auto-discover config root if no baseDir provided
31
- if (!baseDirProvided) {
32
- const discoveredRoot = (0, path_resolver_1.findConfigRoot)();
33
- if (discoveredRoot) {
34
- pathConfig = { ...pathConfig, baseDir: discoveredRoot };
35
- this.projectDiscovered = true;
36
- }
37
- else {
38
- // No project found and no explicit baseDir - mark as not discovered
39
- this.projectDiscovered = false;
40
- }
41
- }
42
- else {
43
- // baseDir was explicitly provided (e.g., during project creation)
44
- this.projectDiscovered = true;
45
- }
46
- this.pathResolver = new path_resolver_1.PathResolver(pathConfig);
47
- }
48
- /**
49
- * Check if this ConfigIO is associated with a discovered or explicitly configured project.
50
- * Returns false if no baseDir was provided and no project was found via auto-discovery.
51
- */
52
- hasProject() {
53
- return this.projectDiscovered;
54
- }
55
- /**
56
- * Get the current path resolver
57
- */
58
- getPathResolver() {
59
- return this.pathResolver;
60
- }
61
- /**
62
- * Update the base directory for config files
63
- */
64
- setBaseDir(baseDir) {
65
- this.pathResolver.setBaseDir(baseDir);
66
- }
67
- /**
68
- * Get the project root directory (parent of agentcore/)
69
- */
70
- getProjectRoot() {
71
- return this.pathResolver.getProjectRoot();
72
- }
73
- /**
74
- * Get the config root directory (the agentcore/ directory)
75
- */
76
- getConfigRoot() {
77
- return this.pathResolver.getBaseDir();
78
- }
79
- /**
80
- * Read and validate the project configuration.
81
- */
82
- async readProjectSpec() {
83
- const filePath = this.pathResolver.getAgentConfigPath();
84
- return this.readAndValidate(filePath, 'AgentCore Project Config', schema_1.AgentCoreProjectSpecSchema);
85
- }
86
- /**
87
- * Write and validate the project configuration file.
88
- */
89
- async writeProjectSpec(data) {
90
- const filePath = this.pathResolver.getAgentConfigPath();
91
- // TODO: extend this to all resource arrays so empty defaults never pollute agentcore.json
92
- const cleaned = { ...data };
93
- if (cleaned.configBundles?.length === 0)
94
- delete cleaned.configBundles;
95
- if (cleaned.abTests?.length === 0)
96
- delete cleaned.abTests;
97
- if (cleaned.httpGateways?.length === 0)
98
- delete cleaned.httpGateways;
99
- await this.validateAndWrite(filePath, 'AgentCore Project Config', schema_1.AgentCoreProjectSpecSchema, cleaned);
100
- }
101
- /**
102
- * Read and validate the AWS configuration file.
103
- * Region is preserved as saved. Use resolveAWSDeploymentTargets() for environment/profile overrides.
104
- * TODO: Account is still overridden via AWS_PROFILE — consider moving to resolveAWSDeploymentTargets() for consistency.
105
- */
106
- async readAWSDeploymentTargets() {
107
- const filePath = this.pathResolver.getAWSTargetsConfigPath();
108
- let targets = await this.readAndValidate(filePath, 'AWS Targets', schema_1.AwsDeploymentTargetsSchema);
109
- // Override account from credentials if AWS_PROFILE is set
110
- if (process.env.AWS_PROFILE) {
111
- const account = await (0, utils_1.detectAwsAccount)();
112
- if (account) {
113
- targets = targets.map(t => ({ ...t, account }));
114
- }
115
- }
116
- return targets;
117
- }
118
- /**
119
- * Read AWS deployment targets with region fallback from environment/profile.
120
- * Region precedence: saved value > AWS_REGION > AWS_DEFAULT_REGION > profile config.
121
- * Environment/profile region is only used as a fallback when no region is saved in aws-targets.json.
122
- */
123
- async resolveAWSDeploymentTargets() {
124
- const targets = await this.readAWSDeploymentTargets();
125
- // Only resolve region for targets that don't already have one saved
126
- const fallbackRegion = await this.resolveRegionFallback();
127
- if (!fallbackRegion) {
128
- return targets;
129
- }
130
- return targets.map(t => (t.region ? t : { ...t, region: fallbackRegion }));
131
- }
132
- /**
133
- * Resolve a fallback region from environment variables or AWS profile config.
134
- */
135
- async resolveRegionFallback() {
136
- // Check env vars first
137
- const envRegion = process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION;
138
- if (envRegion && schema_1.AgentCoreRegionSchema.safeParse(envRegion).success) {
139
- return envRegion;
140
- }
141
- // Check profile config
142
- try {
143
- const profile = process.env.AWS_PROFILE ?? 'default';
144
- const config = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)();
145
- const profileRegion = config.configFile?.[profile]?.region;
146
- if (profileRegion && schema_1.AgentCoreRegionSchema.safeParse(profileRegion).success) {
147
- return profileRegion;
148
- }
149
- }
150
- catch {
151
- // Config file not available
152
- }
153
- return undefined;
154
- }
155
- /**
156
- * Write and validate the AWS configuration file
157
- */
158
- async writeAWSDeploymentTargets(data) {
159
- const filePath = this.pathResolver.getAWSTargetsConfigPath();
160
- await this.validateAndWrite(filePath, 'AWS Targets', schema_1.AwsDeploymentTargetsSchema, data);
161
- }
162
- /**
163
- * Read and validate the deployed state file.
164
- * Validates that all target keys exist in aws-targets.
165
- */
166
- async readDeployedState() {
167
- const targets = await this.readAWSDeploymentTargets();
168
- const targetNames = targets.map(t => t.name);
169
- const schema = (0, schema_1.createValidatedDeployedStateSchema)(targetNames);
170
- const filePath = this.pathResolver.getStatePath();
171
- return this.readAndValidate(filePath, 'State', schema);
172
- }
173
- /**
174
- * Write and validate the deployed state file.
175
- * Validates that all target keys exist in aws-targets.
176
- */
177
- async writeDeployedState(data) {
178
- const targets = await this.readAWSDeploymentTargets();
179
- const targetNames = targets.map(t => t.name);
180
- const schema = (0, schema_1.createValidatedDeployedStateSchema)(targetNames);
181
- const filePath = this.pathResolver.getStatePath();
182
- await this.validateAndWrite(filePath, 'State', schema, data);
183
- }
184
- /**
185
- * Read and validate the MCP definitions file
186
- */
187
- async readMcpDefs() {
188
- const filePath = this.pathResolver.getMcpDefsPath();
189
- return this.readAndValidate(filePath, 'MCP Definitions', schema_1.AgentCoreCliMcpDefsSchema);
190
- }
191
- /**
192
- * Write and validate the MCP definitions file
193
- */
194
- async writeMcpDefs(data) {
195
- const filePath = this.pathResolver.getMcpDefsPath();
196
- await this.validateAndWrite(filePath, 'MCP Definitions', schema_1.AgentCoreCliMcpDefsSchema, data);
197
- }
198
- /**
199
- * Read and validate a harness specification file
200
- */
201
- async readHarnessSpec(harnessName) {
202
- const filePath = this.pathResolver.getHarnessConfigPath(harnessName);
203
- return this.readAndValidate(filePath, 'Harness Spec', schema_1.HarnessSpecSchema);
204
- }
205
- /**
206
- * Write and validate a harness specification file
207
- */
208
- async writeHarnessSpec(harnessName, data) {
209
- const filePath = this.pathResolver.getHarnessConfigPath(harnessName);
210
- await this.validateAndWrite(filePath, 'Harness Spec', schema_1.HarnessSpecSchema, data);
211
- }
212
- /**
213
- * Check if the base directory exists
214
- */
215
- baseDirExists() {
216
- return (0, fs_1.existsSync)(this.pathResolver.getBaseDir());
217
- }
218
- /**
219
- * Check if a specific config file exists
220
- */
221
- configExists(type) {
222
- const pathMap = {
223
- project: this.pathResolver.getAgentConfigPath(),
224
- awsTargets: this.pathResolver.getAWSTargetsConfigPath(),
225
- state: this.pathResolver.getStatePath(),
226
- mcpDefs: this.pathResolver.getMcpDefsPath(),
227
- };
228
- return (0, fs_1.existsSync)(pathMap[type]);
229
- }
230
- /**
231
- * Initialize the base directory and CLI system subdirectory.
232
- * Requires that a baseDir was explicitly provided or a project was discovered.
233
- */
234
- async initializeBaseDir() {
235
- // Prevent creating directories when no project was configured
236
- if (!this.projectDiscovered) {
237
- throw new path_resolver_1.NoProjectError();
238
- }
239
- const baseDir = this.pathResolver.getBaseDir();
240
- const cliSystemDir = this.pathResolver.getCliSystemDir();
241
- try {
242
- await (0, promises_1.mkdir)(baseDir, { recursive: true });
243
- await (0, promises_1.mkdir)(cliSystemDir, { recursive: true });
244
- }
245
- catch (err) {
246
- const normalizedError = err instanceof Error ? err : new Error('Unknown error');
247
- throw new errors_1.ConfigWriteError(baseDir, normalizedError);
248
- }
249
- }
250
- /**
251
- * Generic read and validate method
252
- */
253
- async readAndValidate(filePath, fileType, schema) {
254
- // Check if file exists
255
- if (!(0, fs_1.existsSync)(filePath)) {
256
- throw new errors_1.ConfigNotFoundError(filePath, fileType);
257
- }
258
- // Read file
259
- let fileContent;
260
- try {
261
- fileContent = await (0, promises_1.readFile)(filePath, 'utf-8');
262
- }
263
- catch (err) {
264
- const normalizedError = err instanceof Error ? err : new Error('Unknown error');
265
- throw new errors_1.ConfigReadError(filePath, normalizedError);
266
- }
267
- // Parse JSON
268
- let parsed;
269
- try {
270
- parsed = JSON.parse(fileContent);
271
- }
272
- catch (err) {
273
- const normalizedError = err instanceof Error ? err : new Error('Invalid JSON');
274
- throw new errors_1.ConfigParseError(filePath, normalizedError);
275
- }
276
- // Validate with Zod schema
277
- const result = schema.safeParse(parsed);
278
- if (!result.success) {
279
- throw new errors_1.ConfigValidationError(filePath, fileType, result.error);
280
- }
281
- return result.data;
282
- }
283
- /**
284
- * Generic validate and write method
285
- */
286
- async validateAndWrite(filePath, fileType, schema, data) {
287
- // Prevent writing to non-existent projects
288
- if (!this.projectDiscovered) {
289
- throw new path_resolver_1.NoProjectError();
290
- }
291
- // Validate data with Zod schema
292
- const result = schema.safeParse(data);
293
- if (!result.success) {
294
- throw new errors_1.ConfigValidationError(filePath, fileType, result.error);
295
- }
296
- // Ensure directory exists
297
- const dir = (0, path_1.dirname)(filePath);
298
- try {
299
- await (0, promises_1.mkdir)(dir, { recursive: true });
300
- }
301
- catch (err) {
302
- const normalizedError = err instanceof Error ? err : new Error('Unknown error');
303
- throw new errors_1.ConfigWriteError(filePath, normalizedError);
304
- }
305
- // Write file with pretty formatting
306
- try {
307
- const jsonContent = JSON.stringify(result.data, null, 2);
308
- await (0, promises_1.writeFile)(filePath, jsonContent, 'utf-8');
309
- }
310
- catch (err) {
311
- const normalizedError = err instanceof Error ? err : new Error('Unknown error');
312
- throw new errors_1.ConfigWriteError(filePath, normalizedError);
313
- }
314
- }
315
- }
316
- exports.ConfigIO = ConfigIO;
317
- /**
318
- * Create a new ConfigIO instance
319
- */
320
- function createConfigIO(pathConfig) {
321
- return new ConfigIO(pathConfig);
322
- }
323
- //# sourceMappingURL=config-io.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-io.js","sourceRoot":"","sources":["../../../../src/lib/schem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- export declare const GLOBAL_CONFIG_DIR: string;
3
- export declare const GLOBAL_CONFIG_FILE: string;
4
- declare const GlobalConfigSchema: z.ZodObject<{
5
- installationId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
6
- uvDefaultIndex: z.ZodCatch<z.ZodOptional<z.ZodString>>;
7
- uvIndex: z.ZodCatch<z.ZodOptional<z.ZodString>>;
8
- disableTransactionSearch: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
9
- transactionSearchIndexPercentage: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
10
- telemetry: z.ZodCatch<z.ZodOptional<z.ZodObject<{
11
- enabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
12
- endpoint: z.ZodCatch<z.ZodOptional<z.ZodString>>;
13
- audit: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
14
- }, z.core.$strip>>>;
15
- }, z.core.$loose>;
16
- export type GlobalConfig = z.infer<typeof GlobalConfigSchema>;
17
- export declare function readGlobalConfig(configFile?: string): Promise<GlobalConfig>;
18
- export declare function readGlobalConfigSync(configFile?: string): GlobalConfig;
19
- export declare function updateGlobalConfig(partial: GlobalConfig, configDir?: string, configFile?: string): Promise<boolean>;
20
- /**
21
- * Returns the installationId, generating one if it doesn't exist yet.
22
- * `created: true` means this is the first run (ID was just generated).
23
- *
24
- * Note: concurrent first-run invocations may each generate a different ID;
25
- * the last write wins. This is acceptable — the ID only needs to be stable
26
- * after the first successful write, and CLI invocations are typically sequential.
27
- */
28
- export declare function getOrCreateInstallationId(configDir?: string, configFile?: string): Promise<{
29
- id: string;
30
- created: boolean;
31
- }>;
32
- export {};
33
- //# sourceMappingURL=global-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/schemas/io/global-config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB,QAAoE,CAAC;AACnG,eAAO,MAAM,kBAAkB,QAAyC,CAAC;AAEzE,QAAA,MAAM,kBAAkB;;;;;;;;;;;iBAgBR,CAAC;AAEjB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,wBAAsB,gBAAgB,CAAC,UAAU,SAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,CAO7F;AAED,wBAAgB,oBAAoB,CAAC,UAAU,SAAqB,GAAG,YAAY,CAOlF;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,YAAY,EACrB,SAAS,SAAoB,EAC7B,UAAU,SAAqB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAWlB;AAYD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,SAAoB,EAC7B,UAAU,SAAqB,GAC9B,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAQ3C"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GLOBAL_CONFIG_FILE = exports.GLOBAL_CONFIG_DIR = void 0;
4
- exports.readGlobalConfig = readGlobalConfig;
5
- exports.readGlobalConfigSync = readGlobalConfigSync;
6
- exports.updateGlobalConfig = updateGlobalConfig;
7
- exports.getOrCreateInstallationId = getOrCreateInstallationId;
8
- const fs_1 = require("fs");
9
- const promises_1 = require("fs/promises");
10
- const node_crypto_1 = require("node:crypto");
11
- const os_1 = require("os");
12
- const path_1 = require("path");
13
- const zod_1 = require("zod");
14
- exports.GLOBAL_CONFIG_DIR = process.env.AGENTCORE_CONFIG_DIR ?? (0, path_1.join)((0, os_1.homedir)(), '.agentcore');
15
- exports.GLOBAL_CONFIG_FILE = (0, path_1.join)(exports.GLOBAL_CONFIG_DIR, 'config.json');
16
- const GlobalConfigSchema = zod_1.z
17
- .object({
18
- installationId: zod_1.z.string().optional().catch(undefined),
19
- uvDefaultIndex: zod_1.z.string().optional().catch(undefined),
20
- uvIndex: zod_1.z.string().optional().catch(undefined),
21
- disableTransactionSearch: zod_1.z.boolean().optional().catch(undefined),
22
- transactionSearchIndexPercentage: zod_1.z.number().int().min(0).max(100).optional().catch(undefined),
23
- telemetry: zod_1.z
24
- .object({
25
- enabled: zod_1.z.boolean().optional().catch(undefined),
26
- endpoint: zod_1.z.string().optional().catch(undefined),
27
- audit: zod_1.z.boolean().optional().catch(undefined),
28
- })
29
- .optional()
30
- .catch(undefined),
31
- })
32
- .passthrough();
33
- async function readGlobalConfig(configFile = exports.GLOBAL_CONFIG_FILE) {
34
- try {
35
- const data = await (0, promises_1.readFile)(configFile, 'utf-8');
36
- return GlobalConfigSchema.parse(JSON.parse(data));
37
- }
38
- catch {
39
- return {};
40
- }
41
- }
42
- function readGlobalConfigSync(configFile = exports.GLOBAL_CONFIG_FILE) {
43
- try {
44
- const data = (0, fs_1.readFileSync)(configFile, 'utf-8');
45
- return GlobalConfigSchema.parse(JSON.parse(data));
46
- }
47
- catch {
48
- return {};
49
- }
50
- }
51
- async function updateGlobalConfig(partial, configDir = exports.GLOBAL_CONFIG_DIR, configFile = exports.GLOBAL_CONFIG_FILE) {
52
- try {
53
- const existing = await readGlobalConfig(configFile);
54
- const merged = mergeConfig(existing, partial);
55
- await (0, promises_1.mkdir)(configDir, { recursive: true });
56
- await (0, promises_1.writeFile)(configFile, JSON.stringify(merged, null, 2), 'utf-8');
57
- return true;
58
- }
59
- catch {
60
- return false;
61
- }
62
- }
63
- function mergeConfig(target, source) {
64
- return {
65
- ...target,
66
- ...source,
67
- ...(source.telemetry !== undefined && {
68
- telemetry: { ...target.telemetry, ...source.telemetry },
69
- }),
70
- };
71
- }
72
- /**
73
- * Returns the installationId, generating one if it doesn't exist yet.
74
- * `created: true` means this is the first run (ID was just generated).
75
- *
76
- * Note: concurrent first-run invocations may each generate a different ID;
77
- * the last write wins. This is acceptable — the ID only needs to be stable
78
- * after the first successful write, and CLI invocations are typically sequential.
79
- */
80
- async function getOrCreateInstallationId(configDir = exports.GLOBAL_CONFIG_DIR, configFile = exports.GLOBAL_CONFIG_FILE) {
81
- const config = await readGlobalConfig(configFile);
82
- if (config.installationId) {
83
- return { id: config.installationId, created: false };
84
- }
85
- const id = (0, node_crypto_1.randomUUID)();
86
- await updateGlobalConfig({ installationId: id }, configDir, configFile);
87
- return { id, created: true };
88
- }
89
- //# sourceMappingURL=global-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global-config.js","sourceRoot":"","sources":["../../../../src/lib/schemas/io/global-config.ts"],"names":[],"mappings":";;;AA8BA,4CAOC;AAED,oDAOC;AAED,gDAeC;AAoBD,8DAWC;AA9FD,2BAAkC;AAClC,0CAAyD;AACzD,6CAAyC;AACzC,2BAA6B;AAC7B,+BAA4B;AAC5B,6BAAwB;AAEX,QAAA,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,YAAY,CAAC,CAAC;AACtF,QAAA,kBAAkB,GAAG,IAAA,WAAI,EAAC,yBAAiB,EAAE,aAAa,CAAC,CAAC;AAEzE,MAAM,kBAAkB,GAAG,OAAC;KACzB,MAAM,CAAC;IACN,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IACtD,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IACtD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IAC/C,wBAAwB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IACjE,gCAAgC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,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@@
1
- export { PathResolver, DEFAULT_PATH_CONFIG, findConfigRoot, findProjectRoot, setSessionProjectRoot, getSessionProjectRoot, getWorkingDirectory, requireConfigRoot, NoProjectError, type PathConfig, } from './path-resolver';
2
- export { ConfigIO, createConfigIO, getSchemaUrlForVersion } from './config-io';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSchemaUrlForVersion = 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
- Object.defineProperty(exports, "getSchemaUrlForVersion", { enumerable: true, get: function () { return config_io_1.getSchemaUrlForVersion; } });
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,yCAA+E;AAAtE,qGAAA,QAAQ,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,mHAAA,sBAAsB,OAAA"}