Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 3.85 KB

File metadata and controls

57 lines (38 loc) · 3.85 KB

Context Compiler Example Integrations for TypeScript

These examples show how authoritative state changes application behavior at runtime.

Each example demonstrates a single enforcement point where premise and policy influence what a host allows, routes, retrieves, builds, or executes.

Prompt reinjection influences model behavior.

Context Compiler influences runtime behavior.

Generic examples

  • Checkpoint continuation: persisted confirmation and resume flows change host behavior across turns or requests
  • Execution authorization: protected host actions execute only when authoritative state allows them
  • Gateway middleware: the host allows, blocks, or routes requests before downstream work runs
  • Prompt construction: the host builds different request or prompt payloads from authoritative state
  • Retrieval filtering: the host changes which documents are eligible or relevant before returning results
  • Schema selection: the host picks different workflow or response schemas from authoritative state
  • Tool gating: the host changes which tools are visible or executable at runtime

Starter apps

Starter apps are available when a small runnable host makes the enforcement point easier to see:

  • Node starter apps - execution authorization starter variants for a small Node HTTP server
  • Next.js starter apps - request construction and context assembly starter variants for a minimal Next.js App Router app

Open a starter app when you want a minimal host runtime around the enforcement point instead of a generic example alone.

In these starters:

  • @rlippmann/context-compiler is the authority layer
  • @rlippmann/context-compiler-directive-drafter is optional help for recognizing directive-shaped input

Each starter app now comes in two variants:

  • basic = compiler-only baseline with no directive-drafter dependency
  • with_drafter = optional acquisition layer before the compiler

The compiler-only flow is always the baseline. If a starter includes directive-drafter, it is there to help acquisition, not to own state changes.

Run an example

To explore or run an example, use a repository checkout:

  1. Clone context-compiler-example-integrations.
  2. Choose a generic example or a starter app.
  3. Open that example's README.
  4. Follow the example-specific setup, runtime, and validation instructions.