diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dcbee3a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Release + +on: + push: + tags: + - "v*" + +permissions: {} + +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + +jobs: + release: + name: Stage npm package and create GitHub release + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + persist-credentials: false + - name: Validate release version + run: | + package_version="$(node -p "require('./plugins/tracing/package.json').version")" + manifest_version="$(node -p "require('./plugins/tracing/.codex-plugin/plugin.json').version")" + if [[ "$GITHUB_REF_NAME" != "v$package_version" ]]; then + echo "Tag $GITHUB_REF_NAME does not match package.json version $package_version" >&2 + exit 1 + fi + if [[ "$manifest_version" != "$package_version" ]]; then + echo "plugin.json version $manifest_version does not match package.json version $package_version" >&2 + exit 1 + fi + - name: Setup pnpm + uses: pnpm/action-setup@v5 + - name: Setup Node.js + uses: actions/setup-node@v7 + with: + node-version: 22.x + registry-url: https://registry.npmjs.org + package-manager-cache: false + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Lint + run: pnpm run lint + - name: Test + run: pnpm test + - name: Stage npm package + working-directory: plugins/tracing + run: | + if [[ "$GITHUB_REF_NAME" == *-* ]]; then + pnpm exec npm stage publish --provenance --access public --tag next + else + pnpm exec npm stage publish --provenance --access public + fi + - name: Create draft GitHub release + run: gh release create "$GITHUB_REF_NAME" --draft --generate-notes --verify-tag + env: + GH_TOKEN: ${{ github.token }} diff --git a/package.json b/package.json index 2b3bb20..f910956 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { - "name": "@langfuse/codex-observability-plugin", + "name": "codex-observability-plugin-workspace", "version": "0.1.0", + "private": true, "description": "OpenAI Codex plugin that traces agent turns, tool calls, and subagents to Langfuse", "keywords": [ "codex", @@ -43,6 +44,7 @@ }, "devDependencies": { "@types/node": "^22.10.0", + "npm": "11.15.0", "prettier": "^3.9.4", "tsdown": "^0.18.0", "typescript": "^5.7.2", diff --git a/plugins/tracing/package.json b/plugins/tracing/package.json new file mode 100644 index 0000000..8a776df --- /dev/null +++ b/plugins/tracing/package.json @@ -0,0 +1,37 @@ +{ + "name": "@langfuse/codex-observability-plugin", + "version": "0.1.0", + "description": "Langfuse observability plugin for the OpenAI Codex coding agent for tracing prompts, agent turns, model generations, and tool calls.", + "license": "MIT", + "author": "Langfuse", + "type": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/langfuse/codex-observability-plugin.git", + "directory": "plugins/tracing" + }, + "bugs": { + "url": "https://github.com/langfuse/codex-observability-plugin/issues" + }, + "homepage": "https://github.com/langfuse/codex-observability-plugin#readme", + "keywords": [ + "codex", + "codex-plugin", + "langfuse", + "openai", + "observability", + "tracing", + "opentelemetry" + ], + "files": [ + ".codex-plugin", + "hooks", + "dist" + ], + "scripts": { + "prepack": "pnpm -w run build" + }, + "engines": { + "node": ">=22" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f55caa8..74b9a7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ importers: '@types/node': specifier: ^22.10.0 version: 22.19.19 + npm: + specifier: 11.15.0 + version: 11.15.0 prettier: specifier: ^3.9.4 version: 3.9.4 @@ -738,6 +741,77 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + npm@11.15.0: + resolution: {integrity: sha512-+k0tk7lRnpMUPnC7kTuU/yrV/mnFoPhJQ75VfLtZ6fwbzOVXaPsTE/Il9Pn1DHi482byMyqkHv/XsQ76mNjXLw==} + engines: {node: ^20.17.0 || >=22.9.0} + hasBin: true + bundledDependencies: + - '@isaacs/string-locale-compare' + - '@npmcli/arborist' + - '@npmcli/config' + - '@npmcli/fs' + - '@npmcli/map-workspaces' + - '@npmcli/metavuln-calculator' + - '@npmcli/package-json' + - '@npmcli/promise-spawn' + - '@npmcli/redact' + - '@npmcli/run-script' + - '@sigstore/tuf' + - abbrev + - archy + - cacache + - chalk + - ci-info + - fastest-levenshtein + - fs-minipass + - glob + - graceful-fs + - hosted-git-info + - ini + - init-package-json + - is-cidr + - json-parse-even-better-errors + - libnpmaccess + - libnpmdiff + - libnpmexec + - libnpmfund + - libnpmorg + - libnpmpack + - libnpmpublish + - libnpmsearch + - libnpmteam + - libnpmversion + - make-fetch-happen + - minimatch + - minipass + - minipass-pipeline + - ms + - node-gyp + - nopt + - npm-audit-report + - npm-install-checks + - npm-package-arg + - npm-pick-manifest + - npm-profile + - npm-registry-fetch + - npm-user-validate + - p-map + - pacote + - parse-conflict-json + - proc-log + - qrcode-terminal + - read + - semver + - spdx-expression-parse + - ssri + - supports-color + - tar + - text-table + - tiny-relative-date + - treeverse + - validate-npm-package-name + - which + obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} @@ -1513,6 +1587,8 @@ snapshots: nanoid@3.3.15: {} + npm@11.15.0: {} + obug@2.1.1: {} pathe@2.0.3: {}