Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
127 changes: 127 additions & 0 deletions .github/workflows/check-redirects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Check Redirects for Deleted Pages

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "app/**/*.md"
- "app/**/*.mdx"
- "next.config.ts"

permissions:
contents: read
pull-requests: write

jobs:
check-redirects:
name: Verify Deleted Pages Have Redirects
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history needed for branch comparison

- name: Fetch base branch
run: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}

- name: Check for missing redirects
id: check
run: |
set -o pipefail
chmod +x ./scripts/check-redirects.sh
./scripts/check-redirects.sh ${{ github.base_ref }} 2>&1 | tee redirect-check-output.txt
continue-on-error: true

- name: Comment on PR if redirects are missing
if: steps.check.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const output = fs.readFileSync('redirect-check-output.txt', 'utf8');

// Extract the missing redirects and suggestions from output
const body = `## 🔗 Missing Redirects Detected

This PR deletes markdown files that don't have corresponding redirects in \`next.config.ts\`.

When you delete a page, you must add a redirect to prevent broken links for users who have bookmarked the old URL.

<details>
<summary>📋 View Details</summary>

\`\`\`
${output}
\`\`\`

</details>

### How to fix

1. Open \`next.config.ts\`
2. Find the \`redirects()\` function
3. Add redirect entries for each deleted file (see suggestions above)
4. Push the changes

---
*This check ensures we maintain URL stability for our documentation.*`;

// Check if we already commented
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Missing Redirects Detected')
);

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}

- name: Remove outdated comment if check passes
if: steps.check.outcome == 'success'
uses: actions/github-script@v7
with:
script: |
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Missing Redirects Detected')
);

if (botComment) {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
});
}

- name: Fail if redirects are missing
if: steps.check.outcome == 'failure'
run: |
echo "❌ Missing redirects for deleted pages. See PR comment for details."
exit 1
44 changes: 44 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,50 @@ if [ -n "$STAGED_DOCS" ]; then
fi
fi

# --- Check Redirects (when markdown pages are deleted) ---
# If any page.md/page.mdx files are being deleted, auto-add redirect entries
DELETED_PAGES=$(git diff --cached --name-status | grep -E "^D.*page\.(md|mdx)$" | cut -f2 || true)

if [ -n "$DELETED_PAGES" ]; then
echo "🔗 Detected deleted page(s), checking for redirects..."

# Run the redirect checker with auto-fix (compares staged changes to HEAD)
# This will add redirect entries to next.config.ts if missing
if ! ./scripts/check-redirects.sh --auto-fix HEAD 2>&1; then
# Stage next.config.ts if it was modified
if git diff --name-only next.config.ts 2>/dev/null | grep -q "next.config.ts"; then
git add next.config.ts
echo ""
echo "📝 Redirect entries added to next.config.ts and staged."
fi
echo ""
# Check if there are placeholders vs other errors
if grep -q "REPLACE_WITH_NEW_PATH" next.config.ts 2>/dev/null; then
echo "❌ Commit blocked: Please update the placeholder destinations in next.config.ts"
echo " Search for 'REPLACE_WITH_NEW_PATH' and provide actual redirect paths."
else
echo "❌ Commit blocked: Please fix the redirect issues shown above."
fi
exit 1
fi
fi

# --- Update Internal Links (when redirects are added) ---
# If next.config.ts is staged, update any internal links pointing to redirected paths
if git diff --cached --name-only | grep -q "next.config.ts"; then
echo "🔗 Updating internal links for new redirects..."

# Run the update script
if ./scripts/update-internal-links.sh 2>/dev/null; then
# Stage any files that were modified
UPDATED_FILES=$(git diff --name-only -- 'app/**/*.mdx' 'app/**/*.tsx' 'app/**/*.md' 2>/dev/null || true)
if [ -n "$UPDATED_FILES" ]; then
echo "$UPDATED_FILES" | xargs git add
echo "✅ Internal links updated and staged"
fi
fi
fi

# --- Lint Staged (formatting) ---
pnpm dlx lint-staged

