Skip to content

Commit 7a39a30

Browse files
authored
Merge branch 'main' into worktree-ssrf-redirect-fix
2 parents 8593b89 + a046e6a commit 7a39a30

15,971 files changed

Lines changed: 3260490 additions & 18315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ chromadb-*.lock
3131
blogs/*
3232
secrets/*
3333
UNKNOWN.egg-info/
34+
demos/*
35+
.crewai/*

AGENTS.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Docs contributor guide
2+
3+
The `docs/` directory is published at [docs.crewai.com](https://docs.crewai.com)
4+
by [Mintlify](https://www.mintlify.com/). Mintlify watches `docs/docs.json`
5+
and the MDX files referenced from it.
6+
7+
## TL;DR for editing docs
8+
9+
- Edit MDX under `docs/edge/<lang>/...` (e.g. `docs/edge/en/concepts/agents.mdx`).
10+
- Your change ships under the **Edge** version selector the moment it merges
11+
to `main`. Edge follows `main` and is the channel for unreleased work.
12+
- On release cut, the current Edge state is frozen into `docs/v<X.Y.Z>/` and
13+
that snapshot becomes the new default version in the selector (tag:
14+
`Latest`). Canonical URLs (`/<lang>/...`) auto-redirect to the new default.
15+
- Never modify files under `docs/v*/`. Those are frozen release snapshots
16+
and the `docs-snapshots` CI guard rejects writes. The only exception is a
17+
release-cut PR (auto-generated by `devtools release` or the manual
18+
`scripts/docs/freeze_current_edge.py` wrapper), which uses a
19+
`[docs-freeze]` title prefix to opt out.
20+
- Never delete or rename files under `docs/images/`. Images are append-only.
21+
See [Images](#images) below.
22+
23+
## The version model
24+
25+
The site has one rolling channel (Edge) plus one frozen snapshot per
26+
release.
27+
28+
```
29+
docs/
30+
edge/ <-- Edge sources (you edit here)
31+
en/...
32+
pt-BR/ ko/ ar/
33+
enterprise-api.*.yaml
34+
35+
v1.14.7/ <-- frozen snapshot of v1.14.7
36+
en/...
37+
pt-BR/ ko/ ar/
38+
enterprise-api.*.yaml
39+
v1.14.6/...
40+
...
41+
42+
images/ <-- shared, append-only
43+
docs.json <-- Mintlify config: navigation + redirects
44+
```
45+
46+
`docs/docs.json` lists one navigation block per version per language. Edge
47+
points at `docs/edge/<lang>/...`; every other version points at its own
48+
`docs/v<X.Y.Z>/<lang>/...` subtree. Mintlify scopes both the sidebar and the
49+
in-site search to whichever version the reader selects, so picking
50+
`v1.10.0` genuinely shows the v1.10.0 docs (and only those).
51+
52+
### URLs and canonical redirects
53+
54+
Each Mintlify version corresponds to its own URL prefix:
55+
56+
- Edge: `/edge/<lang>/<page>` (e.g. `/edge/en/concepts/agents`)
57+
- Frozen: `/v<X.Y.Z>/<lang>/<page>` (e.g. `/v1.14.7/en/concepts/agents`)
58+
59+
External links to the old, unversioned `/<lang>/<page>` URLs would 404 under
60+
this layout. To keep them working, `docs.json` ships wildcard redirects:
61+
62+
```jsonc
63+
{ "source": "/en/:slug*", "destination": "/v1.14.7/en/:slug*", "permanent": false }
64+
```
65+
66+
The release-cut step rewrites the destination on every release so canonical
67+
`/<lang>/...` URLs always resolve to the latest stable docs.
68+
69+
## Lifecycle
70+
71+
1. **During development.** You add or edit pages under
72+
`docs/edge/<lang>/...` in normal PRs. They land in Edge as soon as the PR
73+
merges. Both `/edge/<lang>/<page>` and the version selector's `Edge` entry
74+
reflect the change immediately.
75+
2. **Release cut.** The release engineer runs `devtools release X.Y.Z`. As
76+
part of that flow the CLI opens a `[docs-freeze]` PR that copies Edge into
77+
`docs/v<X.Y.Z>/`, rewrites internal OpenAPI references, updates
78+
`docs/docs.json` to make `v<X.Y.Z>` the new default + `Latest`, and rewires
79+
the canonical-URL redirects to the new default. The PR must merge before
80+
the tag and PyPI publish run.
81+
3. **After release.** Edge keeps rolling. Patch fixes to the just-released
82+
docs go into Edge and ship with the next release. We do not back-edit
83+
frozen snapshots.
84+
85+
See [`RELEASING.md`](RELEASING.md) for the full release runbook.
86+
87+
## Images
88+
89+
Snapshots share a single `docs/images/` directory. If an image is deleted
90+
or renamed, every frozen snapshot that referenced it breaks. So the rule
91+
is:
92+
93+
- Adding new images is always fine.
94+
- Deleting or renaming an existing image fails CI unless the PR is a
95+
`[docs-freeze]` release-cut PR.
96+
- If an asset is wrong, add a new file with a new name and reference the
97+
new name in the Edge MDX (`docs/edge/<lang>/...`). Leave the old file
98+
alone.
99+
100+
## Local preview
101+
102+
Install the Mintlify CLI and run from `docs/`:
103+
104+
```bash
105+
npm i -g mintlify
106+
mintlify dev
107+
```
108+
109+
Use the version selector at the top of the rendered page to switch between
110+
Edge and frozen versions.
111+
112+
To check links across every version:
113+
114+
```bash
115+
mintlify broken-links
116+
```
117+
118+
CI runs the broken-links check on every PR that touches `docs/**` via
119+
[`.github/workflows/docs-broken-links.yml`](.github/workflows/docs-broken-links.yml).
120+
121+
## Scripts
122+
123+
- `scripts/docs/freeze_historical_versions.py` — one-time migration that
124+
reconstructed `docs/v1.10.0/` through `docs/v1.14.7/` from git tags. You
125+
should not need to run this again.
126+
- `scripts/docs/prefix_version_paths.py` — one-time migration that switched
127+
`docs/docs.json` to directory-based versioning, inserted Edge, and added
128+
the canonical-URL redirects. You should not need to run this again.
129+
- `scripts/docs/freeze_current_edge.py` — thin CLI wrapper around
130+
`crewai_devtools.docs_versioning.freeze`. `devtools release` calls the
131+
same module during its docs PR step; this script is the manual escape
132+
hatch (e.g. retroactively freezing a forgotten release).
133+
134+
## CI guards
135+
136+
- [`.github/workflows/docs-snapshots.yml`](.github/workflows/docs-snapshots.yml)
137+
enforces the two rules above (frozen snapshots immutable, images
138+
append-only). Both checks accept the `[docs-freeze]` PR-title escape
139+
hatch.
140+
- [`.github/workflows/docs-broken-links.yml`](.github/workflows/docs-broken-links.yml)
141+
runs `mintlify broken-links` against the whole site, so adding a new
142+
page or moving a snapshot file that breaks a link will fail CI.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,19 @@ CrewAI is open-source and we welcome contributions. If you're looking to contrib
601601
- Send a pull request.
602602
- We appreciate your input!
603603

604+
### Contributing to the docs
605+
606+
The site at [docs.crewai.com](https://docs.crewai.com) is published from
607+
`docs/` by [Mintlify](https://www.mintlify.com/). The docs use directory-based
608+
versioning: edits to `docs/edge/<lang>/...` (e.g.
609+
`docs/edge/en/concepts/agents.mdx`) land under the **Edge** version selector
610+
immediately and are frozen into a new versioned snapshot under
611+
`docs/v<X.Y.Z>/` at the next release cut. Frozen snapshots are immutable — CI
612+
rejects PRs that modify them without a `[docs-freeze]` title prefix. The
613+
release CLI (`devtools release`) handles the freeze automatically; see
614+
[`AGENTS.md`](AGENTS.md) for the full contributor guide and
615+
[`RELEASING.md`](RELEASING.md) for the release-cut runbook.
616+
604617
### Installing Dependencies
605618

606619
```bash

conftest.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,21 @@ def bedrock_host_matcher(r1: Request, r2: Request) -> bool: # type: ignore[no-a
134134
)
135135

136136

137-
def _patched_make_vcr_request(httpx_request: Any, **kwargs: Any) -> Any:
137+
def _patched_make_vcr_request(
138+
httpx_request: Any, real_request_body: Any = None, **kwargs: Any
139+
) -> Any:
138140
"""Patched version of VCR's _make_vcr_request that handles binary content.
139141
140142
The original implementation fails on binary request bodies (like file uploads)
141143
because it assumes all content can be decoded as UTF-8.
142144
"""
143-
raw_body = httpx_request.read()
144-
try:
145-
body = raw_body.decode("utf-8")
146-
except UnicodeDecodeError:
147-
body = base64.b64encode(raw_body).decode("ascii")
145+
raw_body = real_request_body if real_request_body is not None else httpx_request.read()
146+
body: Any = raw_body
147+
if isinstance(raw_body, bytes):
148+
try:
149+
body = raw_body.decode("utf-8")
150+
except UnicodeDecodeError:
151+
body = base64.b64encode(raw_body).decode("ascii")
148152
uri = str(httpx_request.url)
149153
headers = dict(httpx_request.headers)
150154
return Request(httpx_request.method, uri, body, headers)

0 commit comments

Comments
 (0)