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
2 changes: 1 addition & 1 deletion integ-tests/add-agent-auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('integration: add BYO agent with CUSTOM_JWT auth', () => {
// Verify OAuth credential was auto-created
const oauthCred = config.credentials.find(c => c.name === `${agent2}-oauth`);
expect(oauthCred, 'OAuth credential should be auto-created').toBeTruthy();
expect(oauthCred!.type).toBe('OAuthCredentialProvider');
expect(oauthCred!.authorizerType).toBe('OAuthCredentialProvider');
expect((oauthCred as { managed?: boolean }).managed).toBe(true);

// Verify .env.local has client secrets (namespaced per credential)
Expand Down
88 changes: 53 additions & 35 deletions schemas/agentcore.schema.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "AgentCoreRuntime"
},
"name": {
"type": "string",
"minLength": 1,
Expand Down Expand Up @@ -134,10 +130,6 @@
},
"additionalProperties": false
},
"modelProvider": {
"type": "string",
"enum": ["Bedrock", "Gemini", "OpenAI", "Anthropic"]
},
"protocol": {
"type": "string",
"enum": ["HTTP", "MCP", "A2A"]
Expand Down Expand Up @@ -277,7 +269,7 @@
"additionalProperties": false
}
},
"required": ["type", "name", "build", "entrypoint", "codeLocation", "runtimeVersion"],
"required": ["name", "build", "entrypoint", "codeLocation", "runtimeVersion"],
"additionalProperties": false
}
},
Expand All @@ -287,10 +279,6 @@
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "AgentCoreMemory"
},
"name": {
"type": "string",
"minLength": 1,
Expand All @@ -310,7 +298,7 @@
"properties": {
"type": {
"type": "string",
"enum": ["SEMANTIC", "SUMMARIZATION", "USER_PREFERENCE", "EPISODIC"]
"enum": ["SEMANTIC", "SUMMARIZATION", "USER_PREFERENCE", "EPISODIC", "CUSTOM"]
},
"name": {
"type": "string",
Expand All @@ -332,6 +320,44 @@
"items": {
"type": "string"
}
},
"semanticOverride": {
"type": "object",
"properties": {
"extraction": {
"type": "object",
"properties": {
"appendToPrompt": {
"type": "string",
"minLength": 1,
"maxLength": 30000
},
"modelId": {
"type": "string",
"minLength": 1
Comment thread
jesseturner21 marked this conversation as resolved.
}
},
"required": ["appendToPrompt", "modelId"],
"additionalProperties": false
},
"consolidation": {
"type": "object",
"properties": {
"appendToPrompt": {
"type": "string",
"minLength": 1,
"maxLength": 30000
},
"modelId": {
"type": "string",
"minLength": 1
}
},
"required": ["appendToPrompt", "modelId"],
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"required": ["type"],
Expand All @@ -353,7 +379,7 @@
}
}
},
"required": ["type", "name", "eventExpiryDuration"],
"required": ["name", "eventExpiryDuration"],
"additionalProperties": false
}
},
Expand All @@ -365,32 +391,32 @@
{
"type": "object",
"properties": {
"type": {
"authorizerType": {
"type": "string",
"const": "ApiKeyCredentialProvider"
},
"name": {
"type": "string",
"minLength": 3,
"maxLength": 255,
"pattern": "^[A-Za-z0-9_.-]+$"
"minLength": 1,
"maxLength": 128,
"pattern": "^[a-zA-Z0-9\\-_]+$"
Comment thread
jesseturner21 marked this conversation as resolved.
}
},
"required": ["type", "name"],
"required": ["authorizerType", "name"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"authorizerType": {
"type": "string",
"const": "OAuthCredentialProvider"
},
"name": {
"type": "string",
"minLength": 3,
"maxLength": 255,
"pattern": "^[A-Za-z0-9_.-]+$"
"minLength": 1,
"maxLength": 128,
"pattern": "^[a-zA-Z0-9\\-_]+$"
},
"discoveryUrl": {
"type": "string",
Expand All @@ -414,7 +440,7 @@
"enum": ["inbound", "outbound"]
}
},
"required": ["type", "name"],
"required": ["authorizerType", "name"],
"additionalProperties": false
}
]
Expand All @@ -426,10 +452,6 @@
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "CustomEvaluator"
},
"name": {
"type": "string",
"minLength": 1,
Expand Down Expand Up @@ -527,7 +549,7 @@
}
}
},
"required": ["type", "name", "level", "config"],
"required": ["name", "level", "config"],
"additionalProperties": false
}
},
Expand All @@ -537,10 +559,6 @@
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "OnlineEvaluationConfig"
},
"name": {
"type": "string",
"minLength": 1,
Expand Down Expand Up @@ -586,7 +604,7 @@
}
}
},
"required": ["type", "name", "agent", "evaluators", "samplingRate"],
"required": ["name", "agent", "evaluators", "samplingRate"],
"additionalProperties": false
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/add/__tests__/add-gateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('add gateway command', () => {
// Verify managed OAuth credential in agentcore.json
const credential = projectSpec.credentials.find((c: { name: string }) => c.name === `${gatewayName}-oauth`);
expect(credential, 'Managed OAuth credential should exist').toBeTruthy();
expect(credential.type).toBe('OAuthCredentialProvider');
expect(credential.authorizerType).toBe('OAuthCredentialProvider');
expect(credential.managed).toBe(true);
expect(credential.usage).toBe('inbound');
});
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/add/__tests__/add-identity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('add credential command', () => {
const projectSpec = JSON.parse(await readFile(join(projectDir, 'agentcore/agentcore.json'), 'utf-8'));
const credential = projectSpec.credentials.find((c: { name: string }) => c.name === identityName);
expect(credential, 'Credential should be in project credentials').toBeTruthy();
expect(credential.type).toBe('ApiKeyCredentialProvider');
expect(credential.authorizerType).toBe('ApiKeyCredentialProvider');
});
});

