diff --git a/.github/workflows/publish-agent-framework-python.yml b/.github/workflows/publish-agent-framework-python.yml new file mode 100644 index 000000000..bb46d3d3c --- /dev/null +++ b/.github/workflows/publish-agent-framework-python.yml @@ -0,0 +1,37 @@ +name: Publish Agent Framework Python + +on: + push: + branches: + - main + paths: + - "packages/agent-framework-python/pyproject.toml" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + defaults: + run: + working-directory: ./packages/agent-framework-python + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build dependencies + run: pip install hatchling build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: packages/agent-framework-python/dist/ diff --git a/.github/workflows/publish-ai-sdk.yml b/.github/workflows/publish-ai-sdk.yml index 3f69b4212..848c7a71a 100644 --- a/.github/workflows/publish-ai-sdk.yml +++ b/.github/workflows/publish-ai-sdk.yml @@ -23,8 +23,12 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: + node-version: '24' registry-url: 'https://registry.npmjs.org' + - name: Upgrade npm for trusted publishing support + run: npm install -g npm@latest + - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -34,11 +38,24 @@ jobs: - name: Install dependencies run: bun install + - name: Check if version changed + id: version-check + run: | + PACKAGE_NAME=$(jq -r '.name' package.json) + LOCAL_VERSION=$(jq -r '.version' package.json) + NPM_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "0.0.0") + if [ "$LOCAL_VERSION" = "$NPM_VERSION" ]; then + echo "Version $LOCAL_VERSION already published, skipping." + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "Publishing $LOCAL_VERSION (npm has $NPM_VERSION)" + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Build + if: steps.version-check.outputs.changed == 'true' run: bun run build - name: Publish - run: pnpm publish --access public --verbose - env: - NPM_CONFIG_PROVENANCE: true - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + if: steps.version-check.outputs.changed == 'true' + run: npm publish --access public --provenance diff --git a/.github/workflows/publish-cartesia-sdk-python.yml b/.github/workflows/publish-cartesia-sdk-python.yml new file mode 100644 index 000000000..14155ac1e --- /dev/null +++ b/.github/workflows/publish-cartesia-sdk-python.yml @@ -0,0 +1,37 @@ +name: Publish Cartesia SDK Python + +on: + push: + branches: + - main + paths: + - "packages/cartesia-sdk-python/pyproject.toml" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + defaults: + run: + working-directory: ./packages/cartesia-sdk-python + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build dependencies + run: pip install hatchling build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: packages/cartesia-sdk-python/dist/ diff --git a/.github/workflows/publish-memory-graph.yml b/.github/workflows/publish-memory-graph.yml new file mode 100644 index 000000000..295a45f68 --- /dev/null +++ b/.github/workflows/publish-memory-graph.yml @@ -0,0 +1,61 @@ +name: Publish Memory Graph + +on: + push: + branches: + - main + paths: + - "packages/memory-graph/package.json" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + defaults: + run: + working-directory: ./packages/memory-graph + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - name: Upgrade npm for trusted publishing support + run: npm install -g npm@latest + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: bun install + + - name: Check if version changed + id: version-check + run: | + PACKAGE_NAME=$(jq -r '.name' package.json) + LOCAL_VERSION=$(jq -r '.version' package.json) + NPM_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "0.0.0") + if [ "$LOCAL_VERSION" = "$NPM_VERSION" ]; then + echo "Version $LOCAL_VERSION already published, skipping." + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "Publishing $LOCAL_VERSION (npm has $NPM_VERSION)" + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Build + if: steps.version-check.outputs.changed == 'true' + run: bun run build + + - name: Publish + if: steps.version-check.outputs.changed == 'true' + run: npm publish --access public --provenance diff --git a/.github/workflows/publish-openai-sdk-python.yml b/.github/workflows/publish-openai-sdk-python.yml new file mode 100644 index 000000000..141477a84 --- /dev/null +++ b/.github/workflows/publish-openai-sdk-python.yml @@ -0,0 +1,37 @@ +name: Publish OpenAI SDK Python + +on: + push: + branches: + - main + paths: + - "packages/openai-sdk-python/pyproject.toml" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + defaults: + run: + working-directory: ./packages/openai-sdk-python + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build dependencies + run: pip install hatchling build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: packages/openai-sdk-python/dist/ diff --git a/.github/workflows/publish-pipecat-sdk-python.yml b/.github/workflows/publish-pipecat-sdk-python.yml new file mode 100644 index 000000000..a0152ce3d --- /dev/null +++ b/.github/workflows/publish-pipecat-sdk-python.yml @@ -0,0 +1,37 @@ +name: Publish Pipecat SDK Python + +on: + push: + branches: + - main + paths: + - "packages/pipecat-sdk-python/pyproject.toml" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + defaults: + run: + working-directory: ./packages/pipecat-sdk-python + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build dependencies + run: pip install hatchling build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: packages/pipecat-sdk-python/dist/ diff --git a/.github/workflows/publish-tools.yml b/.github/workflows/publish-tools.yml new file mode 100644 index 000000000..9d745203c --- /dev/null +++ b/.github/workflows/publish-tools.yml @@ -0,0 +1,61 @@ +name: Publish Tools + +on: + push: + branches: + - main + paths: + - "packages/tools/package.json" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + defaults: + run: + working-directory: ./packages/tools + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - name: Upgrade npm for trusted publishing support + run: npm install -g npm@latest + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: bun install + + - name: Check if version changed + id: version-check + run: | + PACKAGE_NAME=$(jq -r '.name' package.json) + LOCAL_VERSION=$(jq -r '.version' package.json) + NPM_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "0.0.0") + if [ "$LOCAL_VERSION" = "$NPM_VERSION" ]; then + echo "Version $LOCAL_VERSION already published, skipping." + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "Publishing $LOCAL_VERSION (npm has $NPM_VERSION)" + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Build + if: steps.version-check.outputs.changed == 'true' + run: bun run build + + - name: Publish + if: steps.version-check.outputs.changed == 'true' + run: npm publish --access public --provenance diff --git a/apps/mcp/src/index.ts b/apps/mcp/src/index.ts index 6c9f241ec..94a0bc746 100644 --- a/apps/mcp/src/index.ts +++ b/apps/mcp/src/index.ts @@ -59,6 +59,7 @@ app.get("/", (c) => { // MCP clients use this to discover the authorization server app.get("/.well-known/oauth-protected-resource", (c) => { const apiUrl = c.env.API_URL || DEFAULT_API_URL + const host = c.req.header("x-forwarded-host") || c.req.header("host") const proto = c.req.header("x-forwarded-proto") || "https" const resourceUrl = host ? `${proto}://${host}` : "https://mcp.supermemory.ai" @@ -114,18 +115,12 @@ const handleMcpRequest = async (c: Context<{ Bindings: Bindings }>) => { const token = authHeader?.replace(/^Bearer\s+/i, "") const containerTag = c.req.header("x-sm-project") const apiUrl = c.env.API_URL || DEFAULT_API_URL - const mcpURL = - c.env.API_URL === "http://localhost:8787" - ? "http://localhost:8788" - : "https://mcp.supermemory.ai" - - // TODO: commented out because this might be issue with auth - //const reqHost = c.req.header("x-forwarded-host") || c.req.header("host") || "" - //const reqProto = c.req.header("x-forwarded-proto") || "https" - //const resourceMetadataUrl = reqHost - // ? `${reqProto}://${reqHost}/.well-known/oauth-protected-resource` - // : "/.well-known/oauth-protected-resource" - const resourceMetadataUrl = `${mcpURL}/.well-known/oauth-protected-resource` + + const reqHost = c.req.header("x-forwarded-host") || c.req.header("host") || "" + const reqProto = c.req.header("x-forwarded-proto") || "https" + const resourceMetadataUrl = reqHost + ? `${reqProto}://${reqHost}/.well-known/oauth-protected-resource` + : "/.well-known/oauth-protected-resource" if (!token) { return new Response("Unauthorized", { diff --git a/packages/cartesia-sdk-python/pyproject.toml b/packages/cartesia-sdk-python/pyproject.toml index 18b3b2994..81dac7fd1 100644 --- a/packages/cartesia-sdk-python/pyproject.toml +++ b/packages/cartesia-sdk-python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "supermemory-cartesia" -version = "0.1.0" +version = "0.1.1" description = "Supermemory integration for Cartesia Line - memory-enhanced voice agents" readme = "README.md" license = "MIT" diff --git a/packages/tools/package.json b/packages/tools/package.json index f58a48f79..c4a39da4e 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,7 +1,7 @@ { "name": "@supermemory/tools", "type": "module", - "version": "1.4.02", + "version": "1.4.4", "description": "Memory tools for AI SDK and OpenAI function calling with supermemory", "scripts": { "build": "tsdown",