-
Notifications
You must be signed in to change notification settings - Fork 60
feat: add runtime read-only control-plane commands #1797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f5941e2
feat(runtime): add read-only control-plane commands
aidandaly24 318744e
refactor(tui): inline runtime visibility check
aidandaly24 22634e5
docs: restore command surface wording
aidandaly24 e63739e
test(runtime): cover missing get selectors
aidandaly24 98fefcb
fix(tui): show runtime in root command menu
aidandaly24 da58a8c
test(runtime): consolidate command flows on golden fixtures
aidandaly24 7343419
test(runtime): record fixtures from shared e2e account
aidandaly24 e65a1ec
test(runtime): clarify pagination and ID coverage
aidandaly24 68afc22
chore(runtime): clarify pagination terminology
aidandaly24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import { | ||
| GetAgentRuntimeCommand, | ||
| GetAgentRuntimeEndpointCommand, | ||
| ListAgentRuntimeEndpointsCommand, | ||
| ListAgentRuntimesCommand, | ||
| ListAgentRuntimeVersionsCommand, | ||
| type GetAgentRuntimeEndpointResponse, | ||
| type GetAgentRuntimeResponse, | ||
| type ListAgentRuntimeEndpointsResponse, | ||
| type ListAgentRuntimesResponse, | ||
| type ListAgentRuntimeVersionsResponse, | ||
| } from "@aws-sdk/client-bedrock-agentcore-control"; | ||
| import type { CoreRuntimeClient } from "../handlers/runtime/types"; | ||
| import type { AwsClients, CoreOptions } from "./types"; | ||
| import { toClientConfig } from "./utils"; | ||
|
|
||
| export class RuntimeClient implements CoreRuntimeClient { | ||
| constructor(private readonly clients: AwsClients) {} | ||
|
|
||
| async getRuntime(id: string, options: CoreOptions): Promise<GetAgentRuntimeResponse> { | ||
| return this.clients | ||
| .control(toClientConfig(options)) | ||
| .send(new GetAgentRuntimeCommand({ agentRuntimeId: id })); | ||
| } | ||
|
|
||
| async getRuntimeVersion( | ||
| id: string, | ||
| version: string, | ||
| options: CoreOptions, | ||
| ): Promise<GetAgentRuntimeResponse> { | ||
| return this.clients.control(toClientConfig(options)).send( | ||
| new GetAgentRuntimeCommand({ | ||
| agentRuntimeId: id, | ||
| agentRuntimeVersion: version, | ||
| }), | ||
| ); | ||
| } | ||
|
|
||
| async getRuntimeEndpoint( | ||
| id: string, | ||
| qualifier: string, | ||
| options: CoreOptions, | ||
| ): Promise<GetAgentRuntimeEndpointResponse> { | ||
| return this.clients.control(toClientConfig(options)).send( | ||
| new GetAgentRuntimeEndpointCommand({ | ||
| agentRuntimeId: id, | ||
| endpointName: qualifier, | ||
| }), | ||
| ); | ||
| } | ||
|
|
||
| async listRuntimes( | ||
| nextToken: string | undefined, | ||
| maxResults: number | undefined, | ||
| options: CoreOptions, | ||
| ): Promise<ListAgentRuntimesResponse> { | ||
| return this.clients | ||
| .control(toClientConfig(options)) | ||
| .send(new ListAgentRuntimesCommand({ nextToken, maxResults })); | ||
| } | ||
|
|
||
| async listRuntimeVersions( | ||
| id: string, | ||
| nextToken: string | undefined, | ||
| maxResults: number | undefined, | ||
| options: CoreOptions, | ||
| ): Promise<ListAgentRuntimeVersionsResponse> { | ||
| return this.clients.control(toClientConfig(options)).send( | ||
| new ListAgentRuntimeVersionsCommand({ | ||
| agentRuntimeId: id, | ||
| nextToken, | ||
| maxResults, | ||
| }), | ||
| ); | ||
| } | ||
|
|
||
| async listRuntimeEndpoints( | ||
| id: string, | ||
| nextToken: string | undefined, | ||
| maxResults: number | undefined, | ||
| options: CoreOptions, | ||
| ): Promise<ListAgentRuntimeEndpointsResponse> { | ||
| return this.clients.control(toClientConfig(options)).send( | ||
| new ListAgentRuntimeEndpointsCommand({ | ||
| agentRuntimeId: id, | ||
| nextToken, | ||
| maxResults, | ||
| }), | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/handlers/runtime/__fixtures__/GetAgentRuntimeCommand.140854af01fd7827.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeName": "agentcore_cli_runtime_read_only_fixture", | ||
| "agentRuntimeId": "agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeVersion": "2", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:24:52.318Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:21.499Z" | ||
| }, | ||
| "roleArn": "arn:aws:iam::685197708687:role/tf_acc_test_1997929140646926281", | ||
| "networkConfiguration": { | ||
| "networkMode": "PUBLIC" | ||
| }, | ||
| "status": "READY", | ||
| "lifecycleConfiguration": { | ||
| "idleRuntimeSessionTimeout": 900, | ||
| "maxLifetime": 28800 | ||
| }, | ||
| "description": "Stable shared resource for AgentCore CLI Runtime read-only fixture recording", | ||
| "workloadIdentityDetails": { | ||
| "workloadIdentityArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:workload-identity-directory/default/workload-identity/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx" | ||
| }, | ||
| "agentRuntimeArtifact": { | ||
| "containerConfiguration": { | ||
| "containerUri": "public.ecr.aws/y5s8y8h8/harness-us-west-2:latest" | ||
| } | ||
| }, | ||
| "metadataConfiguration": { | ||
| "requireMMDSV2": true | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
src/handlers/runtime/__fixtures__/GetAgentRuntimeCommand.97ebe200714d941e.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeName": "agentcore_cli_runtime_read_only_fixture", | ||
| "agentRuntimeId": "agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeVersion": "1", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:24:53.572Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:24:53.572Z" | ||
| }, | ||
| "roleArn": "arn:aws:iam::685197708687:role/tf_acc_test_1997929140646926281", | ||
| "networkConfiguration": { | ||
| "networkMode": "PUBLIC" | ||
| }, | ||
| "status": "READY", | ||
| "lifecycleConfiguration": { | ||
| "idleRuntimeSessionTimeout": 900, | ||
| "maxLifetime": 28800 | ||
| }, | ||
| "description": "Stable shared resource for AgentCore CLI Runtime read-only fixture recording", | ||
| "workloadIdentityDetails": { | ||
| "workloadIdentityArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:workload-identity-directory/default/workload-identity/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx" | ||
| }, | ||
| "agentRuntimeArtifact": { | ||
| "containerConfiguration": { | ||
| "containerUri": "public.ecr.aws/y5s8y8h8/harness-us-west-2:latest" | ||
| } | ||
| }, | ||
| "metadataConfiguration": { | ||
| "requireMMDSV2": true | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
src/handlers/runtime/__fixtures__/GetAgentRuntimeCommand.9b8f562f35114475.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "$error": { | ||
| "name": "ResourceNotFoundException", | ||
| "message": "Agent with agentId: missing_runtime-0000000000, accountId: 685197708687, and version: null not found!" | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/handlers/runtime/__fixtures__/GetAgentRuntimeEndpointCommand.1aa8574ea8360d43.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "agentRuntimeEndpointArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx/runtime-endpoint/DEFAULT", | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "status": "READY", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:24:52.560Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:21.499Z" | ||
| }, | ||
| "name": "DEFAULT", | ||
| "id": "DEFAULT", | ||
| "liveVersion": "2" | ||
| } |
33 changes: 33 additions & 0 deletions
33
src/handlers/runtime/__fixtures__/ListAgentRuntimeEndpointsCommand.140854af01fd7827.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "runtimeEndpoints": [ | ||
| { | ||
| "name": "runtimeReadOnlyFixture", | ||
| "agentRuntimeEndpointArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx/runtime-endpoint/runtimeReadOnlyFixture", | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "status": "READY", | ||
| "id": "runtimeReadOnlyFixture", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:25:40.102Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:40.952Z" | ||
| }, | ||
| "liveVersion": "2", | ||
| "description": "Stable shared endpoint for AgentCore CLI Runtime read-only fixture recording" | ||
| }, | ||
| { | ||
| "name": "DEFAULT", | ||
| "agentRuntimeEndpointArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx/runtime-endpoint/DEFAULT", | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "status": "READY", | ||
| "id": "DEFAULT", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:24:52.560Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:21.499Z" | ||
| }, | ||
| "liveVersion": "2" | ||
| } | ||
| ] | ||
| } |
18 changes: 18 additions & 0 deletions
18
src/handlers/runtime/__fixtures__/ListAgentRuntimeEndpointsCommand.1d171c98cd60b7c4.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "runtimeEndpoints": [ | ||
| { | ||
| "name": "DEFAULT", | ||
| "agentRuntimeEndpointArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx/runtime-endpoint/DEFAULT", | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "status": "READY", | ||
| "id": "DEFAULT", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:24:52.560Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:21.499Z" | ||
| }, | ||
| "liveVersion": "2" | ||
| } | ||
| ] | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/handlers/runtime/__fixtures__/ListAgentRuntimeEndpointsCommand.52cf5ddfc336d4d2.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "runtimeEndpoints": [ | ||
| { | ||
| "name": "runtimeReadOnlyFixture", | ||
| "agentRuntimeEndpointArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx/runtime-endpoint/runtimeReadOnlyFixture", | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "status": "READY", | ||
| "id": "runtimeReadOnlyFixture", | ||
| "createdAt": { | ||
| "$date": "2026-07-21T15:25:40.102Z" | ||
| }, | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:40.952Z" | ||
| }, | ||
| "liveVersion": "2", | ||
| "description": "Stable shared endpoint for AgentCore CLI Runtime read-only fixture recording" | ||
| } | ||
| ], | ||
| "nextToken": "AQICAHiNyEvxZzpFuVHtBl-B3jfZBBM36tDjm8_cCisOa4ihlgHTCX90veyHQpW0JbzdFgJCAAAB7DCCAegGCSqGSIb3DQEHBqCCAdkwggHVAgEAMIIBzgYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAzXdq_zR1bimIWtQ_0CARCAggGfKjn69njYg3vBDeIAyLfH8q9m_O480LF2QMDi6BTVyJ70W0yKBU6bFBR3UvX61r_dQRqviT_A7gP1nndeLPIVoeaoH5E66U9njh8TO9uBRArYUqmdMtoN2zL4z4pPXncZzBtBDrSetRhOk_Az6YyGFPuZRqbn9o054gP5b4AMLENbckixIotwZPbYl7_WHNev0IZYhNaqXIgDjgyI517p0mRrWfRe4Ddv1G-bpox-6zIg5IVw1K38EQjvdk55Ct0ivrWvPpN_xTqETf6E1nkjtgMu3OGm-sKqZtdpVfAI_1cElM6pDi6HJ2bRx5rNFav1gybOp9mFRGRpNGMpUppDQ-SmCalZ7t8wqWCt0nKzn8kAtBqVOIIMSXwUfgvjiE9IsM2g3nPGSXwmOkKwAl3hck9Y5UQsN8tSyyxSEhqXbEJBra0LRKEtj2f4tVnQ6NHrXxgrfU3TfRopLs1PjRXSY-e_XUScXbQ7taQJDuC1r11isln9EZRje0iQ8unWWSnZvFdVcvAqzfWlz9fG3Kz1bj9fCQ0-l4aeY64N6nJijw==" | ||
| } |
26 changes: 26 additions & 0 deletions
26
src/handlers/runtime/__fixtures__/ListAgentRuntimeVersionsCommand.140854af01fd7827.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "agentRuntimes": [ | ||
| { | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeId": "agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeVersion": "2", | ||
| "agentRuntimeName": "agentcore_cli_runtime_read_only_fixture", | ||
| "description": "Stable shared resource for AgentCore CLI Runtime read-only fixture recording", | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:25:21.499Z" | ||
| }, | ||
| "status": "READY" | ||
| }, | ||
| { | ||
| "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-west-2:685197708687:runtime/agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeId": "agentcore_cli_runtime_read_only_fixture-wZ7V4Q6vhx", | ||
| "agentRuntimeVersion": "1", | ||
| "agentRuntimeName": "agentcore_cli_runtime_read_only_fixture", | ||
| "description": "Stable shared resource for AgentCore CLI Runtime read-only fixture recording", | ||
| "lastUpdatedAt": { | ||
| "$date": "2026-07-21T15:24:53.572Z" | ||
| }, | ||
| "status": "READY" | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this follows the existing pattern, but what do think of avoiding positional arguments for functions with many arguments? I've found that using input objects makes it easier to handle optional args, and easier to read at the callsite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree an input object would make this method easier to read in isolation, particularly with the optional pagination fields. I kept the positional signature intentionally because these Runtime methods directly mirror the existing Harness Core interface. Changing only Runtime would leave two different conventions for otherwise parallel APIs. I would prefer to keep them consistent in this PR and, if we decide input objects are the better convention, refactor both Core clients together.