Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const client = new BedrockAgentCoreClient({

const input = {
// Generate unique session ID
runtimeSessionId: 'test-session-' + Date.now() + '-' + Math.random().toString(36).substring(7),
runtimeSessionId: 'test-session-' + Date.now() + '-' + crypto.randomUUID().slice(0, 7),
// Replace with your actual runtime ARN
agentRuntimeArn:
'arn:aws:bedrock-agentcore:ap-southeast-2:YOUR_ACCOUNT_ID:runtime/my-agent-service-XXXXXXXXXX',
Expand Down
15 changes: 9 additions & 6 deletions site/scripts/astro-broken-links-checker-check-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,16 @@ export async function checkLinksInHtml(
}

function isValidUrl(url) {
// Skip mailto:, tel:, javascript:, and empty links
// Skip non-HTTP schemes and empty links
const lower = url.toLowerCase().trim();
return !(
url.startsWith('mailto:') ||
url.startsWith('tel:') ||
url.startsWith('javascript:') ||
url.startsWith('#') ||
url.trim() === ''
lower.startsWith('mailto:') ||
lower.startsWith('tel:') ||
lower.startsWith('javascript:') ||
lower.startsWith('vbscript:') ||
lower.startsWith('data:') ||
lower.startsWith('#') ||
lower === ''
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ async function expressExample() {
console.log(`Got Request: ${JSON.stringify(req.body)}`)
const { prompt } = req.body as PromptRequest

res.setHeader('Content-Type', 'application/x-ndjson')

const agent = new Agent({
tools: [notebook],
printer: false,
Expand Down
2 changes: 1 addition & 1 deletion site/test/update-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('API link conversion', () => {
function convertApiLinks(content: string): string {
// Match markdown links with potentially nested brackets in the text
// This handles cases like [`list[ToolSpec]`](url)
const markdownLinkPattern = /\[([^\]]*(?:\[[^\]]*\][^\]]*)*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g
const markdownLinkPattern = /\[((?:[^\[\]]|\[[^\]]*\])*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g

return content.replace(markdownLinkPattern, (match, text, url) => {
if (isOldApiLink(url)) {
Expand Down
9 changes: 3 additions & 6 deletions strands-ts/src/vended-plugins/context-offloader/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ function searchByPattern(
scopeLabel: string
): string {
let regex: RegExp
const safeInput =
pattern.length > MAX_PATTERN_LENGTH
? pattern.slice(0, MAX_PATTERN_LENGTH).replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
: pattern
const truncated = pattern.length > MAX_PATTERN_LENGTH ? pattern.slice(0, MAX_PATTERN_LENGTH) : pattern
try {
regex = new RegExp(safeInput)
regex = new RegExp(truncated)
} catch {
regex = new RegExp(safeInput.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
regex = new RegExp(truncated.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
}

const matchedSet = new Set<number>()
Expand Down
Loading