mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
* feat(agentcore): emulate CreateBrowser * feat(agentcore): emulate GetBrowser * feat(agentcore): emulate ListBrowsers * feat(agentcore): emulate DeleteBrowser * feat(agentcore): emulate CreateBrowserProfile * feat(agentcore): emulate GetBrowserProfile * feat(agentcore): emulate ListBrowserProfiles * feat(agentcore): emulate DeleteBrowserProfile * feat(agentcore): emulate CreateCodeInterpreter * feat(agentcore): emulate GetCodeInterpreter * feat(agentcore): emulate ListCodeInterpreters * feat(agentcore): emulate DeleteCodeInterpreter * feat(agentcore): emulate CreateGatewayRule * feat(agentcore): emulate GetGatewayRule * feat(agentcore): emulate ListGatewayRules * feat(agentcore): emulate UpdateGatewayRule * feat(agentcore): emulate DeleteGatewayRule * feat(agentcore): emulate CreateApiKeyCredentialProvider * feat(agentcore): emulate GetApiKeyCredentialProvider * feat(agentcore): emulate ListApiKeyCredentialProviders * feat(agentcore): emulate UpdateApiKeyCredentialProvider * feat(agentcore): emulate DeleteApiKeyCredentialProvider * feat(agentcore): emulate CreateOauth2CredentialProvider * feat(agentcore): emulate GetOauth2CredentialProvider * feat(agentcore): emulate ListOauth2CredentialProviders * feat(agentcore): emulate UpdateOauth2CredentialProvider * feat(agentcore): emulate DeleteOauth2CredentialProvider * feat(agentcore): emulate GetResourcePolicy * feat(agentcore): emulate PutResourcePolicy * feat(agentcore): emulate DeleteResourcePolicy * docs(agentcore): update expanded coverage * fix(agentcore): align expanded control-plane contracts * fix(agentcore): address PR review findings * test(agentcore): cover persistent delete replay
143 lines
7.5 KiB
Markdown
143 lines
7.5 KiB
Markdown
# Bedrock AgentCore
|
|
|
|
**Protocol:** REST-JSON
|
|
**Endpoint:** `http://localhost:4566/runtimes/...`
|
|
|
|
Emulates the Amazon Bedrock AgentCore **control plane** (`bedrock-agentcore-control`)
|
|
as a stateful local registry across runtimes, endpoints, gateways, memories, browser/code-interpreter
|
|
resources, credential providers, gateway rules, and resource policies. No real agent execution:
|
|
runtimes reach `READY` immediately and hold metadata only. See
|
|
[the design note](../design/bedrock-agentcore.md) for scope and protocol details.
|
|
|
|
## Supported Actions
|
|
|
|
<!-- floci:actions:start -->
|
|
| Action | Description |
|
|
| --- | --- |
|
|
| `CreateAgentRuntime` | Register an agent runtime; returns an id, versioned ARN, and workload identity |
|
|
| `ListAgentRuntimes` | List runtimes (paginated) |
|
|
| `GetAgentRuntime` | Get a runtime, optionally a specific `version` |
|
|
| `UpdateAgentRuntime` | Update a runtime; appends a new immutable version |
|
|
| `ListAgentRuntimeVersions` | List a runtime's versions (paginated) |
|
|
| `DeleteAgentRuntime` | Delete a runtime |
|
|
| `CreateAgentRuntimeEndpoint` | Creates a named runtime endpoint targeting an agent runtime version |
|
|
| `GetAgentRuntimeEndpoint` | Returns a runtime endpoint |
|
|
| `UpdateAgentRuntimeEndpoint` | Updates the target version or description of a runtime endpoint |
|
|
| `DeleteAgentRuntimeEndpoint` | Deletes a runtime endpoint |
|
|
| `ListAgentRuntimeEndpoints` | Lists runtime endpoints for an agent runtime |
|
|
| `CreateWorkloadIdentity` | Creates a workload identity |
|
|
| `GetWorkloadIdentity` | Returns a workload identity |
|
|
| `UpdateWorkloadIdentity` | Updates a workload identity |
|
|
| `DeleteWorkloadIdentity` | Deletes a workload identity |
|
|
| `ListWorkloadIdentities` | Lists workload identities |
|
|
| `CreateApiKeyCredentialProvider` | Creates an API key credential provider |
|
|
| `GetApiKeyCredentialProvider` | Returns an API key credential provider |
|
|
| `ListApiKeyCredentialProviders` | Lists API key credential providers |
|
|
| `UpdateApiKeyCredentialProvider` | Updates an API key credential provider |
|
|
| `DeleteApiKeyCredentialProvider` | Deletes an API key credential provider |
|
|
| `CreateOauth2CredentialProvider` | Creates an OAuth2 credential provider |
|
|
| `GetOauth2CredentialProvider` | Returns an OAuth2 credential provider |
|
|
| `ListOauth2CredentialProviders` | Lists OAuth2 credential providers |
|
|
| `UpdateOauth2CredentialProvider` | Updates an OAuth2 credential provider |
|
|
| `DeleteOauth2CredentialProvider` | Deletes an OAuth2 credential provider |
|
|
| `CreateGateway` | Creates a gateway |
|
|
| `GetGateway` | Returns a gateway |
|
|
| `UpdateGateway` | Updates a gateway |
|
|
| `DeleteGateway` | Deletes a gateway |
|
|
| `ListGateways` | Lists gateways |
|
|
| `CreateGatewayTarget` | Creates a target on a gateway |
|
|
| `GetGatewayTarget` | Returns a gateway target |
|
|
| `UpdateGatewayTarget` | Updates a gateway target |
|
|
| `DeleteGatewayTarget` | Deletes a gateway target |
|
|
| `ListGatewayTargets` | Lists targets on a gateway |
|
|
| `CreateMemory` | Creates a memory resource |
|
|
| `GetMemory` | Returns a memory resource |
|
|
| `UpdateMemory` | Updates a memory resource |
|
|
| `DeleteMemory` | Deletes a memory resource |
|
|
| `ListMemories` | Lists memory resources |
|
|
| `CreateBrowser` | Creates a custom browser |
|
|
| `GetCodeInterpreter` | Returns a custom or system code interpreter |
|
|
| `DeleteCodeInterpreter` | Deletes a custom code interpreter |
|
|
| `ListCodeInterpreters` | Lists custom and system code interpreters |
|
|
| `CreateCodeInterpreter` | Creates a custom code interpreter |
|
|
| `CreateBrowserProfile` | Creates a browser profile |
|
|
| `ListBrowserProfiles` | Lists browser profiles |
|
|
| `DeleteBrowserProfile` | Deletes a browser profile |
|
|
| `GetBrowserProfile` | Returns a browser profile |
|
|
| `GetBrowser` | Returns a custom or system browser |
|
|
| `DeleteBrowser` | Deletes a custom browser |
|
|
| `ListBrowsers` | Lists custom and system browsers |
|
|
| `CreateGatewayRule` | Creates a gateway rule |
|
|
| `GetGatewayRule` | Returns a gateway rule |
|
|
| `ListGatewayRules` | Lists rules on a gateway |
|
|
| `UpdateGatewayRule` | Updates a gateway rule |
|
|
| `DeleteGatewayRule` | Deletes a gateway rule |
|
|
| `GetResourcePolicy` | Returns the policy attached to an AgentCore resource |
|
|
| `PutResourcePolicy` | Creates or replaces a policy on an AgentCore resource |
|
|
| `DeleteResourcePolicy` | Deletes the policy attached to an AgentCore resource |
|
|
<!-- floci:actions:end -->
|
|
|
|
A `DEFAULT` endpoint is created automatically with each runtime, and each runtime
|
|
is associated with an auto-created, resolvable workload identity.
|
|
|
|
## Data plane — `InvokeAgentRuntime`
|
|
|
|
`POST /runtimes/{agentRuntimeArn}/invocations` returns a fixed, configurable JSON
|
|
body (default `{"output":"yes"}`) and echoes the
|
|
`X-Amzn-Bedrock-AgentCore-Runtime-Session-Id` header. The request payload (opaque
|
|
binary, up to 100 MB) is never parsed. Streaming responses are not emulated — a
|
|
single non-streaming `200` is returned.
|
|
|
|
## Configuration
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `FLOCI_SERVICES_BEDROCK_AGENT_CORE_CONTROL_ENABLED` | `true` | Enable/disable the control plane |
|
|
| `FLOCI_SERVICES_BEDROCK_AGENT_CORE_ENABLED` | `true` | Enable/disable the data plane (invoke) |
|
|
| `FLOCI_SERVICES_BEDROCK_AGENT_CORE_INVOKE_RESPONSE` | `{"output":"yes"}` | Canned `InvokeAgentRuntime` response body |
|
|
| `FLOCI_SERVICES_BEDROCK_AGENT_CORE_VALIDATE_RUNTIME_EXISTS` | `false` | When `true`, `InvokeAgentRuntime` returns `ResourceNotFoundException` for an unknown runtime ARN instead of the canned response |
|
|
|
|
> **Note on YAML config keys.** The status endpoint reports these services as
|
|
> `bedrock-agentcore-control` and `bedrock-agentcore`, but the YAML property paths
|
|
> use hyphenated words: `floci.services.bedrock-agent-core-control.enabled` and
|
|
> `floci.services.bedrock-agent-core.enabled` (and `…bedrock-agent-core.invoke-response`,
|
|
> `…bedrock-agent-core.validate-runtime-exists`). The `FLOCI_*` environment variables
|
|
> above map to these paths directly and are the recommended way to configure the service.
|
|
|
|
## Behavior notes
|
|
|
|
- `agentRuntimeId` is `<name>-<10 alphanumerics>`; the ARN embeds a UUID and the
|
|
version: `arn:aws:bedrock-agentcore:<region>:<account>:agent/<uuid>:<version>`.
|
|
- `agentRuntimeName` must match `[a-zA-Z][a-zA-Z0-9_]{0,47}` (no hyphens); invalid
|
|
names return `ValidationException`.
|
|
- Each `UpdateAgentRuntime` increments the version and preserves prior versions for
|
|
`GetAgentRuntime?version=` and `ListAgentRuntimeVersions`.
|
|
- Timestamps (`createdAt`, `lastUpdatedAt`) are ISO-8601 strings.
|
|
- Config blobs (`agentRuntimeArtifact`, `networkConfiguration`, …) are stored opaquely
|
|
and echoed back; they are not deeply validated.
|
|
- `CreateMemory` persists `tags`, `encryptionKeyArn`, and `memoryExecutionRoleArn`;
|
|
`UpdateMemory` applies `description`, `eventExpiryDuration`, and
|
|
`memoryExecutionRoleArn`. As in AWS, memory tags are returned only by
|
|
`ListTagsForResource`, never embedded in the `memory` response shape.
|
|
|
|
## Examples
|
|
|
|
```bash
|
|
export AWS_ENDPOINT_URL=http://localhost:4566
|
|
|
|
# Create an agent runtime
|
|
aws bedrock-agentcore-control create-agent-runtime \
|
|
--agent-runtime-name myAgent \
|
|
--agent-runtime-artifact '{"containerConfiguration":{"containerUri":"public.ecr.aws/x/agent:latest"}}' \
|
|
--network-configuration '{"networkMode":"PUBLIC"}' \
|
|
--role-arn "arn:aws:iam::000000000000:role/agent-runtime" \
|
|
--endpoint-url $AWS_ENDPOINT_URL
|
|
|
|
# Get / list
|
|
aws bedrock-agentcore-control get-agent-runtime --agent-runtime-id <id> --endpoint-url $AWS_ENDPOINT_URL
|
|
aws bedrock-agentcore-control list-agent-runtimes --endpoint-url $AWS_ENDPOINT_URL
|
|
|
|
# Delete
|
|
aws bedrock-agentcore-control delete-agent-runtime --agent-runtime-id <id> --endpoint-url $AWS_ENDPOINT_URL
|
|
```
|