← Catalog

@pi-in-go/pigpen-pitui

Shared Go library: the subset of pi-tui (Editor, Markdown, Text, Container, Spacer, DynamicBorder, keys, keybindings, width helpers) that Pigpen extensions need, adapted from PiG's tui. A stopgap until PiG ships tui as a standalone module.…

PackagePigpen

Install

Install with PiG

pig install npm:@pi-in-go/pigpen-pitui
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package. This one is published by the PiG project from the Pigpen repository; that is not a verification claim.

Pi manifest JSON

The pi field of package.json.

{}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

pitui

The subset of pi-tui that Pigpen extensions need, as a shared Go library (package tui, module github.com/MichaelKinsy/pigpen/components/pitui). It is adapted from PiG's tui package (v0.5.0, commit 7a5422f66d), which ports Pi's pi-tui, with PiG's application features removed; the Pi it ports is commit 1402973a9d ("1.3.0+1402973a"). It has no extension of its own.

Used by ask-user-question (the interactive questionnaire: Editor, Markdown, Text, Container, Spacer, DynamicBorder, keys and keybindings, widthx). Other Packages that need pi-tui components may import it the same way (use ( . ../../../pitui ) in the extension's go.work, require … v0.0.0).

Stopgap. This is a copy, not a fork to maintain: it exists until PiG ships tui as a standalone module with a pi-tui-shaped API (core item C1), at which point this Package is deleted and importers switch.

What is in it

Component, Container, Spacer, Text, DynamicBorder, Editor (NewEditor(EditorTheme), pi-tui dispatch order, paste markers, undo, kill ring, UTF-16 cursor), Markdown, MatchesKey / IsKeyRelease / IsKeyRepeat / Key*, Keybindings / NewKeybindings (tui.* ids and app.editor.external), the fake-cursor markers with ResolveFakeCursors, and the subpackages widthx, jsstring, jsnumber, wordsegmenter, lazyregexp, latex. doc.go lists every exported name and every deviation from Pi and PiG v0.5.0; in short: no mouse, status indicator, autocomplete, remote editor, thinking/bash borders, global theme, async markdown or alt-screen keys; Editor.Render emits pi-tui's fake-cursor APC markers; OnChange fires once per input chunk.

Tests

go vet ./... && go test ./... (tests are PiG's, adapted; see CREDITS.md).

File groups

GroupFilesLines
Root code, copied from PiG v0.5.0 and pruned/adapted20 files9465
Root code, rewritten from pi-tui / pi-coding-agent8 files432
Root tests (PiG v0.5.0 tests, adapted) + shims76 files9919
widthx/ code (PiG v0.5.0 copy)12 files5506
widthx/ tests25 files2193
widthx/ data, generators and notes24 files5762
jsstring/ code (PiG v0.5.0 copy)11 files782
jsstring/ tests14 files629
jsnumber/ code (PiG v0.5.0 copy)2 files364
jsnumber/ tests3 files252
jsnumber/ data, generators and notes1 files24
wordsegmenter/ code (PiG v0.5.0 copy)7 files2139
wordsegmenter/ tests2 files71
wordsegmenter/ data, generators and notes11 files42875
lazyregexp/ code (PiG v0.5.0 copy)1 files357
lazyregexp/ tests2 files233
latex/ code (PiG v0.5.0 copy)4 files2031
latex/ tests3 files900
latex/ data, generators and notes4 files1047
jsarray/ code (PiG v0.5.0 copy)1 files492
jsarray/ tests1 files45
jsarray/ data, generators and notes1 files1
internal/hljs/ code (PiG v0.5.0 copy)10 files4363
internal/hljs/ tests10 files1115
internal/hljs/ data, generators and notes5 files5213
testdata/ (PiG v0.5.0 goldens the kept tests read)4 files2985
port/oracle/pi/ (Pi sources, unmodified)47 files19565

Every file by name is in CREDITS.md and doc.go.