Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ test('AgentCoreStack synthesizes with empty spec', () => {
spec: {
name: 'testproject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
1 change: 1 addition & 0 deletions src/assets/cdk/test/cdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test('AgentCoreStack synthesizes with empty spec', () => {
spec: {
name: 'testproject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
1 change: 1 addition & 0 deletions src/cli/commands/create/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function createDefaultProjectSpec(projectName: string): AgentCoreProjectSpec {
return {
name: projectName,
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
4 changes: 4 additions & 0 deletions src/cli/commands/logs/__tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('resolveAgentContext', () => {
project: {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime' as const,
Expand Down Expand Up @@ -96,6 +97,7 @@ describe('resolveAgentContext', () => {
project: {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime' as const,
Expand Down Expand Up @@ -138,6 +140,7 @@ describe('resolveAgentContext', () => {
project: {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime' as const,
Expand Down Expand Up @@ -207,6 +210,7 @@ describe('resolveAgentContext', () => {
project: {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
1 change: 1 addition & 0 deletions src/cli/commands/remove/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function handleRemoveAll(_options: RemoveAllOptions): Promise<RemoveResult
await configIO.writeProjectSpec({
name: projectName,
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
1 change: 1 addition & 0 deletions src/cli/commands/status/__tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ vi.mock('../../../logging', () => {
const baseProject: AgentCoreProjectSpec = {
name: 'test-project',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
10 changes: 5 additions & 5 deletions src/cli/commands/validate/__tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('handleValidate', () => {

it('returns success when all configs are valid', async () => {
mockFindConfigRoot.mockReturnValue('/project/agentcore');
mockReadProjectSpec.mockResolvedValue({ name: 'Test', agents: [] });
mockReadProjectSpec.mockResolvedValue({ name: 'Test', version: 1, managedBy: 'CDK' as const, agents: [] });
mockReadAWSDeploymentTargets.mockResolvedValue([]);
mockConfigExists.mockReturnValue(false);

Expand All @@ -100,7 +100,7 @@ describe('handleValidate', () => {

it('returns error when AWS targets fails', async () => {
mockFindConfigRoot.mockReturnValue('/project/agentcore');
mockReadProjectSpec.mockResolvedValue({ name: 'Test', agents: [] });
mockReadProjectSpec.mockResolvedValue({ name: 'Test', version: 1, managedBy: 'CDK' as const, agents: [] });
mockReadAWSDeploymentTargets.mockRejectedValue(new Error('bad targets'));

const result = await handleValidate({});
Expand All @@ -111,7 +111,7 @@ describe('handleValidate', () => {

it('validates state file when it exists', async () => {
mockFindConfigRoot.mockReturnValue('/project/agentcore');
mockReadProjectSpec.mockResolvedValue({ name: 'Test', agents: [] });
mockReadProjectSpec.mockResolvedValue({ name: 'Test', version: 1, managedBy: 'CDK' as const, agents: [] });
mockReadAWSDeploymentTargets.mockResolvedValue([]);
mockConfigExists.mockReturnValue(true);
mockReadDeployedState.mockResolvedValue({ targets: {} });
Expand All @@ -124,7 +124,7 @@ describe('handleValidate', () => {

it('returns error when state file is invalid', async () => {
mockFindConfigRoot.mockReturnValue('/project/agentcore');
mockReadProjectSpec.mockResolvedValue({ name: 'Test', agents: [] });
mockReadProjectSpec.mockResolvedValue({ name: 'Test', version: 1, managedBy: 'CDK' as const, agents: [] });
mockReadAWSDeploymentTargets.mockResolvedValue([]);
mockConfigExists.mockReturnValue(true);
mockReadDeployedState.mockRejectedValue(new Error('bad state'));
Expand All @@ -137,7 +137,7 @@ describe('handleValidate', () => {

it('uses custom directory when provided', async () => {
mockFindConfigRoot.mockReturnValue('/custom/agentcore');
mockReadProjectSpec.mockResolvedValue({ name: 'Test', agents: [] });
mockReadProjectSpec.mockResolvedValue({ name: 'Test', version: 1, managedBy: 'CDK' as const, agents: [] });
mockReadAWSDeploymentTargets.mockResolvedValue([]);
mockConfigExists.mockReturnValue(false);

Expand Down
10 changes: 10 additions & 0 deletions src/cli/external-requirements/__tests__/checks-extended.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('requiresUv', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand All @@ -61,6 +62,7 @@ describe('requiresUv', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand All @@ -86,6 +88,7 @@ describe('requiresUv', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -103,6 +106,7 @@ describe('requiresContainerRuntime', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand All @@ -128,6 +132,7 @@ describe('requiresContainerRuntime', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand All @@ -153,6 +158,7 @@ describe('requiresContainerRuntime', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -168,6 +174,7 @@ describe('requiresContainerRuntime', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -253,6 +260,7 @@ describe('checkDependencyVersions', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -272,6 +280,7 @@ describe('checkDependencyVersions', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -290,6 +299,7 @@ describe('checkDependencyVersions', () => {
const project: AgentCoreProjectSpec = {
name: 'Test',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('writeAgentToProject with credentialStrategy', () => {
const baseProject = {
name: 'MyProject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function writeAgentToProject(config: GenerateConfig, options?: Writ
const project: AgentCoreProjectSpec = {
name: agentName,
version: SCHEMA_VERSION,
managedBy: 'CDK' as const,
agents: [agent],
memories,
credentials,
Expand Down
20 changes: 20 additions & 0 deletions src/cli/operations/dev/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -30,6 +31,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -57,6 +59,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -90,6 +93,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -118,6 +122,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand All @@ -144,6 +149,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -173,6 +179,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -202,6 +209,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -231,6 +239,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -260,6 +269,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -287,6 +297,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -315,6 +326,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -343,6 +355,7 @@ describe('getDevConfig', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -377,6 +390,7 @@ describe('getAgentPort', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -413,6 +427,7 @@ describe('getAgentPort', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -435,6 +450,7 @@ describe('getDevSupportedAgents', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [],
memories: [],
credentials: [],
Expand All @@ -451,6 +467,7 @@ describe('getDevSupportedAgents', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand All @@ -477,6 +494,7 @@ describe('getDevSupportedAgents', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -514,6 +532,7 @@ describe('getDevSupportedAgents', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down Expand Up @@ -542,6 +561,7 @@ describe('getDevSupportedAgents', () => {
const project: AgentCoreProjectSpec = {
name: 'TestProject',
version: 1,
managedBy: 'CDK' as const,
agents: [
{
type: 'AgentCoreRuntime',
Expand Down
Loading
Loading