diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94fa8eb..a337493 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,9 +68,9 @@ jobs: run: npm test - name: Install Next.js example - working-directory: examples/nextjs-basic + working-directory: examples/integrations/nextjs-basic run: npm ci - name: Build Next.js example - working-directory: examples/nextjs-basic + working-directory: examples/integrations/nextjs-basic run: npm run build diff --git a/README.md b/README.md index e7eaae6..f264c19 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,11 @@ npm install @rlippmann/context-compiler ## Examples -- `examples/nextjs-basic/` — minimal Next.js App Router integration +- `examples/integrations/nextjs-basic/` — minimal Next.js App Router integration - request flow with compiler state where explicit instructions stay consistent across turns - `clarify` blocks LLM calls - per-session compiler state via checkpoint export/import so sessions can resume safely -- `examples/node-basic/` — minimal Node HTTP server integration +- `examples/integrations/node-basic/` — minimal Node HTTP server integration - `examples/integrations/vercel_ai_sdk_structured_output/` — host-side schema selection for Vercel AI SDK structured output ## Quick Start diff --git a/examples/README.md b/examples/README.md index 72058a5..213c221 100644 --- a/examples/README.md +++ b/examples/README.md @@ -44,4 +44,6 @@ Shows that preview does not mutate live engine state, then applies the same inpu ## Integrations -- [`examples/integrations/vercel_ai_sdk_structured_output/README.md`](/Users/rlippmann/Source/context-compiler-ts/examples/integrations/vercel_ai_sdk_structured_output/README.md) +- [Next.js integration](integrations/nextjs-basic/README.md) +- [Node integration](integrations/node-basic/README.md) +- [Vercel AI SDK structured output](integrations/vercel_ai_sdk_structured_output/README.md) diff --git a/examples/nextjs-basic/README.md b/examples/integrations/nextjs-basic/README.md similarity index 100% rename from examples/nextjs-basic/README.md rename to examples/integrations/nextjs-basic/README.md diff --git a/examples/nextjs-basic/app/api/chat/route.ts b/examples/integrations/nextjs-basic/app/api/chat/route.ts similarity index 100% rename from examples/nextjs-basic/app/api/chat/route.ts rename to examples/integrations/nextjs-basic/app/api/chat/route.ts diff --git a/examples/nextjs-basic/lib/context-sessions.ts b/examples/integrations/nextjs-basic/lib/context-sessions.ts similarity index 100% rename from examples/nextjs-basic/lib/context-sessions.ts rename to examples/integrations/nextjs-basic/lib/context-sessions.ts diff --git a/examples/nextjs-basic/next-env.d.ts b/examples/integrations/nextjs-basic/next-env.d.ts similarity index 100% rename from examples/nextjs-basic/next-env.d.ts rename to examples/integrations/nextjs-basic/next-env.d.ts diff --git a/examples/nextjs-basic/package-lock.json b/examples/integrations/nextjs-basic/package-lock.json similarity index 97% rename from examples/nextjs-basic/package-lock.json rename to examples/integrations/nextjs-basic/package-lock.json index 0ed10ae..20a6d2a 100644 --- a/examples/nextjs-basic/package-lock.json +++ b/examples/integrations/nextjs-basic/package-lock.json @@ -8,7 +8,7 @@ "name": "nextjs-basic-context-compiler-example", "version": "0.0.1", "dependencies": { - "@rlippmann/context-compiler": "file:../..", + "@rlippmann/context-compiler": "file:../../..", "next": "^15.3.0", "react": "^19.0.0", "react-dom": "^19.0.0" @@ -20,9 +20,9 @@ "typescript": "^5.7.2" } }, - "../..": { + "../../..": { "name": "@rlippmann/context-compiler", - "version": "0.5.0", + "version": "0.7.2", "license": "Apache-2.0", "devDependencies": { "typescript": "^5.9.3", @@ -132,9 +132,6 @@ "cpu": [ "arm" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -151,9 +148,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -170,9 +164,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -189,9 +180,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -208,9 +196,6 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -227,9 +212,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -246,9 +228,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -265,9 +244,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -284,9 +260,6 @@ "cpu": [ "arm" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -309,9 +282,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -334,9 +304,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -359,9 +326,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -384,9 +348,6 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -409,9 +370,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -434,9 +392,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -459,9 +414,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -598,9 +550,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -617,9 +566,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -636,9 +582,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -655,9 +598,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -700,7 +640,7 @@ } }, "node_modules/@rlippmann/context-compiler": { - "resolved": "../..", + "resolved": "../../..", "link": true }, "node_modules/@swc/helpers": { diff --git a/examples/nextjs-basic/package.json b/examples/integrations/nextjs-basic/package.json similarity index 91% rename from examples/nextjs-basic/package.json rename to examples/integrations/nextjs-basic/package.json index 0757681..c49bccb 100644 --- a/examples/nextjs-basic/package.json +++ b/examples/integrations/nextjs-basic/package.json @@ -10,7 +10,7 @@ "test:integration": "node ../../scripts/test-nextjs-integration.js" }, "dependencies": { - "@rlippmann/context-compiler": "file:../..", + "@rlippmann/context-compiler": "file:../../..", "next": "^15.3.0", "react": "^19.0.0", "react-dom": "^19.0.0" diff --git a/examples/nextjs-basic/tsconfig.json b/examples/integrations/nextjs-basic/tsconfig.json similarity index 100% rename from examples/nextjs-basic/tsconfig.json rename to examples/integrations/nextjs-basic/tsconfig.json diff --git a/examples/node-basic/README.md b/examples/integrations/node-basic/README.md similarity index 93% rename from examples/node-basic/README.md rename to examples/integrations/node-basic/README.md index 67a4cee..c0a289b 100644 --- a/examples/node-basic/README.md +++ b/examples/integrations/node-basic/README.md @@ -12,7 +12,7 @@ npm install ``` ```bash -npx tsx examples/node-basic/server.ts +npx tsx examples/integrations/node-basic/server.ts ``` This example uses `exportCheckpointJson()` / `importCheckpointJson()` for per-session persistence. diff --git a/examples/node-basic/server.ts b/examples/integrations/node-basic/server.ts similarity index 100% rename from examples/node-basic/server.ts rename to examples/integrations/node-basic/server.ts diff --git a/package-lock.json b/package-lock.json index ad2f604..0b4a78f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rlippmann/context-compiler", - "version": "0.7.1", + "version": "0.7.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rlippmann/context-compiler", - "version": "0.7.1", + "version": "0.7.2", "license": "Apache-2.0", "devDependencies": { "typescript": "^5.9.3", diff --git a/package.json b/package.json index e77c398..60dcf80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rlippmann/context-compiler", - "version": "0.7.1", + "version": "0.7.2", "description": "Store AI rules and corrections separately from chat history so they stay consistent across turns.", "keywords": [ "llm", @@ -39,6 +39,18 @@ }, "files": [ "dist", + "examples/README.md", + "examples/integrations/nextjs-basic/README.md", + "examples/integrations/nextjs-basic/app", + "examples/integrations/nextjs-basic/lib", + "examples/integrations/nextjs-basic/next-env.d.ts", + "examples/integrations/nextjs-basic/package.json", + "examples/integrations/nextjs-basic/package-lock.json", + "examples/integrations/nextjs-basic/tsconfig.json", + "examples/integrations/node-basic/README.md", + "examples/integrations/node-basic/server.ts", + "examples/integrations/vercel_ai_sdk_structured_output/README.md", + "examples/integrations/vercel_ai_sdk_structured_output/index.ts", "LICENSE", "README.md" ], diff --git a/tsconfig.build.json b/tsconfig.build.json index 986970b..2e37c84 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -11,7 +11,7 @@ "index.ts", "src/**/*.ts", "examples/*.ts", - "examples/integrations/**/*.ts", + "examples/integrations/vercel_ai_sdk_structured_output/**/*.ts", "demos/**/*.ts", "demos/**/*.d.ts" ],