Skip to content

Commit b5ff9ac

Browse files
authored
Merge branch 'main' into feat/mcp-tool-filtering-js
2 parents 5ab34ae + d9c4ddf commit b5ff9ac

File tree

6 files changed

+117
-26
lines changed

6 files changed

+117
-26
lines changed

.changeset/icy-clouds-battle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openai/agents-core': patch
3+
---
4+
5+
include JsonSchema definitions in mcpTool inputSchema

.github/workflows/release-tag.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Create Release Tag
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
CI: true
10+
11+
jobs:
12+
create-tag:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Determine if latest commit is a version bump
23+
id: check
24+
run: |
25+
commit_message=$(git log -1 --pretty=%B)
26+
echo "Latest commit message: $commit_message"
27+
if [[ "$commit_message" == "chore: update versions"* ]]; then
28+
echo "is_version_bump=true" >> "$GITHUB_OUTPUT"
29+
else
30+
echo "is_version_bump=false" >> "$GITHUB_OUTPUT"
31+
fi
32+
33+
- name: Create and push git tag
34+
if: steps.check.outputs.is_version_bump == 'true'
35+
run: |
36+
version=$(jq -r '.version' packages/agents/package.json)
37+
tag="v${version}"
38+
echo "Tag derived from package version: $tag"
39+
40+
if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
41+
echo "Tag $tag already exists. Skipping."
42+
exit 0
43+
fi
44+
45+
git config user.name "github-actions[bot]"
46+
git config user.email "github-actions[bot]@users.noreply.github.com"
47+
git tag -a "$tag" -m "Release $tag"
48+
git push origin "$tag"

.github/workflows/release.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Changesets
1+
name: Changesets Release
22

33
on:
44
workflow_run:
@@ -45,34 +45,10 @@ jobs:
4545
with:
4646
commit: 'chore: update versions'
4747
title: 'chore: update versions'
48+
version: pnpm bump-version
4849
publish: pnpm ci:publish
4950
env:
5051
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5152
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5253
NPM_CONFIG_PROVENANCE: true
5354
NPM_CONFIG_ACCESS: public
54-
55-
- name: Push metadata changes
56-
run: |
57-
files="packages/agents-core/src/metadata.ts packages/agents-extensions/src/metadata.ts packages/agents-openai/src/metadata.ts packages/agents-realtime/src/metadata.ts packages/agents/src/metadata.ts"
58-
if git diff --quiet -- $files; then
59-
echo "No metadata changes to push"
60-
else
61-
# -- Commit all the metadata.ts files --
62-
git config user.name "github-actions[bot]"
63-
git config user.email "github-actions[bot]@users.noreply.github.com"
64-
git add $files
65-
git commit -m "chore: sync metadata files"
66-
git push origin HEAD:main
67-
# -- Push a new release tag as well --
68-
# We don't use changeset release command because we always do release for all the packages
69-
# Thus, creating git tags manually here
70-
version=$(jq -r '.version' packages/agents/package.json)
71-
tag="v${version}"
72-
if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
73-
echo "Tag $tag already exists"
74-
else
75-
git tag -a "$tag" -m "Release $tag"
76-
git push origin "$tag"
77-
fi
78-
fi

.github/workflows/update-docs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Update Translated Docs"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- '!docs/src/content/docs/ja/**'
10+
11+
jobs:
12+
update-docs:
13+
if: "!contains(github.event.head_commit.message, 'Update all translated document pages')"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 10.13.1
24+
run_install: false
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: 'pnpm'
30+
- name: Install dependencies
31+
run: pnpm install
32+
33+
- name: Translate docs
34+
env:
35+
OPENAI_API_KEY: ${{ secrets.PROD_OPENAI_API_KEY }}
36+
run: pnpm docs:translate
37+
38+
- name: Commit changes
39+
id: commit
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git add docs/
44+
if [ -n "$(git status --porcelain)" ]; then
45+
git commit -m "Update all translated document pages"
46+
echo "committed=true" >> "$GITHUB_OUTPUT"
47+
else
48+
echo "No changes to commit"
49+
echo "committed=false" >> "$GITHUB_OUTPUT"
50+
fi
51+
52+
- name: Create Pull Request
53+
if: steps.commit.outputs.committed == 'true'
54+
uses: peter-evans/create-pull-request@v6
55+
with:
56+
commit-message: "Update all translated document pages"
57+
title: "Update all translated document pages"
58+
body: "Automated update of translated documentation"
59+
branch: update-translated-docs-${{ github.run_id }}
60+
delete-branch: true

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"examples:tools-web-search": "pnpm -F tools start:web-search",
4040
"examples:tool-filter": "tsx examples/mcp/tool-filter-example.ts",
4141
"ci:publish": "pnpm publish -r --no-git-checks",
42+
"bump-version": "changeset version && pnpm -F @openai/* prebuild",
4243
"prepare": "husky",
4344
"clear:deps": "rm -rf node_modules && pnpm -r exec rm -rf node_modules",
4445
"local-npm:reset": "rm -rf .cache/verdaccio/storage",

packages/agents-core/src/mcp.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ export function mcpToFunctionTool(
366366
}
367367

368368
const schema: JsonObjectSchema<any> = {
369+
...mcpTool.inputSchema,
369370
type: mcpTool.inputSchema?.type ?? 'object',
370371
properties: mcpTool.inputSchema?.properties ?? {},
371372
required: mcpTool.inputSchema?.required ?? [],

0 commit comments

Comments
 (0)