Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
ffb2123
Merge pull request #2 from CopilotKit/release/0.1.0
jpr5 Mar 3, 2026
cc3906e
Merge pull request #3 from CopilotKit/add-pre-commit-hook
jpr5 Mar 3, 2026
b5380f6
Make husky prepare script graceful for fresh installs
jpr5 Mar 3, 2026
10c0f98
Merge pull request #4 from CopilotKit/fix-husky-prepare
jpr5 Mar 3, 2026
8c8bd85
chore: release 1.0.0
tylerslaton Mar 3, 2026
1ee4927
Merge pull request #5 from CopilotKit/release/1.0.0
tylerslaton Mar 3, 2026
b90dfa5
docs: add unit tests badge to README
jpr5 Mar 3, 2026
fb983aa
docs: update CLAUDE.md to reflect conventional commit requirement
jpr5 Mar 3, 2026
7faa0dd
Merge pull request #7 from CopilotKit/fix-claude-md-commits
jpr5 Mar 3, 2026
131ef6c
docs: add CopilotKit kite favicon
jpr5 Mar 3, 2026
c9de7d4
Merge pull request #6 from CopilotKit/add-test-badge
jpr5 Mar 3, 2026
e530ae6
Merge pull request #8 from CopilotKit/add-favicon
jpr5 Mar 3, 2026
5f0c18b
feat: add Anthropic Claude and Google Gemini provider support
jpr5 Mar 3, 2026
b67c913
refactor: rename MockOpenAI to LLMock
jpr5 Mar 3, 2026
81ca5c9
Merge pull request #9 from CopilotKit/feat/multi-provider-llmock
jpr5 Mar 3, 2026
93fc51b
docs: rename mock-openai to llmock and add multi-provider documentation
jpr5 Mar 3, 2026
5d2951c
test: add API conformance test suite for all providers
jpr5 Mar 3, 2026
bb0aa94
Merge branch 'main' into feat/multi-provider-llmock
jpr5 Mar 3, 2026
c53d59a
Merge pull request #10 from CopilotKit/feat/multi-provider-llmock
jpr5 Mar 3, 2026
e52cbeb
fix: handle array-of-parts content in getTextContent and matchFixture
jpr5 Mar 4, 2026
c7c6a81
Merge pull request #11 from CopilotKit/feat/array-content-support
jpr5 Mar 5, 2026
dc383f0
ci: add workflow_dispatch trigger to release workflow
jpr5 Mar 5, 2026
5d32b36
docs: rewrite Why llmock section to lead with the problem
jpr5 Mar 5, 2026
7f3a466
Merge pull request #13 from CopilotKit/docs/why-llmock-copy
jpr5 Mar 5, 2026
31c3b98
Merge pull request #12 from CopilotKit/ci/workflow-dispatch
jpr5 Mar 5, 2026
0b0c4ca
feat: add prependFixture() and getFixtures() public API
jpr5 Mar 5, 2026
0f3d6be
docs: document prependFixture() and getFixtures() in README
jpr5 Mar 5, 2026
374e899
Merge pull request #14 from CopilotKit/feat/prepend-and-get-fixtures
jpr5 Mar 5, 2026
9948a8b
chore: add changeset for prependFixture/getFixtures
jpr5 Mar 5, 2026
8a19ef4
Merge pull request #15 from CopilotKit/chore/changeset-prepend-get-fi…
jpr5 Mar 5, 2026
43288e9
Version Packages
github-actions[bot] Mar 5, 2026
41b3119
Merge pull request #16 from CopilotKit/changeset-release/main
jpr5 Mar 5, 2026
ab4fd0b
chore: remove changesets, simplify release to version-bump publish
jpr5 Mar 5, 2026
cc0de6d
Merge pull request #17 from CopilotKit/chore/remove-changesets
jpr5 Mar 5, 2026
402e550
fix: use gh release create instead of bare git tag
jpr5 Mar 5, 2026
c5a3b6d
Merge pull request #18 from CopilotKit/fix/github-release-creation
jpr5 Mar 5, 2026
8e1b68b
fix: add function call IDs to Gemini tool call responses
jpr5 Mar 6, 2026
2e439a6
Merge pull request #19 from CopilotKit/fix/github-release-creation
jpr5 Mar 6, 2026
585e61d
feat: add zero-dependency RFC 6455 WebSocket framing layer
jpr5 Mar 11, 2026
3954bf6
feat: add WebSocket handler for OpenAI Responses API
jpr5 Mar 11, 2026
bc9ec6b
feat: wire WebSocket upgrade handler into server
jpr5 Mar 11, 2026
88daf5b
test: add WebSocket framing and responses integration tests
jpr5 Mar 11, 2026
9663330
feat: add OpenAI Realtime API WebSocket handler
jpr5 Mar 11, 2026
37870e8
feat: add Gemini Live BidiGenerateContent WebSocket handler
jpr5 Mar 11, 2026
edb525a
feat: wire Realtime and Gemini Live WebSocket routes into server
jpr5 Mar 11, 2026
31e0b59
docs: add Future Direction section to README
jpr5 Mar 11, 2026
9152afe
fix: correct WebSocket close-frame lifecycle bugs
jpr5 Mar 11, 2026
fdc3d8b
fix: improve error visibility across WebSocket handlers
jpr5 Mar 11, 2026
ef4a8c2
Merge pull request #21 from CopilotKit/fix/ws-review-findings
jpr5 Mar 11, 2026
e214995
Add WebSocket support: Responses API, Realtime API, and Gemini Live (…
jpr5 Mar 11, 2026
17e0d08
chore: bump version to 1.2.0 for WebSocket API support
jpr5 Mar 11, 2026
58ede2a
Bump version to 1.2.0 (#22)
jpr5 Mar 11, 2026
bcfc7c7
docs: clarify live API conformance gap in Future Direction
jpr5 Mar 11, 2026
0e34337
chore: add .worktrees/ to .gitignore
jpr5 Mar 11, 2026
49b63ce
docs: update CHANGELOG for 1.0.1, 1.1.1, and 1.2.0
jpr5 Mar 11, 2026
e9cdb14
docs: add WebSocket documentation to README and landing page
jpr5 Mar 11, 2026
f72f207
docs: add CopilotKit real-world usage reference to README and landing…
jpr5 Mar 11, 2026
278cec3
Add WebSocket docs, CHANGELOG catch-up, and CopilotKit usage referenc…
jpr5 Mar 11, 2026
9a71357
fix: correct CopilotKit test suite links in real-world usage section
jpr5 Mar 11, 2026
293d506
Fix CopilotKit test suite links (#26)
jpr5 Mar 11, 2026
8f5caba
feat: add stream interruption primitives
jpr5 Mar 11, 2026
b353f34
feat: thread interruption through HTTP SSE streaming
jpr5 Mar 11, 2026
79dd1fa
feat: thread interruption through WebSocket streaming
jpr5 Mar 11, 2026
b392042
docs: remove completed streaming items from Future Direction
jpr5 Mar 11, 2026
ed11007
fix: add delay() fast-path for aborted signals and WS disconnectAfter…
jpr5 Mar 11, 2026
dfb279e
chore: bump version to 1.3.0 for stream interruption support
jpr5 Mar 11, 2026
80edb15
test: add edge case tests for interruption primitives
jpr5 Mar 11, 2026
04ac86d
test: add HTTP SSE interruption tests for all endpoints
jpr5 Mar 11, 2026
719b94a
test: add WebSocket tool call interruption tests
jpr5 Mar 11, 2026
47dfd64
Add stream interruption support (truncateAfterChunks, disconnectAfter…
jpr5 Mar 11, 2026
ecdd4fd
test: add WebSocket API conformance tests
jpr5 Mar 11, 2026
b169bad
Merge branch 'main' into docs/future-direction-fix
jpr5 Mar 11, 2026
b625bfb
Clarify live API conformance gap in Future Direction (#23)
jpr5 Mar 11, 2026
b8fc958
Merge branch 'main' into test/ws-conformance
jpr5 Mar 11, 2026
b876d4c
Add WebSocket API conformance tests (#27)
jpr5 Mar 11, 2026
4c940b5
docs: add WebSocket row to MSW comparison table in README
jpr5 Mar 11, 2026
c885e31
Add WebSocket row to MSW comparison table (#28)
jpr5 Mar 11, 2026
97deafc
docs: add Claude Code fixture authoring skill and plugin marketplace
jpr5 Mar 12, 2026
0e3d8d1
docs: add Claude Code integration section to README and docs site
jpr5 Mar 12, 2026
9baa0fd
chore: bump version to 1.3.1, ship plugin and skill in npm package
jpr5 Mar 12, 2026
c1c90fd
Add Claude Code skill for writing llmock fixtures (#29)
jpr5 Mar 12, 2026
cb4af7a
chore: enable Git LFS for binary assets
jpr5 Mar 12, 2026
9c1166d
Enable Git LFS for binary assets (#31)
jpr5 Mar 12, 2026
d8ac185
chore: deduplicate skill via symlink
jpr5 Mar 12, 2026
63b5892
Deduplicate skill file via symlink (#32)
jpr5 Mar 12, 2026
4e15e1d
fix: add missing refusal field to OpenAI Chat Completions responses
jpr5 Mar 15, 2026
dc58492
feat: add live API drift detection test suite
jpr5 Mar 15, 2026
7a961f8
chore: bump version to 1.3.2
jpr5 Mar 15, 2026
e75918a
Add live API drift detection + fix missing refusal field (#33)
jpr5 Mar 15, 2026
756127b
docs: site layout and README improvements
jpr5 Mar 15, 2026
667206e
fix: use flat response.create format in Responses WS handler
jpr5 Mar 15, 2026
086f45f
test: add WebSocket drift detection for Responses WS, Realtime, and G…
jpr5 Mar 15, 2026
e5870ed
docs: document WS drift coverage, bump to 1.3.3
jpr5 Mar 15, 2026
a26b3db
Add WebSocket drift detection tests (#37)
jpr5 Mar 15, 2026
697a161
docs: add Reliability section to docs site, switch drift CI to daily
jpr5 Mar 16, 2026
aae2b07
Add Reliability section to docs site, switch drift CI to daily (#38)
jpr5 Mar 16, 2026
ce2a85d
docs: add drift tests badge to README
jpr5 Mar 16, 2026
44fec2f
Add drift tests badge to README (#39)
jpr5 Mar 16, 2026
0fc4c2d
feat: add Logger class and thread through server handlers
jpr5 Mar 16, 2026
65ce898
feat: add fixture validation and optional logger to fixture-loader
jpr5 Mar 16, 2026
6f856d3
feat: add --watch, --log-level, --validate-on-load CLI flags
jpr5 Mar 16, 2026
9285e78
chore: bump version to 1.4.0
jpr5 Mar 16, 2026
fb0b56b
merge: add --watch, --log-level, --validate-on-load CLI flags (#40)
jpr5 Mar 16, 2026
b6d756f
fix: watcher cleanup, empty-reload guard, and stale README
jpr5 Mar 19, 2026
5e47385
Fix watcher cleanup, empty-reload guard, and stale README (#43)
jpr5 Mar 19, 2026
4b6f190
feat: add automated drift remediation pipeline
jpr5 Mar 19, 2026
afb03e0
Automated drift remediation pipeline (#41)
jpr5 Mar 20, 2026
cb0ce64
feat: add embeddings, structured output, sequential responses, and st…
jpr5 Mar 20, 2026
5339afc
feat: add embeddings endpoint handler
jpr5 Mar 20, 2026
4aa6712
feat: add health/models endpoints, provider routing, and handler updates
jpr5 Mar 20, 2026
043fede
feat: add AWS Bedrock invoke endpoint
jpr5 Mar 20, 2026
05ccc41
test: add comprehensive tests for all new features and drift canaries
jpr5 Mar 20, 2026
ca8e4a7
chore: add Dockerfile, Helm chart, CI workflows, and competitive matr…
jpr5 Mar 20, 2026
2624669
docs: add documentation website with feature pages and competitive ma…
jpr5 Mar 20, 2026
a165705
Competitive feature parity: embeddings, structured output, sequential…
jpr5 Mar 20, 2026
a3b772c
fix: validate clientContent.turns and toolResponse.functionResponses …
jpr5 Mar 20, 2026
a74a2de
fix: add isClosed guard before WebSocket finalization events
jpr5 Mar 20, 2026
cf0e69b
fix: default to non-streaming for Claude Messages and Responses API
jpr5 Mar 20, 2026
e27be90
Fix pre-existing bugs: Gemini Live validation, WS finalization guards…
jpr5 Mar 20, 2026
353d047
docs: rethink README as concise overview, improve index.html
jpr5 Mar 20, 2026
8fa34c4
docs: update write-fixtures skill for v1.5.0 features
jpr5 Mar 20, 2026
2a7650c
fix: add streamingProfile to convenience method opts types
jpr5 Mar 20, 2026
e1b4ca5
chore: fix pre-existing lint config and dead CSS
jpr5 Mar 20, 2026
d523ee5
refactor: extract FixtureOpts type alias from repeated inline types
jpr5 Mar 20, 2026
7910565
fix: swap symlink direction so npm pack includes skills/
jpr5 Mar 20, 2026
26d843a
fix: export FixtureOpts types, remove dead .claude from files
jpr5 Mar 20, 2026
4d831e1
chore: bump version to 1.5.0
jpr5 Mar 20, 2026
a2b3012
merge: release v1.5.0 (#48)
jpr5 Mar 20, 2026
183c57d
chore: bump version to 1.5.1
jpr5 Mar 20, 2026
19d953e
docs: add three-way comparison triangle diagram to drift detection page
jpr5 Mar 20, 2026
c9d57a6
docs: cache pnpm store in Docker builds via BuildKit mount
jpr5 Mar 20, 2026
f3ad7f5
docs/drift detection update and buildkit caching (#51)
jpr5 Mar 20, 2026
3c85146
test: expand sequential response coverage across providers and edge c…
jpr5 Mar 20, 2026
8c35c1a
test: add embedding edge case coverage (base64, empty input, sequenti…
jpr5 Mar 20, 2026
9a0c46f
test: add structured output coverage (streaming json, json_schema, co…
jpr5 Mar 20, 2026
6097baa
test: add streaming physics coverage (combined features, boundary val…
jpr5 Mar 20, 2026
eb3a4d1
feat: add chaos injection for fault tolerance testing
jpr5 Mar 20, 2026
4974a28
fix: provider-specific error response formats
jpr5 Mar 20, 2026
dfac6b0
test: expand provider, fixture, and error coverage
jpr5 Mar 20, 2026
bbd3554
test: add WebSocket concurrent serialization, fragmentation, and mult…
jpr5 Mar 20, 2026
d3eebc2
test: expand sequential response coverage across providers and edge c…
jpr5 Mar 20, 2026
5cdf1d2
chore: add engines field, @types/node, tsx; remove stale spec file
jpr5 Mar 21, 2026
900399b
feat: v1.6.0 — provider endpoints, chaos, metrics, record-and-replay
jpr5 Mar 21, 2026
2773d9b
test: 1250 tests — comprehensive coverage for all v1.6.0 features
jpr5 Mar 21, 2026
402c8fa
docs: v1.6.0 documentation — 6 new pages, update all existing pages
jpr5 Mar 21, 2026
6be3821
chore: bump version to 1.6.0, update Chart.yaml appVersion, add CHANG…
jpr5 Mar 21, 2026
8f14082
fix: type safety — RecordProviderKey, null journal body, exhaustive c…
jpr5 Mar 21, 2026
63e718d
fix: observability — metrics crash guard, Bedrock truncation warning …
jpr5 Mar 21, 2026
3d479ef
docs: correct --strict mode documentation in SKILL.md
jpr5 Mar 21, 2026
de8cfc3
test: cover metrics crash guard and Bedrock CRC truncation
jpr5 Mar 21, 2026
3657cf1
test: add unit tests for drift remediation scripts
jpr5 Mar 21, 2026
3fd1ec1
fix: chaos header validation, range clamping, and disconnect integrat…
jpr5 Mar 21, 2026
65a5b1c
fix: add error handling around metrics instrumentation in response fi…
jpr5 Mar 21, 2026
e454c12
refactor: tighten recorder pipeline typing with RecordProviderKey
jpr5 Mar 21, 2026
7807b1e
feat: validate StreamingProfile and ChaosConfig ranges at fixture loa…
jpr5 Mar 21, 2026
8014b70
docs: correct docker.html errors, add missing endpoints, fix CHANGELO…
jpr5 Mar 21, 2026
72eda7c
fix: structured logger for chaos/stream warnings; EventStream bounds;…
jpr5 Mar 21, 2026
cb09880
test: regression coverage for logger migration, EventStream bounds, b…
jpr5 Mar 21, 2026
8540122
fix: address review — recorder logging, strict fail-fast, chaos valid…
jpr5 Mar 22, 2026
c694c9b
docs: fix endpoint label (Groq not Azure) and metrics port (4010 not …
jpr5 Mar 22, 2026
206bc45
merge: Provider Endpoints, Chaos, Metrics, Record-and-Replay (#53)
jpr5 Mar 22, 2026
6ca3f60
docs: update competitive matrix from latest competitor data
github-actions[bot] Mar 23, 2026
80bea94
Update competitive matrix (#54)
jpr5 Mar 23, 2026
97cfb1b
feat: add --summary flag to competitive matrix script
jpr5 Mar 23, 2026
e0a2b63
test: add unit tests for competitive matrix summary formatting
jpr5 Mar 23, 2026
be8bd34
ci: use --body-file for competitive matrix PR body
jpr5 Mar 23, 2026
604e447
Add change summary and diagram to competitive matrix PRs (#55)
jpr5 Mar 23, 2026
958add3
feat: add requestTransform for deterministic fixture matching and rec…
iskhakovt Mar 30, 2026
75d0dfa
docs: add requestTransform section to record-replay docs
iskhakovt Mar 30, 2026
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
7 changes: 0 additions & 7 deletions .changeset/config.json

This file was deleted.

17 changes: 17 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "copilotkit-tools",
"owner": {
"name": "CopilotKit"
},
"plugins": [
{
"name": "llmock",
"source": {
"source": "npm",
"package": "@copilotkit/llmock",
"version": "^1.5.0"
},
"description": "Fixture authoring skill for @copilotkit/llmock — match fields, response types, embeddings, structured output, sequential responses, streaming physics, agent loop patterns, gotchas, and debugging"
}
]
}
12 changes: 12 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "llmock",
"version": "1.5.0",
"description": "Fixture authoring guidance for @copilotkit/llmock",
"author": {
"name": "CopilotKit"
},
"homepage": "https://github.com/CopilotKit/llmock",
"repository": "https://github.com/CopilotKit/llmock",
"license": "MIT",
"skills": "./skills"
}
1 change: 1 addition & 0 deletions .claude/commands/write-fixtures.md
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
.git
src/__tests__
docs
.worktrees
.github
coverage
*.md
dist
.claude
.claude-plugin
skills
.husky
.vscode
.idea
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.gif filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.webm filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
docs/favicon.svg !filter !diff !merge
128 changes: 128 additions & 0 deletions .github/workflows/fix-drift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Fix Drift
on:
workflow_dispatch:
workflow_run:
workflows: ["Drift Tests"]
types: [completed]
branches: [main]

concurrency:
group: drift-fix
cancel-in-progress: false

jobs:
fix:
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile

# Step 0: Configure git identity and create fix branch
- name: Configure git
run: |
git config user.name "llmock-drift-bot"
git config user.email "drift-bot@copilotkit.ai"
git checkout -B fix/drift-$(date +%Y-%m-%d)-${{ github.run_id }}

# Step 1: Detect drift and produce report
- name: Collect drift report
id: detect
run: |
set +e
npx tsx scripts/drift-report-collector.ts
EXIT_CODE=$?
set -e
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
if [ "$EXIT_CODE" -eq 2 ]; then
: # critical drift found, continue
elif [ "$EXIT_CODE" -ne 0 ]; then
echo "::error::Collector script crashed with exit code $EXIT_CODE"
exit $EXIT_CODE
fi
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

# Always upload the report as an artifact
- name: Upload drift report
if: always()
uses: actions/upload-artifact@v4
with:
name: drift-report
path: drift-report.json
if-no-files-found: warn
retention-days: 30

# Step 2: Exit if no critical drift
- name: Check for critical diffs
id: check
env:
DETECT_EXIT_CODE: ${{ steps.detect.outputs.exit_code }}
run: |
if [ "$DETECT_EXIT_CODE" = "2" ]; then
echo "skip=false" >> $GITHUB_OUTPUT
echo "Critical drift detected"
else
echo "skip=true" >> $GITHUB_OUTPUT
echo "No critical drift detected (exit code: $DETECT_EXIT_CODE) — skipping fix"
fi

# Step 3: Invoke Claude Code to fix
- name: Auto-fix drift
if: steps.check.outputs.skip != 'true'
run: npx tsx scripts/fix-drift.ts
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

# Upload Claude Code output for debugging
- name: Upload Claude Code logs
if: always()
uses: actions/upload-artifact@v4
with:
name: claude-code-output
path: claude-code-output.log
if-no-files-found: warn
retention-days: 30

# Step 4: Verify fix independently
- name: Verify conformance
if: steps.check.outputs.skip != 'true'
run: pnpm test

- name: Verify drift resolved
if: steps.check.outputs.skip != 'true'
run: pnpm test:drift
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

# Step 5: Create PR on success
- name: Create PR
if: success() && steps.check.outputs.skip != 'true'
run: npx tsx scripts/fix-drift.ts --create-pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Step 6: Open issue on failure
- name: Create issue on failure
if: failure() && steps.check.outputs.skip != 'true'
run: npx tsx scripts/fix-drift.ts --create-issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish Docker Image

on:
push:
tags:
- "v*"
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
29 changes: 24 additions & 5 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release
on:
push:
branches: [main]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -14,11 +15,29 @@ jobs:
cache: pnpm
registry-url: "https://registry.npmjs.org"
- run: pnpm install --frozen-lockfile
- uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm changeset version

- name: Check if version is already published
id: check
run: |
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")
if npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null; then
echo "published=true" >> "$GITHUB_OUTPUT"
else
echo "published=false" >> "$GITHUB_OUTPUT"
fi

- name: Build and publish
if: steps.check.outputs.published == 'false'
run: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
if: steps.check.outputs.published == 'false'
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
gh release create "v${PKG_VERSION}" --generate-notes --title "v${PKG_VERSION}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/test-drift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Drift Tests
on:
schedule:
- cron: "0 6 * * *" # Daily 6am UTC
workflow_dispatch: # Manual trigger
jobs:
drift:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile

- name: Run drift tests
id: drift
run: |
set +e
npx tsx scripts/drift-report-collector.ts
EXIT_CODE=$?
set -e
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
if [ "$EXIT_CODE" -eq 2 ]; then
: # critical drift found, continue
elif [ "$EXIT_CODE" -ne 0 ]; then
echo "::error::Collector script crashed with exit code $EXIT_CODE"
exit $EXIT_CODE
fi
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

- name: Upload drift report
if: always()
uses: actions/upload-artifact@v4
with:
name: drift-report
path: drift-report.json
if-no-files-found: warn
retention-days: 30

- name: Fail if critical drift detected
if: steps.drift.outputs.exit_code == '2'
run: exit 1
Loading
Loading