cel-context 0.1.0

Open context snapshot and merge contracts for AI agents. Normalize UI, app, log, and external facts into CEL ContextElement and ScreenContext shapes.
Documentation
# cel-context

Open context snapshot and merge contracts for AI agents.

`cel-context` is the community-facing context standard in CEL. It defines how
heterogeneous sources describe one software state through `ContextElement` and
`ScreenContext`.

## What It Owns

- `ContextElement` — one UI, app, log, or source-derived fact.
- `ScreenContext` — one snapshot of app/window state and context elements.
- `ContextSource` — source labels such as accessibility, CDP, native API, OCR, vision, merged.
- `ContentRole` — prompt-injection-aware classification.
- `ContextReference` — resilient targeting data that survives ephemeral IDs.
- `ContextContribution` / `ContextMerger` — generic source contribution merge mechanics.

## What It Does Not Own

- live cortex operation
- runtime freshness / anomaly policy
- action dispatch
- policy enforcement
- monitoring dashboards or compliance exports

Those live in the commercial Cellar/Dilipod runtime unless explicitly opened
later.

## Example

```sh
cargo run -p cel-context --example context_snapshot -- --json
```

The example constructs a snapshot from caller-provided `ContextElement`s. Live
capture belongs in runtime/source crates that emit the same contract shape.

## Minimal Element

```rust
use cel_context::{ContentRole, ContextElement, ContextSource};
use std::collections::HashMap;

let element = ContextElement {
    id: "app:button:submit".into(),
    label: Some("Submit".into()),
    description: None,
    element_type: "button".into(),
    value: None,
    bounds: None,
    state: Default::default(),
    parent_id: None,
    actions: vec!["click".into()],
    confidence: 0.95,
    source: ContextSource::NativeApi,
    content_role: ContentRole::Interactive,
    properties: HashMap::new(),
};
```

## License

Apache-2.0