Expand Down
4 changes: 2 additions & 2 deletions app/_components/tool-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ToolFooter: React.FC<ToolFooterProps> = ({ pipPackageName }) => (
<div className="mt-16 grid gap-8 md:grid-cols-2">
<QuickStartCard
description="Arcade tools are hosted by our cloud platform and ready to be used in your agents. Learn how."
href="/home/quickstart"
href="/get-started/quickstarts/call-tool-agent"
icon={Cloud}
title="Use tools hosted on Arcade Cloud"
/>
Expand All @@ -24,7 +24,7 @@ const ToolFooter: React.FC<ToolFooterProps> = ({ pipPackageName }) => (
description={
"Arcade tools can be self-hosted on your own infrastructure. Learn more about self-hosting."
}
href="/home/hosting-overview"
href="/guides/deployment-hosting"
icon={Puzzle}
title="Self Host Arcade tools"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export const meta: MetaRecord = {
index: {
title: "Overview",
},
"setup-arcade-with-your-llm-python": {
title: "Setup Arcade with your LLM (Python)",
},
crewai: {
title: "CrewAI",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ToggleContent from "@/app/_components/toggle-content";

In this guide, we will explore how to integrate Arcade tools into your CrewAI application. Follow the step-by-step instructions below. If a tool requires authorization, an authorization URL will appear in the console, waiting for your approval. This process ensures that only the tools you choose to authorize are executed.

To tailor the tool authorization flow to meet your application's specific needs, check out the [Custom Auth Flow with CrewAI](/guides/agent-frameworks/crewai/custom-auth-flow) guide.
To tailor the tool authorization flow to meet your application's specific needs, check out the [Custom Auth Flow with CrewAI](/get-started/agent-frameworks/crewai/custom-auth-flow) guide.

<Steps>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ for tool in google_tools:

Ready to start building with Arcade and OpenAI Agents? Check out these guides:

- [Using Arcade tools](/guides/agent-frameworks/google-adk/use-arcade-tools) - Learn the basics of using Arcade tools with Google ADK
- [Using Arcade tools](/get-started/agent-frameworks/google-adk/use-arcade-tools) - Learn the basics of using Arcade tools with Google ADK
- [Creating custom tools](/guides/create-tools/tool-basics/build-mcp-server) - Build your own tools with the Arcade Tool SDK

Enjoy exploring Arcade and building powerful AI-enabled applications!
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ The integration works through three key mechanisms:

### Next Steps

- Learn how to [use Arcade tools](/guides/agent-frameworks/mastra/use-arcade-tools) in a Mastra agent
- Implement [user authentication handling](/guides/agent-frameworks/mastra/user-auth-interrupts) for tools in multi-user applications
- Learn how to [use Arcade tools](/get-started/agent-frameworks/mastra/use-arcade-tools) in a Mastra agent
- Implement [user authentication handling](/get-started/agent-frameworks/mastra/user-auth-interrupts) for tools in multi-user applications
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ for await (const chunk of stream.textStream) {

</Steps>

<Callout type="warning" title="Initial Tool Authorization">When running your agent for the first time with tools that require user consent (like Google or Github), the agent will return an authorization reponse (e.g., `{ authorization_required: true, url: '...', message: '...' }`). Your agent's instructions should guide it to present this URL to the user. After the user visits this URL and grants permissions, the tool can be used successfully. See the [Managing user authorization](/guides/agent-frameworks/mastra/user-auth-interrupts) guide for more details on handling authentication flows.</Callout>
<Callout type="warning" title="Initial Tool Authorization">When running your agent for the first time with tools that require user consent (like Google or Github), the agent will return an authorization reponse (e.g., `{ authorization_required: true, url: '...', message: '...' }`). Your agent's instructions should guide it to present this URL to the user. After the user visits this URL and grants permissions, the tool can be used successfully. See the [Managing user authorization](/get-started/agent-frameworks/mastra/user-auth-interrupts) guide for more details on handling authentication flows.</Callout>
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ For a full list of available MCP Servers, visit the [Arcade MCP Servers](/resour

Ready to start building with Arcade and OpenAI Agents? Check out these guides:

- [Using Arcade tools](/guides/agent-frameworks/openai-agents/use-arcade-tools) - Learn the basics of using Arcade tools with OpenAI Agents
- [Managing user authorization](/guides/agent-frameworks/openai-agents/user-auth-interrupts) - Handle tool authorization efficiently
- [Using Arcade tools](/get-started/agent-frameworks/openai-agents/use-arcade-tools) - Learn the basics of using Arcade tools with OpenAI Agents
- [Managing user authorization](/get-started/agent-frameworks/openai-agents/user-auth-interrupts) - Handle tool authorization efficiently
- [Creating custom tools](/guides/create-tools/tool-basics/build-mcp-server) - Build your own tools with the Arcade Tool SDK

Enjoy exploring Arcade and building powerful AI-enabled applications!
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
```mdx
import { PlatformCard } from "@/app/_components/platform-card";
import { Tabs } from "nextra/components";

Expand Down Expand Up @@ -72,4 +71,3 @@ These guides are for developers building AI applications who need to connect Arc
</div>
</Tabs.Tab>
</Tabs>
```
Loading