') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); feat: add VPC network mode to schema [1/3] by tejaskash · Pull Request #424 · aws/agentcore-cli · GitHub
Skip to content

feat: add VPC network mode to schema [1/3] - #424

Merged
tejaskash merged 1 commit into
mainfrom
feat/vpc-1-schema
Feb 24, 2026
Merged

feat: add VPC network mode to schema [1/3]#424
tejaskash merged 1 commit into
mainfrom
feat/vpc-1-schema

Conversation

@tejaskash

Copy link
Copy Markdown
Contributor

Summary

Fix NetworkModeSchema enum and add VPC configuration schema support. This is the foundation PR that PR #2 and #3 build on.

  • Fix NetworkModeSchema enum from PUBLIC | PRIVATE to PUBLIC | VPC to match the AWS API
  • Add NetworkConfigSchema with subnet ID (subnet-*) and security group ID (sg-*) regex validation, array bounds (1-16)
  • Add networkConfig optional field to AgentEnvSpec
  • Add .superRefine() cross-field validation: VPC mode requires networkConfig, PUBLIC mode rejects it
  • Update LLM-compacted schema documentation

Files changed (7)

FileChange
src/schema/constants.tsFix enum: PRIVATEVPC
src/schema/schemas/agent-env.tsAdd NetworkConfigSchema, networkConfig field, .superRefine()
src/schema/llm-compacted/agentcore.tsAdd NetworkConfig type, update NetworkMode
src/schema/llm-compacted/mcp.tsUpdate NetworkMode type
src/schema/__tests__/constants.test.tsVPC enum tests
src/schema/schemas/__tests__/agent-env.test.ts10 new VPC cross-field validation tests
src/schema/schemas/__tests__/mcp.test.tsUpdate PRIVATE → VPC in existing test

Stack

PRs 2 and 3 can be reviewed in parallel. Merge this first, then 2 and 3 in any order.

Test plan

  • All unit tests pass (npm test)
  • TypeScript compiles clean
  • Lint and prettier pass

Fix NetworkModeSchema enum from PUBLIC|PRIVATE to PUBLIC|VPC to match
the AWS API. Add NetworkConfigSchema for subnet and security group
validation, and networkConfig field to AgentEnvSpec with cross-field
validation requiring networkConfig when networkMode is VPC.
Changes:
- Fix NetworkModeSchema enum: PRIVATE → VPC
- Add NetworkConfigSchema (subnet/SG ID regex, min/max array bounds)
- Add networkConfig optional field to AgentEnvSpec
- Add superRefine cross-field validation
- Update LLM-compacted schema documentation
- Add 13 new unit tests for VPC schema validation
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

StatusCategoryPercentageCovered / Total
🔵Lines43.92%2967 / 6754
🔵Statements43.52%3123 / 7176
🔵Functions45.76%616 / 1346
🔵Branches48.61%1932 / 3974
Generated in workflow #630 for commit 170bf40 by the Vitest Coverage Report Action

@aidandaly24aidandaly24 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm approved

@tejaskash
tejaskash merged commit 4180646 into mainFeb 24, 2026
14 of 19 checks passed
@tejaskash
tejaskash deleted the feat/vpc-1-schema branch February 24, 2026 23:15
tejaskash added a commit that referenced this pull request Feb 27, 2026
tejaskash added a commit that referenced this pull request Feb 27, 2026
* Revert "feat: add VPC CLI flags to create and add commands [2/3] (#425)"
This reverts commit c75f4cd.
* Revert "feat: add VPC info messages to dev and invoke commands [3/3] (#426)"
This reverts commit 7a81b02.
* Revert "feat: add VPC network mode to schema (#424)"
This reverts commit 4180646.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mPR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@tejaskash@aidandaly24