# Libghostty Embed

> libghostty terminal embedding for per-vat REPLs with Goblins integration

- Skill: `plurigrid/libghostty-embed` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add plurigrid/libghostty-embed`
- Raw SKILL.md: https://api.skillmd.com/api/skills/plurigrid/libghostty-embed/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: plurigrid (https://skillmd.com/u/plurigrid)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/plurigrid/libghostty-embed

---

# libghostty-embed Skill

**Trit**: +1 (PLUS - terminal output producer)
**Level**: 4 (EXPERT)
**Header**: `~/worlds/b/bmorphism/trittty/include/ghostty.h`

## Core Types

```c
typedef void* ghostty_app_t;
typedef void* ghostty_surface_t;
typedef void* ghostty_config_t;
```

## Per-Vat Terminal

Each Goblins vat gets its own `ghostty_surface_t`:

```zig
pub const VatTerminal = struct {
    surface: c.ghostty_surface_t,
    vat_id: []const u8,
    trit: i8, // GF(3) phase
};
```

## GF(3) Triplet

```
vat-minus (⊖ -1) × vat-zero (⊙ 0) × vat-plus (⊕ +1) = 0 ✓
```

## Canonical Triads

```
move-contract (-1) ⊗ qualia-bank (0) ⊗ libghostty-embed (+1) = 0 ✓
zig-programming (-1) ⊗ nickel (0) ⊗ libghostty-embed (+1) = 0 ✓
```

## Interaction Modes

| Mode | Goblins Syntax | Terminal |
|------|----------------|----------|
| inside_sync | `($ obj 'method)` | Same surface |
| outside_async | `(<- obj 'method)` | Route between surfaces |
| outside_remote | sturdyref | CapTP network |


---

## Autopoietic Marginalia

> **The interaction IS the skill improving itself.**

Every use of this skill is an opportunity for worlding:
- **MEMORY** (-1): Record what was learned
- **REMEMBERING** (0): Connect patterns to other skills  
- **WORLDING** (+1): Evolve the skill based on use



*Add Interaction Exemplars here as the skill is used.*

