Skip to content
Merged
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
73 changes: 73 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Auto-update types from OpenAPI

on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual trigger

jobs:
update-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Fetch latest OpenAPI schemas
run: npm run update-schemas

- name: Check for changes
id: git-check
run: |
git diff --exit-code src/types/ || echo "changed=true" >> $GITHUB_OUTPUT

- name: Commit and push if changed
if: steps.git-check.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add src/types/ openapi.yaml media-agent-openapi.yaml
git commit -m "chore: update types from OpenAPI spec"
git push

- name: Create changeset
if: steps.git-check.outputs.changed == 'true'
run: |
cat << EOF > .changeset/auto-update-$(date +%s).md
---
"@scope3/agentic-client": patch
---

Update types from latest OpenAPI specification
EOF
git add .changeset/
git commit -m "chore: create changeset for type updates"
git push

- name: Version packages
if: steps.git-check.outputs.changed == 'true'
run: |
npx changeset version
git add .
git commit -m "chore: version packages"
git push

- name: Build and publish
if: steps.git-check.outputs.changed == 'true'
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -38,5 +39,5 @@ jobs:
commit: 'chore: version packages'
title: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "TypeScript client for the Scope3 Agentic API with AdCP webhook support",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
},
"bin": {
"simple-media-agent": "dist/simple-media-agent-server.js"
},
Expand Down Expand Up @@ -32,6 +35,14 @@
],
"author": "",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/scope3data/agentic-client.git"
},
"bugs": {
"url": "https://github.com/scope3data/agentic-client/issues"
},
"homepage": "https://github.com/scope3data/agentic-client#readme",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.20.1",
"express": "^4.18.0",
Expand Down