feat(runtime): add Runtime invocation#1820
Open
aidandaly24 wants to merge 31 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #1820 +/- ##
============================================
+ Coverage 94.84% 95.26% +0.41%
============================================
Files 143 151 +8
Lines 7120 8211 +1091
============================================
+ Hits 6753 7822 +1069
- Misses 367 389 +22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds headless and interactive invocation for the Runtime commands and TUI introduced in #1802.
Headless invocation supports both IAM and CUSTOM_JWT Runtimes. IAM requests use the AgentCore data-plane SDK, while CUSTOM_JWT requests use the generated Runtime data endpoint with an explicit bearer token. Payloads and bearer tokens can come from inline values, files, or stdin, with validation preventing both from consuming stdin at once.
The command maps the public Runtime invocation contract, including endpoint qualifiers, content negotiation, Runtime and MCP session IDs, application headers, MCP metadata, and tracing headers. Application headers are validated against the Runtime allowlist and cannot override reserved protocol headers.
-His available as the short form of--header.Raw output streams the exact response bytes to stdout and writes response metadata to stderr. Binary responses can be written directly to a file, while
--jsonemits one buffered response envelope with UTF-8 or base64 body encoding. Partial responses retain the bytes already received and report whether the stream completed.Without
--payload,runtime invokeopens a persistent console. Users can select a Runtime and endpoint, edit request options, send repeated requests, retain response history, switch targets, toggle completed JSON between raw and formatted views, and save binary responses to a file. Returned Runtime and MCP sessions are adopted only after a response completes.Headless
SIGINT, interactive Escape, route changes, and component unmounts propagate cancellation through Runtime lookup, transport, and response output. Usage failures return exit code 2, interruptions return 130, and transport or stream failures avoid exposing payloads, tokens, headers, or arbitrary upstream error causes. Invoke payloads, application headers, and bearer tokens are marked sensitive for command logging.This change also adds shared abortable-stream handling used by Runtime and Harness, extends the Core Runtime client with invocation transport and injectable fetch support, and documents IAM, CUSTOM_JWT, MCP, binary, JSON, and persistent-console workflows.
Runtime creation and mutation, deployment or project resolution, cross-account invocation, Runtime ARNs, version targeting, custom request paths, and the Runtime
/commandsroute remain outside this change.Related Issue
N/A
Documentation PR
N/A. README command, invocation, output, MCP, and interactive-console documentation is included in this PR.
Type of Change
Testing
Verified from current HEAD
1f79e4df:bun test(403 passed, 0 failed)bun run typecheckbun run lint:checkbun run format:checkbun run buildChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.