@groeponline/pi-wishcraft 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +16 -7
- package/ROADMAP.md +144 -425
- package/docs/commands.md +6 -2
- package/docs/configuration.md +21 -0
- package/docs/design/accessibility.md +71 -0
- package/docs/design/deck-layout.md +69 -0
- package/docs/design/motion-gallery.md +80 -0
- package/docs/design/motion-system.md +119 -0
- package/docs/design/presets.md +196 -0
- package/docs/design/regression-testing.md +54 -0
- package/docs/design/responsive.md +53 -0
- package/docs/design/signal.md +71 -0
- package/docs/design/theme-contract.md +132 -0
- package/docs/design/vnext-overview.md +55 -0
- package/docs/design/vnext-release-plan.md +212 -0
- package/docs/index.md +19 -1
- package/docs/segments.md +1 -1
- package/package.json +2 -1
- package/src/config/appearance.ts +229 -0
- package/src/config/parse.ts +41 -0
- package/src/config/presets.ts +184 -0
- package/src/config/structural-presets.ts +555 -0
- package/src/config/tokens.ts +154 -0
- package/src/config/types.ts +210 -2
- package/src/extension/commands/commands.ts +36 -12
- package/src/extension/commands/powerline-completions.ts +4 -0
- package/src/extension/commands/queue-commands.ts +6 -0
- package/src/extension/core/segment-context.ts +27 -21
- package/src/extension/core/state.ts +16 -1
- package/src/extension/core/types.ts +11 -1
- package/src/extension/session/session-lifecycle.ts +29 -65
- package/src/extension/session/session-notifications.ts +91 -0
- package/src/extension/settings/appearance-write.ts +135 -0
- package/src/extension/settings/wishcraft-config-items.ts +119 -0
- package/src/extension/settings/wishcraft-config.ts +28 -114
- package/src/extension/skills/skill-manager.ts +5 -0
- package/src/extension/ui/deck/component.ts +371 -0
- package/src/extension/ui/deck/index.ts +34 -0
- package/src/extension/ui/deck/render.ts +260 -0
- package/src/extension/ui/deck/route-bodies.ts +209 -0
- package/src/extension/ui/deck/routes.ts +37 -0
- package/src/extension/ui/deck/session-snapshot.ts +122 -0
- package/src/extension/ui/deck/types.ts +97 -0
- package/src/extension/ui/powerline-menu-view.ts +19 -15
- package/src/extension/ui/signal-layout.ts +76 -0
- package/src/extension/ui/status-line-renderers.ts +20 -2
- package/src/motion/accessibility.ts +59 -0
- package/src/motion/catalog-extra.ts +429 -0
- package/src/motion/catalog.ts +336 -0
- package/src/motion/composer.ts +147 -0
- package/src/motion/frames.ts +84 -0
- package/src/motion/gallery.ts +77 -0
- package/src/motion/index.ts +78 -0
- package/src/motion/policy.ts +128 -0
- package/src/motion/scheduler.ts +159 -0
- package/src/motion/types.ts +132 -0
- package/src/render/timer.ts +1 -0
- package/src/signal/controller.ts +135 -0
- package/src/signal/integration.ts +46 -0
- package/src/signal/render.ts +178 -0
- package/src/theme/detect.ts +48 -0
- package/src/theme/tokens/index.ts +9 -0
- package/src/theme/tokens/mapping.ts +21 -0
- package/src/theme/tokens/types.ts +6 -0
- package/src/usage/token-budget.ts +23 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# First-Class Accessibility & Graceful Degradation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Terminal environments vary drastically—from modern GPU-accelerated terminals with full truecolor and Nerd Font glyphs to low-bandwidth SSH sessions, restricted 8-color virtual consoles, and screen readers.
|
|
6
|
+
|
|
7
|
+
Wishcraft treats accessibility and environmental adaptability as first-class architectural constraints, directly resolving ROADMAP P1 Gap #4.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Motion Levels
|
|
12
|
+
|
|
13
|
+
Users can configure global motion sensitivity via settings or keyboard shortcuts:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Motion Sensitivity:
|
|
17
|
+
(●) Full - Continuous sweeps, micro-spinners, and transitions
|
|
18
|
+
( ) Reduced - Instant state changes; continuous loops replaced by static glyphs
|
|
19
|
+
( ) Functional Only - Task indicators active; decorative ambient motion disabled
|
|
20
|
+
( ) Off - 100% static display; zero animated frames
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Environment Degradation Matrix
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
┌───────────────────┬───────────────────┬───────────────────┬────────────────────┐
|
|
29
|
+
│ ENVIRONMENT │ MOTION BEHAVIOR │ COLOR PALETTE │ GLYPH RENDERING │
|
|
30
|
+
├───────────────────┼───────────────────┼───────────────────┼────────────────────┤
|
|
31
|
+
│ Modern Truecolor │ Full FPS & Sweeps │ True 24-bit RGB │ Full Nerd Fonts │
|
|
32
|
+
│ Standard 256 Color│ Full FPS & Sweeps │ ANSI-256 Mapped │ Unicode / Nerd │
|
|
33
|
+
│ Basic 8/16 Color │ Simplified Pulse │ Basic ANSI │ Clean ASCII │
|
|
34
|
+
│ NO_COLOR Set │ Glyphs Active │ No ANSI Escapes │ Unicode / ASCII │
|
|
35
|
+
│ prefers-reduced │ Discrete States │ Full Color │ Standard Glyphs │
|
|
36
|
+
│ Screen Reader │ Disabled (0 FPS) │ High Contrast │ Descriptive Text │
|
|
37
|
+
└───────────────────┴───────────────────┴───────────────────┴────────────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Concrete Degradation Policies
|
|
43
|
+
|
|
44
|
+
### 1. `NO_COLOR` Compliance
|
|
45
|
+
When the `NO_COLOR` environment variable is detected:
|
|
46
|
+
- All ANSI color codes and RGB background styling are stripped.
|
|
47
|
+
- Spatial layout, separators, and glyph animations remain active to convey status through structure.
|
|
48
|
+
|
|
49
|
+
### 2. `prefers-reduced-motion`
|
|
50
|
+
When reduced motion is requested by the OS or user configuration:
|
|
51
|
+
- Continuous sweeps along the Signal track are disabled.
|
|
52
|
+
- Spinners transition immediately to static state markers (`[..]`, `[ok]`, `[!]`).
|
|
53
|
+
- Transient notifications appear statically without fade-in or slide-in transitions.
|
|
54
|
+
|
|
55
|
+
### 3. Screen Reader Mode
|
|
56
|
+
- Motion engine is completely stopped (0 FPS).
|
|
57
|
+
- Powerline separators and visual spacers are suppressed.
|
|
58
|
+
- Status is formatted as clean, semantic plain text (e.g. `Model: GPT-5.6 | Git: main (clean) | State: Streaming | Context: 47%`).
|
|
59
|
+
|
|
60
|
+
### 4. ASCII Fallback Strategy
|
|
61
|
+
Every custom Unicode icon and Nerd Font symbol provides a guaranteed 1-to-1 ASCII equivalent:
|
|
62
|
+
|
|
63
|
+
| Semantic Icon | Nerd Font Glyph | Unicode Default | ASCII Fallback |
|
|
64
|
+
| :--- | :--- | :--- | :--- |
|
|
65
|
+
| Model | `` | `◈` | `[*]` |
|
|
66
|
+
| Git Branch | `` | `⎇` | `branch:` |
|
|
67
|
+
| Git Clean | `✔` | `✓` | `ok` |
|
|
68
|
+
| Git Dirty | `✎` | `⚡` | `*` |
|
|
69
|
+
| Streaming | `` | `✦` | `~` |
|
|
70
|
+
| Tool Call | `` | `◆` | `>` |
|
|
71
|
+
| Error | `` | `✗` | `ERR` |
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Deck Layout & Interactive Route Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The **Wishcraft Deck** (`Alt+P` / `/wishcraft`) is the central control surface for the agent operator. It replaces fragmented menus with a cohesive, keyboard-first modal overlay built inside `ctx.ui.custom`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The Continuous Surface Design
|
|
10
|
+
|
|
11
|
+
Unlike cheap TUIs that stack boxes inside boxes with conflicting borders, the Deck utilizes a **single continuous outer frame** partitioned into an ambient header, the active route viewport, and a contextual footer.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
╭────────────────────────────── WISHCRAFT DECK ──────────────────────────────╮
|
|
15
|
+
│ ◈ GPT-5.6 HIGH main +12 context 47% ◆ STREAMING │
|
|
16
|
+
├──────────────┬──────────────────────────────────────┬───────────────────────┤
|
|
17
|
+
│ NAVIGATION │ ACTIVE ROUTE: HOME │ ACTIVITY FEED │
|
|
18
|
+
│ │ │ │
|
|
19
|
+
│ ◉ Home │ CURRENT SESSION │ 21:16 read_file │
|
|
20
|
+
│ ◆ Signal │ ◆ Streaming response │ 21:16 grep_pattern │
|
|
21
|
+
│ ◇ Skills 27 │ ━━━━╾✦╼━━━━━━━━━━━━ │ 21:15 skill.load │
|
|
22
|
+
│ ◇ Ideas 4 │ │ │
|
|
23
|
+
│ ◇ Guardrails │ Context Capacity │ SKILLS HEALTH │
|
|
24
|
+
│ ◇ Shell │ ████████░░░░░ 47% (94k / 200k) │ ✓ 25 healthy │
|
|
25
|
+
│ ◇ Usage │ │ ! 2 warnings │
|
|
26
|
+
│ ◇ Appearance │ NEXT INTENT │ │
|
|
27
|
+
│ ◇ Motion │ Improve Signal motion engine │ GUARDRAILS │
|
|
28
|
+
│ ◇ Shortcuts │ [Run] [Open Skill] [Review] │ Policy: STRICT (Enf) │
|
|
29
|
+
├──────────────┴──────────────────────────────────────┴───────────────────────┤
|
|
30
|
+
│ / Search g s Skills g i Ideas ? Help Esc Close Deck │
|
|
31
|
+
╰─────────────────────────────────────────────────────────────────────────────╯
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Route Catalog & Deep Links
|
|
37
|
+
|
|
38
|
+
| Route | Deep Link Command | Purpose & Main Components |
|
|
39
|
+
| :--- | :--- | :--- |
|
|
40
|
+
| **`Home`** | `/wishcraft` / `Alt+P` | Live session overview, intent card, context bar, recent activity stream. |
|
|
41
|
+
| **`Signal`** | `/signal` | Visual powerline editor, lane assignments, separator picker. |
|
|
42
|
+
| **`Skills`** | `/skills` | Skill catalog, inline creation wizard, health diagnostics. |
|
|
43
|
+
| **`Skills Doctor`**| `/skills doctor` | Deep validation of skill frontmatter, descriptions, and triggers. |
|
|
44
|
+
| **`Ideas`** | `/ideas` | Rapid capture and organization of intent notes and future tasks. |
|
|
45
|
+
| **`Guardrails`** | `/guardrails` | Safety policies, denial logs, execution boundaries. |
|
|
46
|
+
| **`Shell`** | `/shell` | Execution environment inspect, tool binary availability. |
|
|
47
|
+
| **`Usage`** | `/usage` | Detailed token statistics and context window metrics. |
|
|
48
|
+
| **`Appearance`**| `/appearance` | Preset picker, semantic token overrides, layout density. |
|
|
49
|
+
| **`Motion`** | `/motion` | Motion Gallery, Composer, accessibility sensitivity sliders. |
|
|
50
|
+
| **`Shortcuts`** | `/shortcuts` | Keyboard navigation and jump-mode cheat sheet. |
|
|
51
|
+
| **`Diagnostics`**| `/diagnostics` | Terminal capabilities, color support, and encoding checks. |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Navigation Ergonomics
|
|
56
|
+
|
|
57
|
+
Wishcraft combines **Posting-style jump shortcuts** with a fast **fuzzy command palette**:
|
|
58
|
+
|
|
59
|
+
1. **Global Jump Keys**:
|
|
60
|
+
- `g h` $\rightarrow$ Jump to Home
|
|
61
|
+
- `g s` $\rightarrow$ Jump to Skills
|
|
62
|
+
- `g i` $\rightarrow$ Jump to Ideas
|
|
63
|
+
- `g a` $\rightarrow$ Jump to Appearance
|
|
64
|
+
- `g m` $\rightarrow$ Jump to Motion
|
|
65
|
+
2. **Fuzzy Search Palette (`/`)**:
|
|
66
|
+
- Typing `/` anywhere in the Deck opens the instant search bar.
|
|
67
|
+
- Matches routes, config keys, actions, and skills with real-time highlighted filtering.
|
|
68
|
+
3. **Key Hints**:
|
|
69
|
+
- The footer always renders context-relevant shortcuts, eliminating the need to memorize keybindings.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Motion Gallery & Composer Specification
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The **Motion Gallery** provides an interactive catalog of animations categorized across curated styles. The **Motion Composer** allows developers and power users to author, preview, and assign custom motion definitions directly inside the terminal interface.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Gallery Categories
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
╭─ Motion Gallery ─────────────────────────────────────────────────────────────╮
|
|
13
|
+
│ / Search motions (e.g. "lunar", "sweep", "ember") │
|
|
14
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
15
|
+
│ Wishcraft Matrix Procedural Classic Custom │
|
|
16
|
+
│ │
|
|
17
|
+
│ ◈ Ember Relay ∞ Lemniscate ⠿ Helix Phase ⠋ Braille ✦ User-1 │
|
|
18
|
+
│ ◇ Wisp Drift ◎ Lunar Orbit ≋ Wave Stream ◐ Quarter │
|
|
19
|
+
│ ✦ Sigil Bloom △ Wing Pulse ⡿ Orbital Spin ▏ Bar Fill │
|
|
20
|
+
│ ⬡ Heat Propagate ✧ Petal Shimmer ≋ Ripple Surface ● Bounce │
|
|
21
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
22
|
+
│ PREVIEW: │
|
|
23
|
+
│ │
|
|
24
|
+
│ ━━━━━━╾✦╼━━━━━━━━━━━━━ │
|
|
25
|
+
│ → 90ms │
|
|
26
|
+
│ │
|
|
27
|
+
│ Channels: [✓] Working Glyph [✓] Signal Track [ ] Transient [✓] Task │
|
|
28
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
29
|
+
│ Space Play/Pause E Edit in Composer D Duplicate F Favorite Enter Apply│
|
|
30
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 1. Wishcraft (Signature Metaphors)
|
|
34
|
+
- `ember-relay`: Traveling spark across segmented track.
|
|
35
|
+
- `wisp-drift`: Subtle breathing glyph with gentle phase oscillation.
|
|
36
|
+
- `sigil-bloom`: Expanding concentric geometry that settles upon completion.
|
|
37
|
+
- `heat-propagate`: Thermal matrix diffusion across block elements.
|
|
38
|
+
|
|
39
|
+
### 2. Matrix (Geometrical & Celestial)
|
|
40
|
+
- `lemniscate`: Infinity figure-eight traversal.
|
|
41
|
+
- `lunar-orbit`: Sinusoidal orbital node path.
|
|
42
|
+
- `wing-pulse`: Dual metronome oscillation.
|
|
43
|
+
- `petal-shimmer`: Expanding and contracting radial points.
|
|
44
|
+
|
|
45
|
+
### 3. Procedural (Fluid & Wave Mechanics)
|
|
46
|
+
- `helix-phase`: Intertwined dual-strand cycle.
|
|
47
|
+
- `wave-stream`: Progressive sine wave amplitude sweep.
|
|
48
|
+
- `ripple-surface`: Concentric wavefront propagation.
|
|
49
|
+
|
|
50
|
+
### 4. Classic (Reliable Terminal Spinners)
|
|
51
|
+
- `braille-cycle`: Canonical 8-dot Braille loop (`⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`).
|
|
52
|
+
- `quarter-circle`: Rotating four-quadrant glyphs (`◐◓◑◒`).
|
|
53
|
+
- `bar-fill`: Smooth horizontal bar progression (`▏▎▍▌▋▊▉█`).
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Motion Composer
|
|
58
|
+
|
|
59
|
+
The Composer enables real-time parameter tweaking and frame array authoring:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
╭─ Motion Composer: Ember Relay ───────────────────────────────────────────────╮
|
|
63
|
+
│ TIMELINE │
|
|
64
|
+
│ 0ms 90ms 180ms 270ms 360ms │
|
|
65
|
+
│ ├───◇──────────├───◈──────────├───◆──────────├───◈──────────├───◇────────────│
|
|
66
|
+
│ │
|
|
67
|
+
│ PARAMETERS │
|
|
68
|
+
│ Geometry: Linear Track (1D) │
|
|
69
|
+
│ Interval: 90 ms │
|
|
70
|
+
│ Direction: Forward (→) │
|
|
71
|
+
│ Easing: Sinusoidal Pulse │
|
|
72
|
+
│ Color Role: motionHot (#fbbf24) │
|
|
73
|
+
│ Fallback Glyph: ◆ │
|
|
74
|
+
│ │
|
|
75
|
+
│ ASSIGNED CHANNELS │
|
|
76
|
+
│ [*] Working Glyph [*] Signal Track [ ] Border [*] Task Status │
|
|
77
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
78
|
+
│ Ctrl+S Save Tab Next Field Space Test Esc Discard │
|
|
79
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
80
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Semantic Motion Engine & Scheduler
|
|
2
|
+
|
|
3
|
+
## Architectural Invariants
|
|
4
|
+
|
|
5
|
+
1. **Centralized Dispatch**: Components never launch ad-hoc `setInterval()` loops. All rendering cadences are driven by a single `MotionScheduler`.
|
|
6
|
+
2. **0 FPS Idle Guarantee**: When no animations or active consumers exist, timers are torn down completely. CPU usage is strictly 0%.
|
|
7
|
+
3. **Semantic Event Driven**: Animations are triggered by semantic agent lifecycle events (`streaming`, `tool.start`, `policy.deny`), not arbitrary frame tickers.
|
|
8
|
+
4. **Pure Function Calculations**: Motion algorithms, frame interpolations, and physics math are pure, unit-testable functions independent of the TUI renderer.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Semantic Motion Events
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export type MotionEvent =
|
|
16
|
+
| "idle" // System at rest
|
|
17
|
+
| "thinking" // Agent formulating response
|
|
18
|
+
| "streaming" // Token output active
|
|
19
|
+
| "tool.start" // Invoking external tool
|
|
20
|
+
| "tool.end" // Tool execution resolved
|
|
21
|
+
| "idea.capture" // Intent/Idea logged to deck
|
|
22
|
+
| "skill.insert" // Skill inserted into editor
|
|
23
|
+
| "policy.deny" // Action blocked by guardrail
|
|
24
|
+
| "repair" // Healing or recovering from error
|
|
25
|
+
| "compact" // Context window compaction
|
|
26
|
+
| "success" // Task completed successfully
|
|
27
|
+
| "warning" // Approaching threshold/warning
|
|
28
|
+
| "error"; // Exception or fatal failure
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Output Channels & Event Routing Matrix
|
|
34
|
+
|
|
35
|
+
There are six independent visual output channels:
|
|
36
|
+
- **`workingGlyph`**: Spinner or working status glyph in the prompt / header.
|
|
37
|
+
- **`signal`**: Animated track in the powerline.
|
|
38
|
+
- **`deckTransient`**: Ephemeral banner or toast inside the Deck overlay.
|
|
39
|
+
- **`panelIndicator`**: Localized progress indicator in active sub-panels.
|
|
40
|
+
- **`borderEmphasis`**: Transient glow or color pulse along outer frame borders.
|
|
41
|
+
- **`ambient`**: Subtle low-frequency breath when explicitly enabled.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
┌───────────────┬──────────────┬──────────────┬───────────────┬─────────────────┬─────────────────┬───────────┐
|
|
45
|
+
│ EVENT │ WORKING GLYPH│ SIGNAL ANIM │ DECK TRANSIENT│ PANEL INDICATOR │ BORDER EMPHASIS │ AMBIENT │
|
|
46
|
+
├───────────────┼──────────────┼──────────────┼───────────────┼─────────────────┼─────────────────┼───────────┤
|
|
47
|
+
│ idle │ — │ — │ — │ — │ — │ ● (Opt) │
|
|
48
|
+
│ thinking │ ● Pulse │ ● Dim Sweep │ — │ — │ — │ — │
|
|
49
|
+
│ streaming │ ● Active │ ● Hot Sweep │ — │ ● Token Flow │ — │ — │
|
|
50
|
+
│ tool.start │ ● Working │ ● Segment Run│ — │ ● Tool Status │ — │ — │
|
|
51
|
+
│ tool.end │ — │ ● Settle │ — │ ● Checkmark │ — │ — │
|
|
52
|
+
│ idea.capture │ — │ — │ ● "+1 Idea" │ — │ — │ — │
|
|
53
|
+
│ skill.insert │ — │ ● Edge Jump │ ● Toast │ — │ — │ — │
|
|
54
|
+
│ policy.deny │ — │ — │ ● Blocked Card│ — │ ● Error Flash │ — │
|
|
55
|
+
│ repair │ ● Spinner │ — │ ● Recovery │ ● Diagnostic │ — │ — │
|
|
56
|
+
│ compact │ ● Compress │ ● Shrink Bar │ ● Compact Msg │ ● Context Bar │ — │ — │
|
|
57
|
+
│ success │ — │ ● Bloom (Fin)│ ● Done Banner │ — │ ● Success Flash │ — │
|
|
58
|
+
│ warning │ — │ — │ ● Warning Card│ — │ ● Warn Flash │ — │
|
|
59
|
+
│ error │ — │ — │ ● Error Modal │ — │ ● Error Flash │ — │
|
|
60
|
+
└───────────────┴──────────────┴──────────────┴───────────────┴─────────────────┴─────────────────┴───────────┘
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Channel Cadences & Scheduler Design
|
|
66
|
+
|
|
67
|
+
Different visual elements operate at distinct frame rates to optimize visual clarity while conserving system resources:
|
|
68
|
+
|
|
69
|
+
| Channel | Target Cadence | Lifecycle |
|
|
70
|
+
| :--- | :--- | :--- |
|
|
71
|
+
| **`workingGlyph`** | `80ms – 120ms` per frame | Active while agent processes |
|
|
72
|
+
| **`signal` Sweep** | `80ms – 120ms` per frame | Active during stream / tool execution |
|
|
73
|
+
| **`panelIndicator`** | `120ms – 250ms` per frame | Active while sub-view is busy |
|
|
74
|
+
| **`borderEmphasis`** | `200ms – 400ms` total burst | Finite (1 to 3 frames) |
|
|
75
|
+
| **`deckTransient`** | `250ms – 500ms` total display | Finite auto-dismissing |
|
|
76
|
+
| **`ambient` Idle** | `250ms – 750ms` per frame | Runs only when explicitly opted-in |
|
|
77
|
+
|
|
78
|
+
### State Transition Diagram
|
|
79
|
+
|
|
80
|
+
```mermaid
|
|
81
|
+
stateDiagram-v2
|
|
82
|
+
[*] --> Idle: Initialize
|
|
83
|
+
Idle --> ActiveMotion: MotionEvent Received (streaming, tool.start)
|
|
84
|
+
ActiveMotion --> ActiveMotion: Tick registered consumers (80-120ms)
|
|
85
|
+
ActiveMotion --> FiniteBurst: Success / Error Event
|
|
86
|
+
FiniteBurst --> Idle: Burst Complete (no consumers)
|
|
87
|
+
Idle --> [*]: Dispose Scheduler (0 FPS)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Motion Definition Schema (`MotionDef`)
|
|
93
|
+
|
|
94
|
+
Motions are defined declaratively as pure data structures:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
export interface MotionDef {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
category: "wishcraft" | "matrix" | "procedural" | "classic" | "custom";
|
|
101
|
+
kind: "frames" | "generator";
|
|
102
|
+
loop: "while-active" | "finite" | "ambient";
|
|
103
|
+
colorRole: keyof WishcraftTokens;
|
|
104
|
+
fallbackGlyph: string;
|
|
105
|
+
|
|
106
|
+
// Discrete Frame Sequences
|
|
107
|
+
frames?: string[];
|
|
108
|
+
|
|
109
|
+
// Procedural Generator Specification
|
|
110
|
+
generator?: {
|
|
111
|
+
geometry: "linear" | "orbit" | "wave" | "bloom" | "liquid";
|
|
112
|
+
interval: number;
|
|
113
|
+
trailLength?: number;
|
|
114
|
+
radius?: number;
|
|
115
|
+
direction?: "forward" | "reverse" | "pingpong";
|
|
116
|
+
easing?: "linear" | "sinusoidal" | "exponential";
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
```
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Structural Presets Specification
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Wishcraft introduces **ten signature structural presets**. A preset is not merely a color skin; it defines a complete design system combining:
|
|
6
|
+
1. **Token Palette**: Cohesive semantic colors.
|
|
7
|
+
2. **Chrome Geometry**: Frame borders, corners, divider styles, and density.
|
|
8
|
+
3. **Signal Grammar**: Lane structure, module capsules, separators, and caps.
|
|
9
|
+
4. **Glyph Grammar**: Curated Unicode and Nerd Font iconography with clean ASCII fallbacks.
|
|
10
|
+
5. **Signature Motion**: Procedural animations reflecting the preset's identity.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## The Ten Structural Presets
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
┌────────────────────────────────────────────────────────────────────────────────────────┐
|
|
18
|
+
│ PRESET CHARACTER SIGNAL STRUCTURE SIGNATURE MOTION │
|
|
19
|
+
├────────────────────────────────────────────────────────────────────────────────────────┤
|
|
20
|
+
│ 1. Lanternwake Warm Amber / Signature Dark Fluid Segments Ember Breathe │
|
|
21
|
+
│ 2. Threadbound Woven Craft / Indigo Thin Knot Wire Stitch Travel │
|
|
22
|
+
│ 3. Scryglass Refractive Glass / Cyan Capsule Lenses Refraction Sweep │
|
|
23
|
+
│ 4. Runebloom Organic Alchemical Sigils Sparse Anchors Sigil Bloom │
|
|
24
|
+
│ 5. Moonwell Nocturnal Orbit / Silver Arc Segments Lunar Breathe │
|
|
25
|
+
│ 6. Hexforge Heavy Industrial Steel Block Hexagons Heat Propagation │
|
|
26
|
+
│ 7. Vellum Editorial Grimoire Borderless Line Writing Reveal │
|
|
27
|
+
│ 8. Wisp Ethereal Minimalist Max Whitespace Phase Drift │
|
|
28
|
+
│ 9. Starweave Celestial Cartography Constellation Nodes Path Traversal │
|
|
29
|
+
│ 10. Crucible Alchemical Fluid / Magma Cell Meter Rise Liquid Surge │
|
|
30
|
+
└────────────────────────────────────────────────────────────────────────────────────────┘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### 1. Lanternwake (Default Signature Identity)
|
|
36
|
+
- **Concept**: Warm amber and glowing embers in a dark room. Grounded in Wishcraft's original lantern metaphor.
|
|
37
|
+
- **Tokens**:
|
|
38
|
+
- `primary`: `#f59e0b` (Warm Amber)
|
|
39
|
+
- `accent`: `#ea580c` (Ember Orange)
|
|
40
|
+
- `surface`: `#0f172a` (Deep Slate)
|
|
41
|
+
- `motionHot`: `#fbbf24` (Golden Flare)
|
|
42
|
+
- `motionTrail`: `#78350f` (Ember Ash)
|
|
43
|
+
- **Signal Grammar**:
|
|
44
|
+
```
|
|
45
|
+
◇ GPT-5.6 ━━━╾✦╼━━━━ main ━━━━━ read ━━━━━ ctx 47%
|
|
46
|
+
```
|
|
47
|
+
- **Motion**: `ember.breathe` — utilizes the mathematical formula from `renderLantern` ($\sin(t \times 1.1) + \sin(t \times 7.3)$) to pulse only during active events.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### 2. Threadbound
|
|
52
|
+
- **Concept**: Artisan tailoring and woven loom mechanics.
|
|
53
|
+
- **Tokens**:
|
|
54
|
+
- `primary`: `#6366f1` (Indigo Thread)
|
|
55
|
+
- `accent`: `#ec4899` (Magenta Stitch)
|
|
56
|
+
- `surface`: `#18181b` (Zinc Weave)
|
|
57
|
+
- **Signal Grammar**:
|
|
58
|
+
```
|
|
59
|
+
model ──╼·╾──── branch ──╼·╾──── tool ──╼◆╾── context
|
|
60
|
+
```
|
|
61
|
+
- **Motion**: `stitch.travel` — step pulse traveling smoothly across thread nodes.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### 3. Scryglass
|
|
66
|
+
- **Concept**: Precision optics, lenses, and refractive glass capsules.
|
|
67
|
+
- **Tokens**:
|
|
68
|
+
- `primary`: `#06b6d4` (Prism Cyan)
|
|
69
|
+
- `accent`: `#8b5cf6` (Lens Violet)
|
|
70
|
+
- `surface`: `#090d16` (Deep Glass)
|
|
71
|
+
- **Signal Grammar**:
|
|
72
|
+
```
|
|
73
|
+
╭ GPT-5.6 ╮────╭ main ╮────╭ read ╮────╭ 47% ╮
|
|
74
|
+
╰─────────╯ ╰──────╯ ╰──────╯ ╰─────╯
|
|
75
|
+
```
|
|
76
|
+
- **Motion**: `refraction.sweep` — light wave passing through each capsule sequentially.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### 4. Runebloom
|
|
81
|
+
- **Concept**: Ancient stone sigils bursting into life upon magic release.
|
|
82
|
+
- **Tokens**:
|
|
83
|
+
- `primary`: `#10b981` (Emerald Moss)
|
|
84
|
+
- `accent`: `#eab308` (Rune Gold)
|
|
85
|
+
- `surface`: `#0c140f` (Forest Granite)
|
|
86
|
+
- **Signal Grammar**:
|
|
87
|
+
```
|
|
88
|
+
◇ GPT-5.6 · main · read · 47%
|
|
89
|
+
```
|
|
90
|
+
- **Motion**: `bloom.on-event` — geometry expands outwardly on state changes, then stabilizes into quiet repose.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### 5. Moonwell
|
|
95
|
+
- **Concept**: Nocturnal sanctuary, silver light, and celestial orbits.
|
|
96
|
+
- **Tokens**:
|
|
97
|
+
- `primary`: `#94a3b8` (Moon Silver)
|
|
98
|
+
- `accent`: `#38bdf8` (Starlight Sky)
|
|
99
|
+
- `surface`: `#020617` (Midnight Black)
|
|
100
|
+
- **Signal Grammar**:
|
|
101
|
+
```
|
|
102
|
+
◜ GPT-5.6 ─── ◝ main ─── ◞ read ─── ◟ 47%
|
|
103
|
+
```
|
|
104
|
+
- **Motion**: `lunar.breathe` — smooth sinusoidal phase transitions echoing orbital mechanics.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 6. Hexforge
|
|
109
|
+
- **Concept**: Heavy forge machinery, steel plating, and thermal conduits.
|
|
110
|
+
- **Tokens**:
|
|
111
|
+
- `primary`: `#f97316` (Forge Orange)
|
|
112
|
+
- `accent`: `#ef4444` (Molten Red)
|
|
113
|
+
- `surface`: `#1c1917` (Anvil Dark)
|
|
114
|
+
- **Signal Grammar**:
|
|
115
|
+
```
|
|
116
|
+
⬡ GPT-5.6 ▰▰ MAIN ▰▰ ◆ READ ▰▰ 47% ⬡
|
|
117
|
+
```
|
|
118
|
+
- **Motion**: `heat.propagate` — thermal wave advancing across block matrices (`█▓▒░`).
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### 7. Vellum
|
|
123
|
+
- **Concept**: Modern editorial, typography, and calligraphic ink strokes.
|
|
124
|
+
- **Tokens**:
|
|
125
|
+
- `primary`: `#d97706` (Old Gold Ink)
|
|
126
|
+
- `accent`: `#a16207` (Deep Sepia)
|
|
127
|
+
- `surface`: `#1a1815` (Dark Parchment)
|
|
128
|
+
- **Signal Grammar**:
|
|
129
|
+
```
|
|
130
|
+
Wishcraft / GPT-5.6
|
|
131
|
+
──────────────────────────────────────╾ main · read · ctx 47%
|
|
132
|
+
```
|
|
133
|
+
- **Motion**: `writing.reveal` — rule line draws from left to right during streaming output.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### 8. Wisp
|
|
138
|
+
- **Concept**: Minimalist ethereal calm, generous negative space, pure essential information.
|
|
139
|
+
- **Tokens**:
|
|
140
|
+
- `primary`: `#cbd5e1` (Morning Mist)
|
|
141
|
+
- `accent`: `#38bdf8` (Ethereal Blue)
|
|
142
|
+
- `surface`: `#0b0f19` (Void Blue)
|
|
143
|
+
- **Signal Grammar**:
|
|
144
|
+
```
|
|
145
|
+
◌ GPT-5.6 main · read · 47%
|
|
146
|
+
```
|
|
147
|
+
- **Motion**: `phase.drift` — subtle, low-frequency opacity breathing.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### 9. Starweave
|
|
152
|
+
- **Concept**: Astrological star maps, navigational geometry, and connected constellations.
|
|
153
|
+
- **Tokens**:
|
|
154
|
+
- `primary`: `#a855f7` (Cosmic Purple)
|
|
155
|
+
- `accent`: `#38bdf8` (Nebula Cyan)
|
|
156
|
+
- `surface`: `#050515` (Deep Space)
|
|
157
|
+
- **Signal Grammar**:
|
|
158
|
+
```
|
|
159
|
+
✦ GPT-5.6 ───· main ·───◆ read ───✦ 47%
|
|
160
|
+
```
|
|
161
|
+
- **Motion**: `path.traverse` — stellar particle moving across intersecting coordinate edges.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### 10. Crucible
|
|
166
|
+
- **Concept**: Dynamic alchemical fluid levels, bubbling reactions, and exothermic changes.
|
|
167
|
+
- **Tokens**:
|
|
168
|
+
- `primary`: `#ec4899` (Alchemical Rose)
|
|
169
|
+
- `accent`: `#f43f5e` (Catalyst Crimson)
|
|
170
|
+
- `surface`: `#110b11` (Basalt Stone)
|
|
171
|
+
- **Signal Grammar**:
|
|
172
|
+
```
|
|
173
|
+
[▓▓▓ GPT-5.6] [▒▒ main] [░ read] [█ 47%]
|
|
174
|
+
```
|
|
175
|
+
- **Motion**: `liquid.rise` — cell density shifts dynamically in response to token consumption rates.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Decoupled Customization Architecture
|
|
180
|
+
|
|
181
|
+
Presets represent harmonious default pairings, but Wishcraft allows complete independence across every dimension:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
┌────────────────────────────────────────────────────────┐
|
|
185
|
+
│ User Custom Configuration │
|
|
186
|
+
│ │
|
|
187
|
+
│ Base Preset: Lanternwake │
|
|
188
|
+
│ Signal Layout: Threadbound │
|
|
189
|
+
│ Token Palette: Scryglass │
|
|
190
|
+
│ Working Motion: Lunar Breathe │
|
|
191
|
+
│ Tool Motion: Heat Propagate │
|
|
192
|
+
│ Frame Chrome: Vellum │
|
|
193
|
+
│ Glyph Set: Nerd Font (Full) │
|
|
194
|
+
└────────────────────────────────────────────────────────┘
|
|
195
|
+
```
|
|
196
|
+
No layer is locked; users can selectively override any aspect without fork or code changes.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Automated Regression Testing & TUI Quality Strategy
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
A polished terminal application requires strict regression testing across layout math, animation timelines, token calculations, and ANSI output correctness.
|
|
6
|
+
|
|
7
|
+
Wishcraft establishes a multi-tiered test strategy that verifies behavior without unstable end-to-end terminal dependencies.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Testing Tiers
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
┌────────────────────────────────────────────────────────┐
|
|
15
|
+
│ 1. Pure Unit Tests (Fast, 100% Deterministic) │
|
|
16
|
+
│ - Token color mappings │
|
|
17
|
+
│ - Preset resolution & overrides │
|
|
18
|
+
│ - Motion frame calculations │
|
|
19
|
+
│ - Event router dispatch matrices │
|
|
20
|
+
└───────────────────────────┬────────────────────────────┘
|
|
21
|
+
│
|
|
22
|
+
┌───────────────────────────▼────────────────────────────┐
|
|
23
|
+
│ 2. Layout & String Geometry Tests │
|
|
24
|
+
│ - Grapheme cluster width calculation │
|
|
25
|
+
│ - Responsive breakpoint truncation │
|
|
26
|
+
│ - Box-drawing alignment & corner connections │
|
|
27
|
+
└───────────────────────────┬────────────────────────────┘
|
|
28
|
+
│
|
|
29
|
+
┌───────────────────────────▼────────────────────────────┐
|
|
30
|
+
│ 3. Snapshot & Golden Master Tests │
|
|
31
|
+
│ - ANSI escape sequence validation │
|
|
32
|
+
│ - 10 Preset layout golden snapshots │
|
|
33
|
+
│ - NO_COLOR and ASCII fallback exports │
|
|
34
|
+
└────────────────────────────────────────────────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Test Automation Invariants
|
|
40
|
+
|
|
41
|
+
1. **No Headless TUI Requirement**: Core algorithms must never instantiate `ctx.ui` or direct terminal stdout in tests. Renderers emit plain string buffers or token trees.
|
|
42
|
+
2. **Deterministic Time Control**: The `MotionScheduler` accepts an injected virtual clock or step function for precise, millisecond-accurate timeline assertions.
|
|
43
|
+
3. **Circular Dependency Prevention**: Verified automatically on every build via `npx madge --circular src/`.
|
|
44
|
+
4. **Strict TypeScript Checking**: `tsc --noEmit` runs under strict mode with zero implicit `any`.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Golden Test Fixtures
|
|
49
|
+
|
|
50
|
+
Every signature preset maintains a golden ANSI snapshot for standard viewport dimensions (`120x30`, `80x24`, `50x15`):
|
|
51
|
+
- `tests/fixtures/presets/lanternwake-120x30.snap`
|
|
52
|
+
- `tests/fixtures/presets/scryglass-80x24.snap`
|
|
53
|
+
- `tests/fixtures/presets/hexforge-no-color.snap`
|
|
54
|
+
- `tests/fixtures/presets/vellum-ascii-fallback.snap`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Responsive Layout & Terminal Viewport Adaptations
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Terminal viewports vary significantly across devices, window panes, and split layouts. Wishcraft dynamically responds to viewport width and height constraints through intelligent layout degradation.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Responsive Breakpoints
|
|
10
|
+
|
|
11
|
+
| Viewport Width | Class | Layout Strategy |
|
|
12
|
+
| :--- | :--- | :--- |
|
|
13
|
+
| **$\ge 120$ cols** | **Wide** | Full 3-column Deck (Nav + Main View + Sidebar) + Full 3-Lane Signal |
|
|
14
|
+
| **$80 - 119$ cols**| **Standard**| 2-column Deck (Nav + Main View) + Standard 3-Lane Signal |
|
|
15
|
+
| **$50 - 79$ cols** | **Compact** | 1-column Deck (Collapsible Nav) + Compressed 2-Lane Signal |
|
|
16
|
+
| **$< 50$ cols** | **Minimal** | Modal Stack Deck + Single-Lane Essential Status |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Signal Lane Degradation
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Wide (120+ cols):
|
|
24
|
+
◆ GPT-5.6 ╾━━━━ main (clean) ━━━━╾✦╼━━━━ read_file: src/render/powerline.ts ━━━━━━━ ctx █████░ 47% (94k)
|
|
25
|
+
|
|
26
|
+
Standard (80-119 cols):
|
|
27
|
+
◆ GPT-5.6 ╾━━━━ main ━━━━╾✦╼━━━━ read_file ━━━━━━━ ctx 47%
|
|
28
|
+
|
|
29
|
+
Compact (50-79 cols):
|
|
30
|
+
◆ GPT-5.6 ── main ── read ── 47%
|
|
31
|
+
|
|
32
|
+
Minimal (< 50 cols):
|
|
33
|
+
◆ GPT-5.6 · 47%
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Deck Viewport Adaptations
|
|
39
|
+
|
|
40
|
+
1. **Wide Viewport ($\ge 120$ cols)**:
|
|
41
|
+
- Navigation pane (20% width)
|
|
42
|
+
- Route workspace (55% width)
|
|
43
|
+
- Activity feed & health sidebar (25% width)
|
|
44
|
+
2. **Standard Viewport ($80 - 119$ cols)**:
|
|
45
|
+
- Sidebar collapses into tabbed secondary panes.
|
|
46
|
+
- Main workspace expands to utilize 75% width.
|
|
47
|
+
3. **Compact Viewport ($50 - 79$ cols)**:
|
|
48
|
+
- Top-level route icons replace full text navigation.
|
|
49
|
+
- Main workspace occupies full width.
|
|
50
|
+
- Jump shortcuts remain fully active.
|
|
51
|
+
4. **Vertical Constraints ($< 24$ rows)**:
|
|
52
|
+
- Ambient header and footer padding are compacted to single rows.
|
|
53
|
+
- Activity stream truncates to most recent 2 events.
|