@visual-z/xeno 0.1.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/README.md +498 -0
- package/docs/install.md +130 -0
- package/package.json +43 -0
- package/src/apps/approve.ts +49 -0
- package/src/apps/cli.ts +37 -0
- package/src/apps/commands.ts +226 -0
- package/src/apps/completions.ts +28 -0
- package/src/apps/input.ts +297 -0
- package/src/apps/render.ts +207 -0
- package/src/apps/shell.ts +2353 -0
- package/src/apps/startup.ts +1302 -0
- package/src/core/benchmark.ts +195 -0
- package/src/core/boundary.ts +174 -0
- package/src/core/churn.ts +59 -0
- package/src/core/completion-review.ts +66 -0
- package/src/core/context-policy.ts +60 -0
- package/src/core/context-window.ts +54 -0
- package/src/core/continuation.ts +114 -0
- package/src/core/cycle.ts +17 -0
- package/src/core/data-query.ts +201 -0
- package/src/core/deadline.ts +39 -0
- package/src/core/derive.ts +489 -0
- package/src/core/edit-plan.ts +200 -0
- package/src/core/environment.ts +29 -0
- package/src/core/event-validation.ts +99 -0
- package/src/core/events.ts +486 -0
- package/src/core/evidence-links.ts +71 -0
- package/src/core/evidence.ts +89 -0
- package/src/core/execution.ts +12 -0
- package/src/core/exhaustive.ts +18 -0
- package/src/core/experiment.ts +40 -0
- package/src/core/export.ts +169 -0
- package/src/core/file-references.ts +35 -0
- package/src/core/frontmatter.ts +213 -0
- package/src/core/handoff.ts +397 -0
- package/src/core/harness-comparison.ts +90 -0
- package/src/core/history-query.ts +103 -0
- package/src/core/history.ts +100 -0
- package/src/core/json-event.ts +135 -0
- package/src/core/json-pointer.ts +46 -0
- package/src/core/keymap.ts +241 -0
- package/src/core/observation-view.ts +87 -0
- package/src/core/outcome.ts +45 -0
- package/src/core/overflow.ts +59 -0
- package/src/core/permissions.ts +182 -0
- package/src/core/policy-evaluation.ts +55 -0
- package/src/core/progress.ts +101 -0
- package/src/core/project.ts +372 -0
- package/src/core/prompts.ts +83 -0
- package/src/core/queue.ts +60 -0
- package/src/core/read-bounds.ts +15 -0
- package/src/core/recall-analysis.ts +90 -0
- package/src/core/recall-trial.ts +153 -0
- package/src/core/response-recovery.ts +46 -0
- package/src/core/scheduling.ts +8 -0
- package/src/core/settings.ts +174 -0
- package/src/core/skills.ts +121 -0
- package/src/core/stall.ts +48 -0
- package/src/core/text-normalize.ts +81 -0
- package/src/core/theme.ts +179 -0
- package/src/core/tokens.ts +149 -0
- package/src/core/tool-contract.ts +102 -0
- package/src/core/tool-input.ts +38 -0
- package/src/core/transcript.ts +60 -0
- package/src/core/window-trial.ts +65 -0
- package/src/core/work-state.ts +103 -0
- package/src/core/yaml.ts +282 -0
- package/src/index.ts +10 -0
- package/src/runtime/auth.ts +255 -0
- package/src/runtime/benchmark.ts +187 -0
- package/src/runtime/catalog.ts +365 -0
- package/src/runtime/evidence-notes.ts +33 -0
- package/src/runtime/exec-sessions.ts +214 -0
- package/src/runtime/execution-control.ts +39 -0
- package/src/runtime/harness-comparison.ts +356 -0
- package/src/runtime/history-tools.ts +108 -0
- package/src/runtime/loop.ts +1983 -0
- package/src/runtime/model.ts +614 -0
- package/src/runtime/models-fetch.ts +155 -0
- package/src/runtime/oauth-device.ts +86 -0
- package/src/runtime/oauth.ts +759 -0
- package/src/runtime/openai-responses.ts +286 -0
- package/src/runtime/openai.ts +675 -0
- package/src/runtime/provider.ts +498 -0
- package/src/runtime/recall-trial.ts +226 -0
- package/src/runtime/resume.ts +66 -0
- package/src/runtime/retry.ts +297 -0
- package/src/runtime/tools.ts +1193 -0
- package/src/runtime/usage.ts +225 -0
- package/src/runtime/window-trial.ts +140 -0
- package/src/runtime/working-notes.ts +30 -0
- package/src/store/atomic.ts +31 -0
- package/src/store/auth-store.ts +50 -0
- package/src/store/blobs.ts +142 -0
- package/src/store/command.ts +75 -0
- package/src/store/config.ts +69 -0
- package/src/store/context-files.ts +356 -0
- package/src/store/file-index.ts +81 -0
- package/src/store/git-branch.ts +35 -0
- package/src/store/history-search.ts +19 -0
- package/src/store/log.ts +642 -0
- package/src/store/models.ts +41 -0
- package/src/store/observations.ts +181 -0
- package/src/store/query-source.ts +44 -0
- package/src/store/recovery.ts +39 -0
- package/src/store/replay.ts +63 -0
- package/src/store/resources.ts +361 -0
- package/src/store/restore.ts +302 -0
- package/src/store/search.ts +644 -0
- package/src/store/serial.ts +13 -0
- package/src/store/sessions.ts +463 -0
- package/src/store/trust.ts +69 -0
- package/src/store/workspace.ts +256 -0
- package/src/store/worktree.ts +233 -0
- package/src/tui/ansi.ts +67 -0
- package/src/tui/autocomplete.ts +29 -0
- package/src/tui/complete.ts +87 -0
- package/src/tui/diff.ts +160 -0
- package/src/tui/editor.ts +893 -0
- package/src/tui/exhaustive.ts +14 -0
- package/src/tui/fuzzy.ts +75 -0
- package/src/tui/host.ts +223 -0
- package/src/tui/input.ts +69 -0
- package/src/tui/keys.ts +378 -0
- package/src/tui/markdown.ts +17 -0
- package/src/tui/render.ts +153 -0
- package/src/tui/select.ts +240 -0
- package/src/tui/settings.ts +40 -0
- package/src/tui/statusline.ts +162 -0
- package/src/tui/style.ts +205 -0
- package/src/tui/terminal.ts +30 -0
- package/src/tui/text.ts +52 -0
- package/src/tui/toolview.ts +386 -0
- package/src/tui/transcript.ts +71 -0
- package/src/tui/tree.ts +405 -0
- package/src/tui/width.ts +567 -0
- package/src/vendor/pi-tui/LICENSE.upstream +21 -0
- package/src/vendor/pi-tui/VENDOR.md +23 -0
- package/src/vendor/pi-tui/alt-screen-search.ts +327 -0
- package/src/vendor/pi-tui/autocomplete.ts +835 -0
- package/src/vendor/pi-tui/components/alt-screen-flash.ts +51 -0
- package/src/vendor/pi-tui/components/box.ts +167 -0
- package/src/vendor/pi-tui/components/cancellable-loader.ts +40 -0
- package/src/vendor/pi-tui/components/editor.ts +2470 -0
- package/src/vendor/pi-tui/components/h-stack.ts +44 -0
- package/src/vendor/pi-tui/components/image.ts +127 -0
- package/src/vendor/pi-tui/components/input.ts +494 -0
- package/src/vendor/pi-tui/components/loader.ts +101 -0
- package/src/vendor/pi-tui/components/markdown.ts +1015 -0
- package/src/vendor/pi-tui/components/mouse-region.ts +33 -0
- package/src/vendor/pi-tui/components/scroll-view.ts +224 -0
- package/src/vendor/pi-tui/components/select-list.ts +273 -0
- package/src/vendor/pi-tui/components/settings-list.ts +328 -0
- package/src/vendor/pi-tui/components/spacer.ts +28 -0
- package/src/vendor/pi-tui/components/stack.ts +154 -0
- package/src/vendor/pi-tui/components/text.ts +107 -0
- package/src/vendor/pi-tui/components/truncated-text.ts +65 -0
- package/src/vendor/pi-tui/components/v-stack.ts +33 -0
- package/src/vendor/pi-tui/editor-component.ts +74 -0
- package/src/vendor/pi-tui/fuzzy.ts +138 -0
- package/src/vendor/pi-tui/index.ts +156 -0
- package/src/vendor/pi-tui/keybindings.ts +320 -0
- package/src/vendor/pi-tui/keys.ts +1401 -0
- package/src/vendor/pi-tui/kill-ring.ts +46 -0
- package/src/vendor/pi-tui/latex.ts +1506 -0
- package/src/vendor/pi-tui/layout-node.ts +51 -0
- package/src/vendor/pi-tui/layout.ts +449 -0
- package/src/vendor/pi-tui/native-modifiers.ts +13 -0
- package/src/vendor/pi-tui/native-module-path.ts +31 -0
- package/src/vendor/pi-tui/native-platform.ts +63 -0
- package/src/vendor/pi-tui/stdin-buffer.ts +444 -0
- package/src/vendor/pi-tui/terminal-colors.ts +73 -0
- package/src/vendor/pi-tui/terminal-image.ts +696 -0
- package/src/vendor/pi-tui/terminal.ts +547 -0
- package/src/vendor/pi-tui/tui-alt-screen.ts +1742 -0
- package/src/vendor/pi-tui/tui-main-screen.ts +655 -0
- package/src/vendor/pi-tui/tui.ts +1456 -0
- package/src/vendor/pi-tui/undo-stack.ts +28 -0
- package/src/vendor/pi-tui/utils.ts +1345 -0
- package/src/vendor/pi-tui/word-navigation.ts +117 -0
package/src/tui/width.ts
ADDED
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column width of a string, counted the way a terminal counts it.
|
|
3
|
+
*
|
|
4
|
+
* JavaScript `s.length` is UTF-16 code units. A CJK ideograph is one unit
|
|
5
|
+
* and two columns; a combining mark is one unit and zero columns. Wrapping
|
|
6
|
+
* and cursor motion both go wrong if those are confused, which is why this
|
|
7
|
+
* is a table and not `.length`.
|
|
8
|
+
*
|
|
9
|
+
* No dependency. The ranges are copied from Unicode 16.0.0 (2024-09-10):
|
|
10
|
+
* - WIDE: EastAsianWidth.txt, property W (Wide) or F (Fullwidth).
|
|
11
|
+
* https://www.unicode.org/Public/16.0.0/ucd/EastAsianWidth.txt
|
|
12
|
+
* UAX #11: https://www.unicode.org/reports/tr11/
|
|
13
|
+
* - ZERO: union of DerivedGeneralCategory.txt Cc/Mn/Me/Cf and
|
|
14
|
+
* DerivedCoreProperties.txt Default_Ignorable_Code_Point.
|
|
15
|
+
* https://www.unicode.org/Public/16.0.0/ucd/
|
|
16
|
+
*
|
|
17
|
+
* Lookup is ZERO first, then WIDE. A few code points (Hangul fillers at
|
|
18
|
+
* U+115F, combining dakuten at U+3099) appear in both source files; they
|
|
19
|
+
* must not advance the cursor.
|
|
20
|
+
*
|
|
21
|
+
* Ambiguous (A) characters are width 1. This is a Western-context terminal,
|
|
22
|
+
* not an East-Asian fullwidth locale; UAX #11 leaves A to the locale.
|
|
23
|
+
*
|
|
24
|
+
* Emoji: characters with EAW W are width 2. Emoji presentation sequences
|
|
25
|
+
* that the UCD lists as Neutral are not in WIDE; VS16 (U+FE0F) is ZERO, so
|
|
26
|
+
* "B" + VS16 stays width 1, which matches wcwidth and most terminals.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
type Range = readonly [start: number, end: number];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Width 0. Each range is from Unicode 16.0 DerivedGeneralCategory (Cc, Mn,
|
|
33
|
+
* Me, Cf) or DerivedCoreProperties (Default_Ignorable_Code_Point), merged.
|
|
34
|
+
* Source of a range is named on the line when it is a well-known block;
|
|
35
|
+
* unmarked ranges are the same union, typically script-specific Mn.
|
|
36
|
+
*/
|
|
37
|
+
const ZERO: readonly Range[] = [
|
|
38
|
+
[0x0, 0x1F], // C0 controls. DerivedGeneralCategory.txt Cc
|
|
39
|
+
[0x7F, 0x9F], // DEL + C1 controls. Cc
|
|
40
|
+
[0xAD, 0xAD], // SOFT HYPHEN. Cf
|
|
41
|
+
[0x300, 0x36F], // Combining Diacritical Marks. Mn
|
|
42
|
+
[0x483, 0x489],
|
|
43
|
+
[0x591, 0x5BD],
|
|
44
|
+
[0x5BF, 0x5BF],
|
|
45
|
+
[0x5C1, 0x5C2],
|
|
46
|
+
[0x5C4, 0x5C5],
|
|
47
|
+
[0x5C7, 0x5C7],
|
|
48
|
+
[0x600, 0x605],
|
|
49
|
+
[0x610, 0x61A],
|
|
50
|
+
[0x61C, 0x61C],
|
|
51
|
+
[0x64B, 0x65F],
|
|
52
|
+
[0x670, 0x670],
|
|
53
|
+
[0x6D6, 0x6DD],
|
|
54
|
+
[0x6DF, 0x6E4],
|
|
55
|
+
[0x6E7, 0x6E8],
|
|
56
|
+
[0x6EA, 0x6ED],
|
|
57
|
+
[0x70F, 0x70F],
|
|
58
|
+
[0x711, 0x711],
|
|
59
|
+
[0x730, 0x74A],
|
|
60
|
+
[0x7A6, 0x7B0],
|
|
61
|
+
[0x7EB, 0x7F3],
|
|
62
|
+
[0x7FD, 0x7FD],
|
|
63
|
+
[0x816, 0x819],
|
|
64
|
+
[0x81B, 0x823],
|
|
65
|
+
[0x825, 0x827],
|
|
66
|
+
[0x829, 0x82D],
|
|
67
|
+
[0x859, 0x85B],
|
|
68
|
+
[0x890, 0x891],
|
|
69
|
+
[0x897, 0x89F],
|
|
70
|
+
[0x8CA, 0x902],
|
|
71
|
+
[0x93A, 0x93A],
|
|
72
|
+
[0x93C, 0x93C],
|
|
73
|
+
[0x941, 0x948],
|
|
74
|
+
[0x94D, 0x94D],
|
|
75
|
+
[0x951, 0x957],
|
|
76
|
+
[0x962, 0x963],
|
|
77
|
+
[0x981, 0x981],
|
|
78
|
+
[0x9BC, 0x9BC],
|
|
79
|
+
[0x9C1, 0x9C4],
|
|
80
|
+
[0x9CD, 0x9CD],
|
|
81
|
+
[0x9E2, 0x9E3],
|
|
82
|
+
[0x9FE, 0x9FE],
|
|
83
|
+
[0xA01, 0xA02],
|
|
84
|
+
[0xA3C, 0xA3C],
|
|
85
|
+
[0xA41, 0xA42],
|
|
86
|
+
[0xA47, 0xA48],
|
|
87
|
+
[0xA4B, 0xA4D],
|
|
88
|
+
[0xA51, 0xA51],
|
|
89
|
+
[0xA70, 0xA71],
|
|
90
|
+
[0xA75, 0xA75],
|
|
91
|
+
[0xA81, 0xA82],
|
|
92
|
+
[0xABC, 0xABC],
|
|
93
|
+
[0xAC1, 0xAC5],
|
|
94
|
+
[0xAC7, 0xAC8],
|
|
95
|
+
[0xACD, 0xACD],
|
|
96
|
+
[0xAE2, 0xAE3],
|
|
97
|
+
[0xAFA, 0xAFF],
|
|
98
|
+
[0xB01, 0xB01],
|
|
99
|
+
[0xB3C, 0xB3C],
|
|
100
|
+
[0xB3F, 0xB3F],
|
|
101
|
+
[0xB41, 0xB44],
|
|
102
|
+
[0xB4D, 0xB4D],
|
|
103
|
+
[0xB55, 0xB56],
|
|
104
|
+
[0xB62, 0xB63],
|
|
105
|
+
[0xB82, 0xB82],
|
|
106
|
+
[0xBC0, 0xBC0],
|
|
107
|
+
[0xBCD, 0xBCD],
|
|
108
|
+
[0xC00, 0xC00],
|
|
109
|
+
[0xC04, 0xC04],
|
|
110
|
+
[0xC3C, 0xC3C],
|
|
111
|
+
[0xC3E, 0xC40],
|
|
112
|
+
[0xC46, 0xC48],
|
|
113
|
+
[0xC4A, 0xC4D],
|
|
114
|
+
[0xC55, 0xC56],
|
|
115
|
+
[0xC62, 0xC63],
|
|
116
|
+
[0xC81, 0xC81],
|
|
117
|
+
[0xCBC, 0xCBC],
|
|
118
|
+
[0xCBF, 0xCBF],
|
|
119
|
+
[0xCC6, 0xCC6],
|
|
120
|
+
[0xCCC, 0xCCD],
|
|
121
|
+
[0xCE2, 0xCE3],
|
|
122
|
+
[0xD00, 0xD01],
|
|
123
|
+
[0xD3B, 0xD3C],
|
|
124
|
+
[0xD41, 0xD44],
|
|
125
|
+
[0xD4D, 0xD4D],
|
|
126
|
+
[0xD62, 0xD63],
|
|
127
|
+
[0xD81, 0xD81],
|
|
128
|
+
[0xDCA, 0xDCA],
|
|
129
|
+
[0xDD2, 0xDD4],
|
|
130
|
+
[0xDD6, 0xDD6],
|
|
131
|
+
[0xE31, 0xE31],
|
|
132
|
+
[0xE34, 0xE3A],
|
|
133
|
+
[0xE47, 0xE4E],
|
|
134
|
+
[0xEB1, 0xEB1],
|
|
135
|
+
[0xEB4, 0xEBC],
|
|
136
|
+
[0xEC8, 0xECE],
|
|
137
|
+
[0xF18, 0xF19],
|
|
138
|
+
[0xF35, 0xF35],
|
|
139
|
+
[0xF37, 0xF37],
|
|
140
|
+
[0xF39, 0xF39],
|
|
141
|
+
[0xF71, 0xF7E],
|
|
142
|
+
[0xF80, 0xF84],
|
|
143
|
+
[0xF86, 0xF87],
|
|
144
|
+
[0xF8D, 0xF97],
|
|
145
|
+
[0xF99, 0xFBC],
|
|
146
|
+
[0xFC6, 0xFC6],
|
|
147
|
+
[0x102D, 0x1030],
|
|
148
|
+
[0x1032, 0x1037],
|
|
149
|
+
[0x1039, 0x103A],
|
|
150
|
+
[0x103D, 0x103E],
|
|
151
|
+
[0x1058, 0x1059],
|
|
152
|
+
[0x105E, 0x1060],
|
|
153
|
+
[0x1071, 0x1074],
|
|
154
|
+
[0x1082, 0x1082],
|
|
155
|
+
[0x1085, 0x1086],
|
|
156
|
+
[0x108D, 0x108D],
|
|
157
|
+
[0x109D, 0x109D],
|
|
158
|
+
[0x115F, 0x1160],
|
|
159
|
+
[0x135D, 0x135F],
|
|
160
|
+
[0x1712, 0x1714],
|
|
161
|
+
[0x1732, 0x1733],
|
|
162
|
+
[0x1752, 0x1753],
|
|
163
|
+
[0x1772, 0x1773],
|
|
164
|
+
[0x17B4, 0x17B5],
|
|
165
|
+
[0x17B7, 0x17BD],
|
|
166
|
+
[0x17C6, 0x17C6],
|
|
167
|
+
[0x17C9, 0x17D3],
|
|
168
|
+
[0x17DD, 0x17DD],
|
|
169
|
+
[0x180B, 0x180F],
|
|
170
|
+
[0x1885, 0x1886],
|
|
171
|
+
[0x18A9, 0x18A9],
|
|
172
|
+
[0x1920, 0x1922],
|
|
173
|
+
[0x1927, 0x1928],
|
|
174
|
+
[0x1932, 0x1932],
|
|
175
|
+
[0x1939, 0x193B],
|
|
176
|
+
[0x1A17, 0x1A18],
|
|
177
|
+
[0x1A1B, 0x1A1B],
|
|
178
|
+
[0x1A56, 0x1A56],
|
|
179
|
+
[0x1A58, 0x1A5E],
|
|
180
|
+
[0x1A60, 0x1A60],
|
|
181
|
+
[0x1A62, 0x1A62],
|
|
182
|
+
[0x1A65, 0x1A6C],
|
|
183
|
+
[0x1A73, 0x1A7C],
|
|
184
|
+
[0x1A7F, 0x1A7F],
|
|
185
|
+
[0x1AB0, 0x1ACE], // Combining Diacritical Marks Extended. Mn
|
|
186
|
+
[0x1B00, 0x1B03],
|
|
187
|
+
[0x1B34, 0x1B34],
|
|
188
|
+
[0x1B36, 0x1B3A],
|
|
189
|
+
[0x1B3C, 0x1B3C],
|
|
190
|
+
[0x1B42, 0x1B42],
|
|
191
|
+
[0x1B6B, 0x1B73],
|
|
192
|
+
[0x1B80, 0x1B81],
|
|
193
|
+
[0x1BA2, 0x1BA5],
|
|
194
|
+
[0x1BA8, 0x1BA9],
|
|
195
|
+
[0x1BAB, 0x1BAD],
|
|
196
|
+
[0x1BE6, 0x1BE6],
|
|
197
|
+
[0x1BE8, 0x1BE9],
|
|
198
|
+
[0x1BED, 0x1BED],
|
|
199
|
+
[0x1BEF, 0x1BF1],
|
|
200
|
+
[0x1C2C, 0x1C33],
|
|
201
|
+
[0x1C36, 0x1C37],
|
|
202
|
+
[0x1CD0, 0x1CD2],
|
|
203
|
+
[0x1CD4, 0x1CE0],
|
|
204
|
+
[0x1CE2, 0x1CE8],
|
|
205
|
+
[0x1CED, 0x1CED],
|
|
206
|
+
[0x1CF4, 0x1CF4],
|
|
207
|
+
[0x1CF8, 0x1CF9],
|
|
208
|
+
[0x1DC0, 0x1DFF], // Combining Diacritical Marks Supplement. Mn
|
|
209
|
+
[0x200B, 0x200F], // ZWSP / ZWNJ / ZWJ / LRM / RLM. Cf + Default_Ignorable
|
|
210
|
+
[0x202A, 0x202E],
|
|
211
|
+
[0x2060, 0x206F],
|
|
212
|
+
[0x20D0, 0x20F0], // Combining Diacritical Marks for Symbols. Mn
|
|
213
|
+
[0x2CEF, 0x2CF1],
|
|
214
|
+
[0x2D7F, 0x2D7F],
|
|
215
|
+
[0x2DE0, 0x2DFF],
|
|
216
|
+
[0x302A, 0x302D],
|
|
217
|
+
[0x3099, 0x309A],
|
|
218
|
+
[0x3164, 0x3164],
|
|
219
|
+
[0xA66F, 0xA672],
|
|
220
|
+
[0xA674, 0xA67D],
|
|
221
|
+
[0xA69E, 0xA69F],
|
|
222
|
+
[0xA6F0, 0xA6F1],
|
|
223
|
+
[0xA802, 0xA802],
|
|
224
|
+
[0xA806, 0xA806],
|
|
225
|
+
[0xA80B, 0xA80B],
|
|
226
|
+
[0xA825, 0xA826],
|
|
227
|
+
[0xA82C, 0xA82C],
|
|
228
|
+
[0xA8C4, 0xA8C5],
|
|
229
|
+
[0xA8E0, 0xA8F1],
|
|
230
|
+
[0xA8FF, 0xA8FF],
|
|
231
|
+
[0xA926, 0xA92D],
|
|
232
|
+
[0xA947, 0xA951],
|
|
233
|
+
[0xA980, 0xA982],
|
|
234
|
+
[0xA9B3, 0xA9B3],
|
|
235
|
+
[0xA9B6, 0xA9B9],
|
|
236
|
+
[0xA9BC, 0xA9BD],
|
|
237
|
+
[0xA9E5, 0xA9E5],
|
|
238
|
+
[0xAA29, 0xAA2E],
|
|
239
|
+
[0xAA31, 0xAA32],
|
|
240
|
+
[0xAA35, 0xAA36],
|
|
241
|
+
[0xAA43, 0xAA43],
|
|
242
|
+
[0xAA4C, 0xAA4C],
|
|
243
|
+
[0xAA7C, 0xAA7C],
|
|
244
|
+
[0xAAB0, 0xAAB0],
|
|
245
|
+
[0xAAB2, 0xAAB4],
|
|
246
|
+
[0xAAB7, 0xAAB8],
|
|
247
|
+
[0xAABE, 0xAABF],
|
|
248
|
+
[0xAAC1, 0xAAC1],
|
|
249
|
+
[0xAAEC, 0xAAED],
|
|
250
|
+
[0xAAF6, 0xAAF6],
|
|
251
|
+
[0xABE5, 0xABE5],
|
|
252
|
+
[0xABE8, 0xABE8],
|
|
253
|
+
[0xABED, 0xABED],
|
|
254
|
+
[0xFB1E, 0xFB1E],
|
|
255
|
+
[0xFE00, 0xFE0F], // Variation Selectors (including VS16 emoji presentation). Mn
|
|
256
|
+
[0xFE20, 0xFE2F], // Combining Half Marks. Mn
|
|
257
|
+
[0xFEFF, 0xFEFF], // BOM / ZWNBSP. Cf
|
|
258
|
+
[0xFFA0, 0xFFA0],
|
|
259
|
+
[0xFFF0, 0xFFFB],
|
|
260
|
+
[0x101FD, 0x101FD],
|
|
261
|
+
[0x102E0, 0x102E0],
|
|
262
|
+
[0x10376, 0x1037A],
|
|
263
|
+
[0x10A01, 0x10A03],
|
|
264
|
+
[0x10A05, 0x10A06],
|
|
265
|
+
[0x10A0C, 0x10A0F],
|
|
266
|
+
[0x10A38, 0x10A3A],
|
|
267
|
+
[0x10A3F, 0x10A3F],
|
|
268
|
+
[0x10AE5, 0x10AE6],
|
|
269
|
+
[0x10D24, 0x10D27],
|
|
270
|
+
[0x10D69, 0x10D6D],
|
|
271
|
+
[0x10EAB, 0x10EAC],
|
|
272
|
+
[0x10EFC, 0x10EFF],
|
|
273
|
+
[0x10F46, 0x10F50],
|
|
274
|
+
[0x10F82, 0x10F85],
|
|
275
|
+
[0x11001, 0x11001],
|
|
276
|
+
[0x11038, 0x11046],
|
|
277
|
+
[0x11070, 0x11070],
|
|
278
|
+
[0x11073, 0x11074],
|
|
279
|
+
[0x1107F, 0x11081],
|
|
280
|
+
[0x110B3, 0x110B6],
|
|
281
|
+
[0x110B9, 0x110BA],
|
|
282
|
+
[0x110BD, 0x110BD],
|
|
283
|
+
[0x110C2, 0x110C2],
|
|
284
|
+
[0x110CD, 0x110CD],
|
|
285
|
+
[0x11100, 0x11102],
|
|
286
|
+
[0x11127, 0x1112B],
|
|
287
|
+
[0x1112D, 0x11134],
|
|
288
|
+
[0x11173, 0x11173],
|
|
289
|
+
[0x11180, 0x11181],
|
|
290
|
+
[0x111B6, 0x111BE],
|
|
291
|
+
[0x111C9, 0x111CC],
|
|
292
|
+
[0x111CF, 0x111CF],
|
|
293
|
+
[0x1122F, 0x11231],
|
|
294
|
+
[0x11234, 0x11234],
|
|
295
|
+
[0x11236, 0x11237],
|
|
296
|
+
[0x1123E, 0x1123E],
|
|
297
|
+
[0x11241, 0x11241],
|
|
298
|
+
[0x112DF, 0x112DF],
|
|
299
|
+
[0x112E3, 0x112EA],
|
|
300
|
+
[0x11300, 0x11301],
|
|
301
|
+
[0x1133B, 0x1133C],
|
|
302
|
+
[0x11340, 0x11340],
|
|
303
|
+
[0x11366, 0x1136C],
|
|
304
|
+
[0x11370, 0x11374],
|
|
305
|
+
[0x113BB, 0x113C0],
|
|
306
|
+
[0x113CE, 0x113CE],
|
|
307
|
+
[0x113D0, 0x113D0],
|
|
308
|
+
[0x113D2, 0x113D2],
|
|
309
|
+
[0x113E1, 0x113E2],
|
|
310
|
+
[0x11438, 0x1143F],
|
|
311
|
+
[0x11442, 0x11444],
|
|
312
|
+
[0x11446, 0x11446],
|
|
313
|
+
[0x1145E, 0x1145E],
|
|
314
|
+
[0x114B3, 0x114B8],
|
|
315
|
+
[0x114BA, 0x114BA],
|
|
316
|
+
[0x114BF, 0x114C0],
|
|
317
|
+
[0x114C2, 0x114C3],
|
|
318
|
+
[0x115B2, 0x115B5],
|
|
319
|
+
[0x115BC, 0x115BD],
|
|
320
|
+
[0x115BF, 0x115C0],
|
|
321
|
+
[0x115DC, 0x115DD],
|
|
322
|
+
[0x11633, 0x1163A],
|
|
323
|
+
[0x1163D, 0x1163D],
|
|
324
|
+
[0x1163F, 0x11640],
|
|
325
|
+
[0x116AB, 0x116AB],
|
|
326
|
+
[0x116AD, 0x116AD],
|
|
327
|
+
[0x116B0, 0x116B5],
|
|
328
|
+
[0x116B7, 0x116B7],
|
|
329
|
+
[0x1171D, 0x1171D],
|
|
330
|
+
[0x1171F, 0x1171F],
|
|
331
|
+
[0x11722, 0x11725],
|
|
332
|
+
[0x11727, 0x1172B],
|
|
333
|
+
[0x1182F, 0x11837],
|
|
334
|
+
[0x11839, 0x1183A],
|
|
335
|
+
[0x1193B, 0x1193C],
|
|
336
|
+
[0x1193E, 0x1193E],
|
|
337
|
+
[0x11943, 0x11943],
|
|
338
|
+
[0x119D4, 0x119D7],
|
|
339
|
+
[0x119DA, 0x119DB],
|
|
340
|
+
[0x119E0, 0x119E0],
|
|
341
|
+
[0x11A01, 0x11A0A],
|
|
342
|
+
[0x11A33, 0x11A38],
|
|
343
|
+
[0x11A3B, 0x11A3E],
|
|
344
|
+
[0x11A47, 0x11A47],
|
|
345
|
+
[0x11A51, 0x11A56],
|
|
346
|
+
[0x11A59, 0x11A5B],
|
|
347
|
+
[0x11A8A, 0x11A96],
|
|
348
|
+
[0x11A98, 0x11A99],
|
|
349
|
+
[0x11C30, 0x11C36],
|
|
350
|
+
[0x11C38, 0x11C3D],
|
|
351
|
+
[0x11C3F, 0x11C3F],
|
|
352
|
+
[0x11C92, 0x11CA7],
|
|
353
|
+
[0x11CAA, 0x11CB0],
|
|
354
|
+
[0x11CB2, 0x11CB3],
|
|
355
|
+
[0x11CB5, 0x11CB6],
|
|
356
|
+
[0x11D31, 0x11D36],
|
|
357
|
+
[0x11D3A, 0x11D3A],
|
|
358
|
+
[0x11D3C, 0x11D3D],
|
|
359
|
+
[0x11D3F, 0x11D45],
|
|
360
|
+
[0x11D47, 0x11D47],
|
|
361
|
+
[0x11D90, 0x11D91],
|
|
362
|
+
[0x11D95, 0x11D95],
|
|
363
|
+
[0x11D97, 0x11D97],
|
|
364
|
+
[0x11EF3, 0x11EF4],
|
|
365
|
+
[0x11F00, 0x11F01],
|
|
366
|
+
[0x11F36, 0x11F3A],
|
|
367
|
+
[0x11F40, 0x11F40],
|
|
368
|
+
[0x11F42, 0x11F42],
|
|
369
|
+
[0x11F5A, 0x11F5A],
|
|
370
|
+
[0x13430, 0x13440],
|
|
371
|
+
[0x13447, 0x13455],
|
|
372
|
+
[0x1611E, 0x16129],
|
|
373
|
+
[0x1612D, 0x1612F],
|
|
374
|
+
[0x16AF0, 0x16AF4],
|
|
375
|
+
[0x16B30, 0x16B36],
|
|
376
|
+
[0x16F4F, 0x16F4F],
|
|
377
|
+
[0x16F8F, 0x16F92],
|
|
378
|
+
[0x16FE4, 0x16FE4],
|
|
379
|
+
[0x1BC9D, 0x1BC9E],
|
|
380
|
+
[0x1BCA0, 0x1BCA3],
|
|
381
|
+
[0x1CF00, 0x1CF2D],
|
|
382
|
+
[0x1CF30, 0x1CF46],
|
|
383
|
+
[0x1D167, 0x1D169],
|
|
384
|
+
[0x1D173, 0x1D182],
|
|
385
|
+
[0x1D185, 0x1D18B],
|
|
386
|
+
[0x1D1AA, 0x1D1AD],
|
|
387
|
+
[0x1D242, 0x1D244],
|
|
388
|
+
[0x1DA00, 0x1DA36],
|
|
389
|
+
[0x1DA3B, 0x1DA6C],
|
|
390
|
+
[0x1DA75, 0x1DA75],
|
|
391
|
+
[0x1DA84, 0x1DA84],
|
|
392
|
+
[0x1DA9B, 0x1DA9F],
|
|
393
|
+
[0x1DAA1, 0x1DAAF],
|
|
394
|
+
[0x1E000, 0x1E006],
|
|
395
|
+
[0x1E008, 0x1E018],
|
|
396
|
+
[0x1E01B, 0x1E021],
|
|
397
|
+
[0x1E023, 0x1E024],
|
|
398
|
+
[0x1E026, 0x1E02A],
|
|
399
|
+
[0x1E08F, 0x1E08F],
|
|
400
|
+
[0x1E130, 0x1E136],
|
|
401
|
+
[0x1E2AE, 0x1E2AE],
|
|
402
|
+
[0x1E2EC, 0x1E2EF],
|
|
403
|
+
[0x1E4EC, 0x1E4EF],
|
|
404
|
+
[0x1E5EE, 0x1E5EF],
|
|
405
|
+
[0x1E8D0, 0x1E8D6],
|
|
406
|
+
[0x1E944, 0x1E94A],
|
|
407
|
+
[0xE0000, 0xE0FFF], // Tags + Variation Selectors Supplement. Default_Ignorable
|
|
408
|
+
];
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Width 2. Each range is from Unicode 16.0 EastAsianWidth.txt, property W
|
|
412
|
+
* or F, merged. Unmarked ranges are the same file (mostly emoji fragments
|
|
413
|
+
* and smaller W blocks).
|
|
414
|
+
*/
|
|
415
|
+
const WIDE: readonly Range[] = [
|
|
416
|
+
[0x1100, 0x115F], // Hangul Jamo
|
|
417
|
+
[0x231A, 0x231B], // watch / hourglass / media (emoji, BMP)
|
|
418
|
+
[0x2329, 0x232A],
|
|
419
|
+
[0x23E9, 0x23EC],
|
|
420
|
+
[0x23F0, 0x23F0],
|
|
421
|
+
[0x23F3, 0x23F3],
|
|
422
|
+
[0x25FD, 0x25FE],
|
|
423
|
+
[0x2614, 0x2615],
|
|
424
|
+
[0x2630, 0x2637],
|
|
425
|
+
[0x2648, 0x2653],
|
|
426
|
+
[0x267F, 0x267F],
|
|
427
|
+
[0x268A, 0x268F],
|
|
428
|
+
[0x2693, 0x2693],
|
|
429
|
+
[0x26A1, 0x26A1],
|
|
430
|
+
[0x26AA, 0x26AB],
|
|
431
|
+
[0x26BD, 0x26BE],
|
|
432
|
+
[0x26C4, 0x26C5],
|
|
433
|
+
[0x26CE, 0x26CE],
|
|
434
|
+
[0x26D4, 0x26D4],
|
|
435
|
+
[0x26EA, 0x26EA],
|
|
436
|
+
[0x26F2, 0x26F3],
|
|
437
|
+
[0x26F5, 0x26F5],
|
|
438
|
+
[0x26FA, 0x26FA],
|
|
439
|
+
[0x26FD, 0x26FD],
|
|
440
|
+
[0x2705, 0x2705],
|
|
441
|
+
[0x270A, 0x270B],
|
|
442
|
+
[0x2728, 0x2728],
|
|
443
|
+
[0x274C, 0x274C],
|
|
444
|
+
[0x274E, 0x274E],
|
|
445
|
+
[0x2753, 0x2755],
|
|
446
|
+
[0x2757, 0x2757],
|
|
447
|
+
[0x2795, 0x2797],
|
|
448
|
+
[0x27B0, 0x27B0],
|
|
449
|
+
[0x27BF, 0x27BF],
|
|
450
|
+
[0x2B1B, 0x2B1C],
|
|
451
|
+
[0x2B50, 0x2B50],
|
|
452
|
+
[0x2B55, 0x2B55],
|
|
453
|
+
[0x2E80, 0x2E99], // CJK radicals / Kangxi / ideographic description
|
|
454
|
+
[0x2E9B, 0x2EF3],
|
|
455
|
+
[0x2F00, 0x2FD5],
|
|
456
|
+
[0x2FF0, 0x303E],
|
|
457
|
+
[0x3041, 0x3096], // Hiragana
|
|
458
|
+
[0x3099, 0x30FF], // Katakana (includes combining dakuten, which ZERO wins)
|
|
459
|
+
[0x3105, 0x312F], // Bopomofo / Hangul compatibility jamo / CJK strokes
|
|
460
|
+
[0x3131, 0x318E],
|
|
461
|
+
[0x3190, 0x31E5],
|
|
462
|
+
[0x31EF, 0x321E],
|
|
463
|
+
[0x3220, 0x3247],
|
|
464
|
+
[0x3250, 0xA48C], // Enclosed CJK / CJK Unified Ideographs / Yi
|
|
465
|
+
[0xA490, 0xA4C6],
|
|
466
|
+
[0xA960, 0xA97C], // Hangul Jamo Extended-A
|
|
467
|
+
[0xAC00, 0xD7A3], // Hangul syllables
|
|
468
|
+
[0xF900, 0xFAFF], // CJK Compatibility Ideographs
|
|
469
|
+
[0xFE10, 0xFE19],
|
|
470
|
+
[0xFE30, 0xFE52],
|
|
471
|
+
[0xFE54, 0xFE66],
|
|
472
|
+
[0xFE68, 0xFE6B],
|
|
473
|
+
[0xFF01, 0xFF60], // Fullwidth ASCII variants
|
|
474
|
+
[0xFFE0, 0xFFE6], // Fullwidth symbol variants
|
|
475
|
+
[0x16FE0, 0x16FE4],
|
|
476
|
+
[0x16FF0, 0x16FF1],
|
|
477
|
+
[0x17000, 0x187F7], // Tangut
|
|
478
|
+
[0x18800, 0x18CD5],
|
|
479
|
+
[0x18CFF, 0x18D08],
|
|
480
|
+
[0x1AFF0, 0x1AFF3],
|
|
481
|
+
[0x1AFF5, 0x1AFFB],
|
|
482
|
+
[0x1AFFD, 0x1AFFE],
|
|
483
|
+
[0x1B000, 0x1B122],
|
|
484
|
+
[0x1B132, 0x1B132],
|
|
485
|
+
[0x1B150, 0x1B152],
|
|
486
|
+
[0x1B155, 0x1B155],
|
|
487
|
+
[0x1B164, 0x1B167],
|
|
488
|
+
[0x1B170, 0x1B2FB],
|
|
489
|
+
[0x1D300, 0x1D356],
|
|
490
|
+
[0x1D360, 0x1D376],
|
|
491
|
+
[0x1F004, 0x1F004],
|
|
492
|
+
[0x1F0CF, 0x1F0CF],
|
|
493
|
+
[0x1F18E, 0x1F18E],
|
|
494
|
+
[0x1F191, 0x1F19A],
|
|
495
|
+
[0x1F200, 0x1F202],
|
|
496
|
+
[0x1F210, 0x1F23B],
|
|
497
|
+
[0x1F240, 0x1F248],
|
|
498
|
+
[0x1F250, 0x1F251],
|
|
499
|
+
[0x1F260, 0x1F265],
|
|
500
|
+
[0x1F300, 0x1F320], // Miscellaneous Symbols and Pictographs (emoji)
|
|
501
|
+
[0x1F32D, 0x1F335],
|
|
502
|
+
[0x1F337, 0x1F37C],
|
|
503
|
+
[0x1F37E, 0x1F393],
|
|
504
|
+
[0x1F3A0, 0x1F3CA],
|
|
505
|
+
[0x1F3CF, 0x1F3D3],
|
|
506
|
+
[0x1F3E0, 0x1F3F0],
|
|
507
|
+
[0x1F3F4, 0x1F3F4],
|
|
508
|
+
[0x1F3F8, 0x1F43E],
|
|
509
|
+
[0x1F440, 0x1F440],
|
|
510
|
+
[0x1F442, 0x1F4FC],
|
|
511
|
+
[0x1F4FF, 0x1F53D],
|
|
512
|
+
[0x1F54B, 0x1F54E],
|
|
513
|
+
[0x1F550, 0x1F567],
|
|
514
|
+
[0x1F57A, 0x1F57A],
|
|
515
|
+
[0x1F595, 0x1F596],
|
|
516
|
+
[0x1F5A4, 0x1F5A4],
|
|
517
|
+
[0x1F5FB, 0x1F64F],
|
|
518
|
+
[0x1F680, 0x1F6C5],
|
|
519
|
+
[0x1F6CC, 0x1F6CC],
|
|
520
|
+
[0x1F6D0, 0x1F6D2],
|
|
521
|
+
[0x1F6D5, 0x1F6D7],
|
|
522
|
+
[0x1F6DC, 0x1F6DF],
|
|
523
|
+
[0x1F6EB, 0x1F6EC],
|
|
524
|
+
[0x1F6F4, 0x1F6FC],
|
|
525
|
+
[0x1F7E0, 0x1F7EB],
|
|
526
|
+
[0x1F7F0, 0x1F7F0],
|
|
527
|
+
[0x1F90C, 0x1F93A],
|
|
528
|
+
[0x1F93C, 0x1F945],
|
|
529
|
+
[0x1F947, 0x1F9FF],
|
|
530
|
+
[0x1FA70, 0x1FA7C],
|
|
531
|
+
[0x1FA80, 0x1FA89],
|
|
532
|
+
[0x1FA8F, 0x1FAC6],
|
|
533
|
+
[0x1FACE, 0x1FADC],
|
|
534
|
+
[0x1FADF, 0x1FAE9],
|
|
535
|
+
[0x1FAF0, 0x1FAF8],
|
|
536
|
+
[0x20000, 0x2FFFD], // CJK Unified Ideographs Extension B–F (Plane 2 default W)
|
|
537
|
+
[0x30000, 0x3FFFD], // CJK Unified Ideographs Extension G–H (Plane 3 default W)
|
|
538
|
+
];
|
|
539
|
+
|
|
540
|
+
function inRanges(cp: number, ranges: readonly Range[]): boolean {
|
|
541
|
+
let lo = 0;
|
|
542
|
+
let hi = ranges.length - 1;
|
|
543
|
+
while (lo <= hi) {
|
|
544
|
+
const mid = (lo + hi) >> 1;
|
|
545
|
+
const range = ranges[mid];
|
|
546
|
+
if (range === undefined) return false;
|
|
547
|
+
const [start, end] = range;
|
|
548
|
+
if (cp < start) hi = mid - 1;
|
|
549
|
+
else if (cp > end) lo = mid + 1;
|
|
550
|
+
else return true;
|
|
551
|
+
}
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function widthOf(cp: number): number {
|
|
556
|
+
if (inRanges(cp, ZERO)) return 0;
|
|
557
|
+
if (inRanges(cp, WIDE)) return 2;
|
|
558
|
+
return 1;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export function displayWidth(s: string): number {
|
|
562
|
+
let w = 0;
|
|
563
|
+
for (const ch of s) {
|
|
564
|
+
w += widthOf(ch.codePointAt(0)!);
|
|
565
|
+
}
|
|
566
|
+
return w;
|
|
567
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mario Zechner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Vendored: pi TUI
|
|
2
|
+
|
|
3
|
+
Source: https://github.com/earendil-works/pi — `packages/tui/src`
|
|
4
|
+
License: MIT (see `LICENSE.upstream`), Copyright (c) 2025 Mario Zechner
|
|
5
|
+
Copied: 2026-09-21
|
|
6
|
+
Commit: `3390bd93630965a12a0a1a5c36ce890ec22f7e1d`
|
|
7
|
+
|
|
8
|
+
The application also follows coding-agent's CustomEditor, searchable model
|
|
9
|
+
selector and interactive-mode composition. Those product behaviors are adapted
|
|
10
|
+
in `src/tui/` and `src/apps/`; Pi's AgentSession is not imported. Its dark/light
|
|
11
|
+
palette is mapped into `src/core/theme.ts` with attribution there.
|
|
12
|
+
|
|
13
|
+
This directory is an **unmodified copy**. Do not patch it in place: upgrade
|
|
14
|
+
by recopying from upstream. Behaviour changes belong in `src/tui/`, which
|
|
15
|
+
adapts this to xeno and is the only thing allowed to import from here.
|
|
16
|
+
|
|
17
|
+
`AGENTS.md` exempts `src/vendor/` from the import-shape and dependency
|
|
18
|
+
checks, because those exist to keep *our* code's layering decidable and
|
|
19
|
+
upstream organises its code its own way.
|
|
20
|
+
|
|
21
|
+
Native modules (`native-*.ts`) are optional: `isNativeModifierPressed`
|
|
22
|
+
returns false when no helper loads, so the prebuilt `.node` binaries from
|
|
23
|
+
upstream are deliberately NOT copied.
|