# spookynetwork/kraken-click architecture

> Architecture diagram of the GitHub repository spookynetwork/kraken-click, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spookynetwork/kraken-click
- Repository: https://github.com/spookynetwork/kraken-click

## Overview

Kraken Click is a Windows perception-and-embodiment subsystem, not the system’s decision engine. The documented production workflow is a user request routed by the Python orchestrator through its pointer bridge to Windows-side interaction; the README says that bridge does not yet link this Rust crate. The Rust scaffold separately exposes pointer-query routing, screen capture and context packaging, AI-provider abstractions, overlays, and PSC-gated actions. Connections among sampled Rust components are shown only where source or documentation supports them; unsampled capability modules remain distinct where their internal wiring is uncertain.

Main entry points: [`actions/gate.rs`](https://github.com/spookynetwork/kraken-click/blob/main/actions/gate.rs) (PSC safety gate), [`agents/context.rs`](https://github.com/spookynetwork/kraken-click/blob/main/agents/context.rs) (Context packager), [`cognition/runtime.rs`](https://github.com/spookynetwork/kraken-click/blob/main/cognition/runtime.rs) (Cognitive runtime), [`pointer/detector.rs`](https://github.com/spookynetwork/kraken-click/blob/main/pointer/detector.rs) (UI detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_production["Production pointer path"]
  node_orchestrator["Python orchestrator"]
  node_bridge["Pointer bridge"]
end

subgraph group_perception["Screen perception"]
  node_detector["UI detector<br/>[detector.rs]"]
  node_pointer_models["Pointer models<br/>[models.rs]"]
  node_semantics["Semantic labeling<br/>[semantic.rs]"]
  node_capture["Screen capture<br/>[capture.rs]"]
  node_analyzer["Vision analyzer<br/>[analyzer.rs]"]
  node_ocr["OCR fallback<br/>[ocr.rs]"]
  node_accessibility["Accessibility bindings<br/>[accessibility.rs]"]
  node_winrt["WinRT bindings<br/>[winrt.rs]"]
end

subgraph group_intelligence["Query and cognition"]
  node_context["Context packager<br/>[context.rs]"]
  node_router["Agent router<br/>[router.rs]"]
  node_runtime["Cognitive runtime<br/>[runtime.rs]"]
  node_cognitive_types["Cognition types<br/>[types.rs]"]
  node_anthropic["Anthropic provider<br/>[anthropic.rs]"]
end

subgraph group_embodiment["Interaction and display"]
  node_gate["PSC safety gate<br/>[gate.rs]"]
  node_click["Click and drag<br/>[click.rs]"]
  node_input["Keyboard input<br/>[input.rs]"]
  node_window_actions["Window actions<br/>[window.rs]"]
  node_overlay_window["Overlay windows<br/>[window.rs]"]
  node_cursor["Cursor display<br/>[cursor.rs]"]
  node_captions["Caption bubbles<br/>[caption.rs]"]
  node_renderer["Direct2D renderer<br/>[renderer.rs]"]
end

node_user(("User"))
node_windows["Windows host"]

node_user -->|"requests pointer task"| node_orchestrator
node_orchestrator -->|"dispatches pointer task"| node_bridge
node_bridge -->|"uses Windows APIs"| node_windows
node_context -->|"captures screen"| node_capture
node_context -->|"detects elements"| node_detector
node_router -->|"queries elements"| node_detector
node_click -->|"evaluates actions"| node_gate
node_window_actions -->|"evaluates actions"| node_gate
node_input -->|"passes action gate"| node_gate
node_runtime -->|"uses types"| node_cognitive_types
node_anthropic -->|"implements runtime"| node_runtime

click node_detector "https://github.com/spookynetwork/kraken-click/blob/main/pointer/detector.rs"
click node_pointer_models "https://github.com/spookynetwork/kraken-click/blob/main/pointer/models.rs"
click node_semantics "https://github.com/spookynetwork/kraken-click/blob/main/pointer/semantic.rs"
click node_capture "https://github.com/spookynetwork/kraken-click/blob/main/vision/capture.rs"
click node_analyzer "https://github.com/spookynetwork/kraken-click/blob/main/vision/analyzer.rs"
click node_ocr "https://github.com/spookynetwork/kraken-click/blob/main/vision/ocr.rs"
click node_context "https://github.com/spookynetwork/kraken-click/blob/main/agents/context.rs"
click node_router "https://github.com/spookynetwork/kraken-click/blob/main/agents/router.rs"
click node_runtime "https://github.com/spookynetwork/kraken-click/blob/main/cognition/runtime.rs"
click node_cognitive_types "https://github.com/spookynetwork/kraken-click/blob/main/cognition/types.rs"
click node_anthropic "https://github.com/spookynetwork/kraken-click/blob/main/providers/anthropic.rs"
click node_gate "https://github.com/spookynetwork/kraken-click/blob/main/actions/gate.rs"
click node_click "https://github.com/spookynetwork/kraken-click/blob/main/actions/click.rs"
click node_input "https://github.com/spookynetwork/kraken-click/blob/main/actions/input.rs"
click node_window_actions "https://github.com/spookynetwork/kraken-click/blob/main/actions/window.rs"
click node_overlay_window "https://github.com/spookynetwork/kraken-click/blob/main/overlay/window.rs"
click node_cursor "https://github.com/spookynetwork/kraken-click/blob/main/overlay/cursor.rs"
click node_captions "https://github.com/spookynetwork/kraken-click/blob/main/overlay/caption.rs"
click node_renderer "https://github.com/spookynetwork/kraken-click/blob/main/overlay/renderer.rs"
click node_accessibility "https://github.com/spookynetwork/kraken-click/blob/main/integrations/accessibility.rs"
click node_winrt "https://github.com/spookynetwork/kraken-click/blob/main/integrations/winrt.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_orchestrator,node_bridge,node_user toneBlue
class node_detector,node_pointer_models,node_semantics,node_capture,node_analyzer,node_ocr,node_accessibility,node_winrt toneAmber
class node_context,node_router,node_runtime,node_cognitive_types,node_anthropic toneMint
class node_gate,node_click,node_input,node_window_actions,node_overlay_window,node_cursor,node_captions,node_renderer toneRose
class node_windows toneIndigo
```

## Components

### Production pointer path

- **Python orchestrator**
- **Pointer bridge**

### Screen perception

- [UI detector](https://github.com/spookynetwork/kraken-click/blob/main/pointer/detector.rs): `pointer/detector.rs`
- [Pointer models](https://github.com/spookynetwork/kraken-click/blob/main/pointer/models.rs): `pointer/models.rs`
- [Semantic labeling](https://github.com/spookynetwork/kraken-click/blob/main/pointer/semantic.rs): `pointer/semantic.rs`
- [Screen capture](https://github.com/spookynetwork/kraken-click/blob/main/vision/capture.rs): `vision/capture.rs`
- [Vision analyzer](https://github.com/spookynetwork/kraken-click/blob/main/vision/analyzer.rs): `vision/analyzer.rs`
- [OCR fallback](https://github.com/spookynetwork/kraken-click/blob/main/vision/ocr.rs): `vision/ocr.rs`
- [Accessibility bindings](https://github.com/spookynetwork/kraken-click/blob/main/integrations/accessibility.rs): `integrations/accessibility.rs`
- [WinRT bindings](https://github.com/spookynetwork/kraken-click/blob/main/integrations/winrt.rs): `integrations/winrt.rs`

### Query and cognition

- [Context packager](https://github.com/spookynetwork/kraken-click/blob/main/agents/context.rs): `agents/context.rs`
- [Agent router](https://github.com/spookynetwork/kraken-click/blob/main/agents/router.rs): `agents/router.rs`
- [Cognitive runtime](https://github.com/spookynetwork/kraken-click/blob/main/cognition/runtime.rs): `cognition/runtime.rs`
- [Cognition types](https://github.com/spookynetwork/kraken-click/blob/main/cognition/types.rs): `cognition/types.rs`
- [Anthropic provider](https://github.com/spookynetwork/kraken-click/blob/main/providers/anthropic.rs): `providers/anthropic.rs`

### Interaction and display

- [PSC safety gate](https://github.com/spookynetwork/kraken-click/blob/main/actions/gate.rs): `actions/gate.rs`
- [Click and drag](https://github.com/spookynetwork/kraken-click/blob/main/actions/click.rs): `actions/click.rs`
- [Keyboard input](https://github.com/spookynetwork/kraken-click/blob/main/actions/input.rs): `actions/input.rs`
- [Window actions](https://github.com/spookynetwork/kraken-click/blob/main/actions/window.rs): `actions/window.rs`
- [Overlay windows](https://github.com/spookynetwork/kraken-click/blob/main/overlay/window.rs): `overlay/window.rs`
- [Cursor display](https://github.com/spookynetwork/kraken-click/blob/main/overlay/cursor.rs): `overlay/cursor.rs`
- [Caption bubbles](https://github.com/spookynetwork/kraken-click/blob/main/overlay/caption.rs): `overlay/caption.rs`
- [Direct2D renderer](https://github.com/spookynetwork/kraken-click/blob/main/overlay/renderer.rs): `overlay/renderer.rs`

### Other components

- **User**
- **Windows host**

## Connections

- User → Python orchestrator: requests pointer task (evidence: `README.md`)
- Python orchestrator → Pointer bridge: dispatches pointer task (evidence: `README.md`)
- Pointer bridge → Windows host: uses Windows APIs (evidence: `README.md`)
- Context packager → Screen capture: captures screen (evidence: `agents/context.rs`)
- Context packager → UI detector: detects elements (evidence: `agents/context.rs`)
- Agent router → UI detector: queries elements (evidence: `agents/router.rs`)
- Click and drag → PSC safety gate: evaluates actions (evidence: `actions/click.rs`)
- Window actions → PSC safety gate: evaluates actions (evidence: `actions/window.rs`)
- Keyboard input → PSC safety gate: passes action gate (evidence: `actions/mod.rs`)
- Cognitive runtime → Cognition types: uses types (evidence: `cognition/runtime.rs`)
- Anthropic provider → Cognitive runtime: implements runtime