Expand Down Expand Up @@ -98,7 +98,7 @@ describe('add credential command', () => {
const projectSpec = JSON.parse(await readFile(join(projectDir, 'agentcore/agentcore.json'), 'utf-8'));
const credential = projectSpec.credentials.find((c: { name: string }) => c.name === identityName);
expect(credential, 'Credential should be in project credentials').toBeTruthy();
expect(credential.type).toBe('OAuthCredentialProvider');
expect(credential.authorizerType).toBe('OAuthCredentialProvider');
expect(credential.discoveryUrl).toBe('https://idp.example.com/.well-known/openid-configuration');
expect(credential.vendor).toBe('CustomOauth2');
expect(credential.scopes).toEqual(['read', 'write']);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/add/__tests__/add-memory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('add memory command', () => {
const projectSpec = JSON.parse(await readFile(join(projectDir, 'agentcore/agentcore.json'), 'utf-8'));
const memory = projectSpec.memories.find((m: { name: string }) => m.name === memoryName);
expect(memory, 'Memory should be in project memories').toBeTruthy();
expect(memory.type).toBe('AgentCoreMemory');
expect(memory).toBeTruthy();
});

it('creates memory with multiple strategies', async () => {
Expand Down
8 changes: 1 addition & 7 deletions src/cli/commands/dev/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ export const registerDev = (program: Command) => {
if (protocol === 'A2A') invokePort = 9000;
else if (protocol === 'MCP') invokePort = 8000;

// Show model info if available (not applicable to MCP)
if (protocol !== 'MCP' && targetAgent?.modelProvider) {
console.log(`Provider: ${targetAgent.modelProvider}`);
}

// Protocol-aware dispatch
if (protocol === 'MCP') {
await handleMcpInvoke(invokePort, opts.invoke, opts.tool, opts.input, headers);
Expand Down Expand Up @@ -270,8 +265,7 @@ export const registerDev = (program: Command) => {
}

// Get provider info from agent config
const targetAgent = project.agents.find(a => a.name === config.agentName);
const providerInfo = targetAgent?.modelProvider ?? '(see agent code)';
const providerInfo = '(see agent code)';

console.log(`Starting dev server...`);
console.log(`Agent: ${config.agentName}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": 1,
"agents": [
{
"type": "AgentCoreRuntime",
"name": "existing_agent",
"build": "CodeZip",
"entrypoint": "main.py",
Expand All @@ -18,7 +17,6 @@
],
"memories": [
{
"type": "AgentCoreMemory",
"name": "existing_agent_memory",
"eventExpiryDuration": 30,
"strategies": [
Expand All @@ -30,7 +28,7 @@
],
"credentials": [
{
"type": "ApiKeyCredentialProvider",
"authorizerType": "ApiKeyCredentialProvider",
"name": "my_api_key"
}
],
Expand Down
4 changes: 1 addition & 3 deletions src/cli/commands/import/__tests__/idempotency.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ function makeProjectSpec(agents: { name: string }[] = [], memories: { name: stri
name: 'TestProject',
version: 1,
agents: agents.map(a => ({
type: 'AgentCoreRuntime',
name: a.name,
build: 'CodeZip',
entrypoint: 'main.py',
Expand All @@ -187,7 +186,6 @@ function makeProjectSpec(agents: { name: string }[] = [], memories: { name: stri
instrumentation: { enableOtel: true },
})),
memories: memories.map(m => ({
type: 'AgentCoreMemory',
name: m.name,
eventExpiryDuration: 30,
strategies: [{ type: 'SEMANTIC' }],
Expand Down Expand Up @@ -529,7 +527,7 @@ describe('Import Idempotency (Test Group 7)', () => {
);

const existingSpec = makeProjectSpec();
(existingSpec as any).credentials = [{ type: 'ApiKeyCredentialProvider', name: 'my-cred' }];
(existingSpec as any).credentials = [{ authorizerType: 'ApiKeyCredentialProvider', name: 'my-cred' }];
mockConfigIOInstance.readProjectSpec.mockResolvedValue(existingSpec);

const progressMessages: string[] = [];
Expand Down
4 changes: 0 additions & 4 deletions src/cli/commands/import/__tests__/import-memory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function toMemorySpec(mem: ParsedStarterToolkitMemory): Memory {
}

return {
type: 'AgentCoreMemory',
name: mem.name,
eventExpiryDuration: Math.max(7, Math.min(365, mem.eventExpiryDays)),
strategies,
Expand Down Expand Up @@ -367,7 +366,6 @@ describe('toMemorySpec', () => {

const result = toMemorySpec(mem);

expect(result.type).toBe('AgentCoreMemory');
expect(result.name).toBe('test_memory');
expect(result.eventExpiryDuration).toBe(30);
expect(result.strategies).toHaveLength(3);
Expand All @@ -384,7 +382,6 @@ describe('toMemorySpec', () => {

const result = toMemorySpec(mem);

expect(result.type).toBe('AgentCoreMemory');
expect(result.name).toBe('stm_memory');
expect(result.eventExpiryDuration).toBe(14);
expect(result.strategies).toHaveLength(0);
Expand Down Expand Up @@ -505,7 +502,6 @@ describe('Memory Merge Logic', () => {
it('skips existing memories by name', () => {
const existingMemories: Memory[] = [
{
type: 'AgentCoreMemory',
name: 'existing_memory',
eventExpiryDuration: 30,
strategies: [{ type: 'SEMANTIC' }],
Expand Down
1 change: 0 additions & 1 deletion src/cli/commands/import/__tests__/import-no-deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ agents:
const writtenSpec = mockWriteProjectSpec.mock.calls[0]![0];
expect(writtenSpec.memories).toHaveLength(1);
expect(writtenSpec.memories[0].name).toBe('test_agent_memory');
expect(writtenSpec.memories[0].type).toBe('AgentCoreMemory');
});

it('does NOT call CDK build/synth operations', async () => {
Expand Down
6 changes: 2 additions & 4 deletions src/cli/commands/import/__tests__/merge-logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function toAgentEnvSpec(agent: ParsedStarterToolkitConfig['agents'][0]): AgentEn
const codeLocation = path.join(APP_DIR, agent.name);
const entrypoint = path.basename(agent.entrypoint);
const spec: AgentEnvSpec = {
type: 'AgentCoreRuntime',
name: agent.name,
build: agent.build,
entrypoint: entrypoint as AgentEnvSpec['entrypoint'],
Expand All @@ -39,15 +38,14 @@ function toMemorySpec(mem: ParsedStarterToolkitConfig['memories'][0]): Memory {
strategies.push({ type: 'USER_PREFERENCE' });
}
return {
type: 'AgentCoreMemory',
name: mem.name,
eventExpiryDuration: Math.max(7, Math.min(365, mem.eventExpiryDays)),
strategies,
};
}

function toCredentialSpec(cred: ParsedStarterToolkitConfig['credentials'][0]): Credential {
return { type: 'ApiKeyCredentialProvider', name: cred.name };
return { authorizerType: 'ApiKeyCredentialProvider', name: cred.name };
}

function simulateMerge(
Expand Down Expand Up @@ -159,7 +157,7 @@ describe('merge: credential deduplication', () => {
});
it('skips credential with same name', () => {
const projectSpec = loadCliProjectSpec();
projectSpec.credentials.push({ type: 'ApiKeyCredentialProvider', name: 'new_api_key_cred' });
projectSpec.credentials.push({ authorizerType: 'ApiKeyCredentialProvider', name: 'new_api_key_cred' });
const parsed = parseStarterToolkitYaml(DIFFERENT_AGENT_YAML);
const { messages } = simulateMerge(projectSpec, parsed);
expect(messages).toContain('Skipping credential "new_api_key_cred" (already exists in project)');
Expand Down
Loading
Loading