@vibelord/lanes 1.7.6 → 1.8.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 +13 -9
- package/package.json +1 -1
- package/payload/lanes/README.md +2 -2
- package/payload/lanes/VERSION +1 -1
- package/payload/lanes/bin/lanes +26 -4
- package/payload/lanes/bin/lanes-site-serve +4 -8
- package/payload/lanes/bin-rs/BINARIES.json +17 -2
- package/payload/lanes/bin-rs/THIRD-PARTY-NOTICES +18953 -0
- package/payload/lanes/bin-rs/x86_64-unknown-linux-musl/lanes-hook +0 -0
- package/payload/lanes/bin-rs/x86_64-unknown-linux-musl/lanes-terminal +0 -0
- package/payload/lanes/client/lanes-launch +4 -2
- package/payload/lanes/container/lane-mcp +1 -1
- package/payload/lanes/container/lane_core.py +4 -3
- package/payload/lanes/docs/ARCHITECTURE.md +38 -9
- package/payload/lanes/docs/RUNBOOK.md +123 -53
- package/payload/lanes/docs/USERGUIDE.md +68 -9
- package/payload/lanes/install/lanes-host.service.in +25 -0
- package/payload/lanes/install/services.py +243 -0
- package/payload/lanes/libexec/agent_state.py +3 -1
- package/payload/lanes/libexec/attach.py +139 -21
- package/payload/lanes/libexec/cutover.py +24 -4
- package/payload/lanes/libexec/doctor_lanes2.py +3 -3
- package/payload/lanes/libexec/native.sh +2 -2
- package/payload/lanes/libexec/native_bin.py +595 -109
- package/payload/lanes/libexec/shadow.py +51 -3
- package/payload/lanes/libexec/sidebar.py +208 -35
- package/payload/lanes/libexec/sidebar_status.py +190 -80
- package/payload/lanes/libexec/update.py +12 -3
- package/payload/lanes/site/protocol.py +24 -9
- package/payload/lanes/site/relay.py +292 -0
- package/payload/lanes/site/server.py +31 -3
- package/payload/lanes/web/README.md +6 -6
- package/payload/lanes/web/directory.js +10 -8
- package/payload/lanes/web/generated/README.md +85 -21
- package/payload/lanes/web/generated/lanes2_protocol.d.mts +4190 -188
- package/payload/lanes/web/generated/lanes2_protocol.mjs +14218 -351
- package/payload/lanes/web/inbox.js +8 -6
- package/payload/manifest.json +22 -5
|
@@ -187,6 +187,9 @@ UNMASKED_SAMPLES = (
|
|
|
187
187
|
'health swap_pct', 'sidebar-status/<board>.json fleet.* (the same fleet keys)',
|
|
188
188
|
'sidebar-status/@directory.json directory.directory_revision',
|
|
189
189
|
'sidebar-status/@directory.json directory.rows[].source.revision',
|
|
190
|
+
# FC-I-10: a row's order stamp is settle's stable_since (else since), the producer's own clock like
|
|
191
|
+
# `lanes.*.agent.stable_since` above, so two independent producers differ there too.
|
|
192
|
+
'sidebar-status/@directory.json directory.rows[].last_activity_unix_ms',
|
|
190
193
|
'sidebar-status/@directory.json directory.sources[].{revision,cursor,observed_at_unix_ms}',
|
|
191
194
|
)
|
|
192
195
|
PROFILES = {
|
|
@@ -278,16 +281,55 @@ def flatten(value, prefix=()):
|
|
|
278
281
|
return [(path, leaf) for path, kind, leaf in walk(value, prefix) if kind == 'leaf']
|
|
279
282
|
|
|
280
283
|
|
|
284
|
+
_WILDCARDS = frozenset('*?[')
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def _segment_matches(segment, pattern):
|
|
288
|
+
"""fnmatch.fnmatchcase(segment, pattern), its two everyday answers given without it: `*` matches every key, and a
|
|
289
|
+
pattern with no wildcard character matches only itself."""
|
|
290
|
+
if pattern == '*':
|
|
291
|
+
return True
|
|
292
|
+
if _WILDCARDS.isdisjoint(pattern):
|
|
293
|
+
return segment == pattern
|
|
294
|
+
return fnmatch.fnmatchcase(segment, pattern)
|
|
295
|
+
|
|
296
|
+
|
|
281
297
|
def mask_of(masks, path):
|
|
282
298
|
"""(matched prefix, tolerance) of the first mask entry covering `path`, else None."""
|
|
283
299
|
for pattern, tolerance, _source in masks:
|
|
284
|
-
if len(pattern) <= len(path) and all(
|
|
300
|
+
if len(pattern) <= len(path) and all(_segment_matches(path[i], pattern[i]) for i in range(len(pattern))):
|
|
285
301
|
return path[:len(pattern)], tolerance
|
|
286
302
|
return None
|
|
287
303
|
|
|
288
304
|
|
|
305
|
+
def mask_lookup(masks):
|
|
306
|
+
"""mask_of(masks, ·) for the many paths of one document (`view`): a path is tried only against the entries whose
|
|
307
|
+
first segment can match its own — a first segment without a wildcard matches only itself — in the masks' order,
|
|
308
|
+
so every answer is mask_of's and a path no entry can cover costs one dictionary lookup. The drift detector judges
|
|
309
|
+
every leaf of a file changed alone, so a file's paths are looked up once per leaf (BEY-7345)."""
|
|
310
|
+
entries = tuple(masks)
|
|
311
|
+
plain, rest = {}, []
|
|
312
|
+
for position, (pattern, _tolerance, _source) in enumerate(entries):
|
|
313
|
+
if pattern and _WILDCARDS.isdisjoint(pattern[0]):
|
|
314
|
+
plain.setdefault(pattern[0], []).append(position)
|
|
315
|
+
else:
|
|
316
|
+
rest.append(position)
|
|
317
|
+
chosen = {}
|
|
318
|
+
|
|
319
|
+
def lookup(path):
|
|
320
|
+
head = path[0] if path else None
|
|
321
|
+
candidates = chosen.get(head)
|
|
322
|
+
if candidates is None:
|
|
323
|
+
candidates = chosen[head] = tuple(entries[at] for at in sorted(plain.get(head, []) + rest))
|
|
324
|
+
return mask_of(candidates, path)
|
|
325
|
+
return lookup
|
|
326
|
+
|
|
327
|
+
|
|
289
328
|
def parse(kind, data):
|
|
290
|
-
"""(document, format name) of one file's bytes, or (None, None) when it does not parse as its kind.
|
|
329
|
+
"""(document, format name) of one file's bytes, or (None, None) when it does not parse as its kind. A raw newline
|
|
330
|
+
inside the text comes only from an indent form, and an indent form of a non-empty object or list always breaks a
|
|
331
|
+
line, so only the forms that can be the text are serialised to compare (the first match in JSON_FORMATS order is
|
|
332
|
+
the answer either way)."""
|
|
291
333
|
try:
|
|
292
334
|
text = data.decode('utf-8')
|
|
293
335
|
except UnicodeDecodeError:
|
|
@@ -297,7 +339,12 @@ def parse(kind, data):
|
|
|
297
339
|
doc = json.loads(text)
|
|
298
340
|
except (ValueError, RecursionError):
|
|
299
341
|
return None, None
|
|
342
|
+
inner_newline = '\n' in (text[:-1] if text.endswith('\n') else text)
|
|
343
|
+
breaks_lines = isinstance(doc, (dict, list)) and bool(doc)
|
|
300
344
|
for name, options in JSON_FORMATS:
|
|
345
|
+
indent = 'indent' in options
|
|
346
|
+
if (indent and breaks_lines and not inner_newline) or (not indent and inner_newline):
|
|
347
|
+
continue
|
|
301
348
|
dumped = json.dumps(doc, **options)
|
|
302
349
|
if text == dumped + '\n':
|
|
303
350
|
return doc, name
|
|
@@ -318,8 +365,9 @@ def view(doc, masks):
|
|
|
318
365
|
value) in order, and one marker per masked prefix in its place, so neither a reordering, a missing key nor a change
|
|
319
366
|
of shape hides behind a mask."""
|
|
320
367
|
tokens = []
|
|
368
|
+
covering = mask_lookup(masks)
|
|
321
369
|
for path, kind, leaf in walk(doc):
|
|
322
|
-
covered =
|
|
370
|
+
covered = covering(path)
|
|
323
371
|
if covered is None:
|
|
324
372
|
tokens.append((kind, path, json.dumps(leaf, sort_keys=True) if kind == 'leaf' else None))
|
|
325
373
|
elif not tokens or tokens[-1] != ('masked', covered[0]):
|
|
@@ -20,9 +20,10 @@ Zellij's focus reports (`?1004h`), else for 3 s after a key. Ctrl-Alt-/ and Ctrl
|
|
|
20
20
|
type nothing: they move the focus here and `lanes sidebar-key` leaves views/<device>/<ws>.sidebar.cmd, which starts
|
|
21
21
|
the filter / arms the upload strip (reload()'s stamp, and before the next read of keys). Ctrl-Alt-l only focuses.
|
|
22
22
|
One prompt at a time (cockpit v3 S6): `self.prompt = {verb, entry, stage, value, armed}` — a name field (` › Rename:
|
|
23
|
-
value█`) or a confirmation (` › close ‘sh’ — y⏎ confirm · Esc cancel`
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
value█`) or a confirmation (` › close ‘sh’ — y⏎ confirm · Esc cancel`; for `h`, `H` and `R`, since 1.7.7,
|
|
24
|
+
` › hide ‘sh’? ⏎ confirms · Esc`) — and ONE footer_text() for the desktop and the phone. No prompt outlives the
|
|
25
|
+
keyboard (S6 fix cycle 1): a click on the list ends it before it acts, a name field types nothing for an arrow / Tab /
|
|
26
|
+
Shift-Tab / PageUp / PageDown, and hand_off() closes one still open.
|
|
26
27
|
What an action says in the footer lasts 3 s, or until the next action begins; never just until a key.
|
|
27
28
|
Attention first: lanes whose agent needs you, is working, or finished unseen sort into sections above the rest, each in
|
|
28
29
|
the order its lanes entered it (statusd's `stable_since`); the agent glyph sits in column 2, and every row carries an
|
|
@@ -37,8 +38,14 @@ profile paints only where the profile sets none. A device nobody owns never touc
|
|
|
37
38
|
Pins and hidden lanes (cockpit v3 R5): the profile's `lanes{pins, hidden}`. A hidden registry lane leaves the list, the
|
|
38
39
|
header counts and the notifications (never a divider, never a session listed under Unregistered: nothing alive is
|
|
39
40
|
ever hidden), until `o` shows the hidden ones again, faint; a pinned lane leads its section with the ▲ mark and the body
|
|
40
|
-
never lets it fall below `⋮ N more`. `p` pins / unpins, `h` hides (
|
|
41
|
-
Enter: `lanes upgrade-session` closes its tab on every
|
|
41
|
+
never lets it fall below `⋮ N more`. `p` pins / unpins, `h` hides (Enter confirms; on a hidden lane `o` shows, `h`
|
|
42
|
+
shows it again at once), `H` hides this workspace (Enter confirms: `lanes upgrade-session` closes its tab on every
|
|
43
|
+
device of the person), `o` toggles the hidden lanes. While the owner hides lanes of this workspace the list ends with
|
|
44
|
+
one row, `── hidden (n) · o shows them` (counts only, no names), so a hidden lane is never invisible (BEY-7248).
|
|
45
|
+
A typed sentence is no command (BEY-7248, 1.7.7): printable keys faster than a person navigates — BURST_KEYS inside
|
|
46
|
+
BURST_WINDOW_S — put the sidebar in a `typing` state that swallows the rest of the burst (until BURST_QUIET_S of
|
|
47
|
+
silence, Enter or Esc) and says ` Typing? ⏎ opens the lane · Esc`; `h`, `H` and `R` ask first and only Enter answers
|
|
48
|
+
yes, and no stage a letter opened takes its Enter (or, for a field, its letters) within BURST_WINDOW_S of that letter.
|
|
42
49
|
Which lanes (cockpit v3 V2): the `?` sheet's first row is ` lanes <installed> · view <this tree>`; while an update has
|
|
43
50
|
flipped `current` to another tree than the one this sidebar runs, the footer's rung below the health banner says
|
|
44
51
|
` server 1.2.0 · view 1.1.0 — press ?`. `current/VERSION` is read at start and every 30 s inside reload(), never per tick.
|
|
@@ -193,7 +200,29 @@ STATE_FRESH_S = 60.0 # a .sidebar.state older than this (by its own `
|
|
|
193
200
|
# (` › Rename: value█`); a `confirm` stage is ` › <word> ‘name’ — y⏎ confirm · Esc cancel`. The verb is what the phone
|
|
194
201
|
# title announces (DM-LANES-SIDEBAR-TITLE); the word is what the footer says it does — `P` registers the session.
|
|
195
202
|
PROMPT_FIELDS = {'rename': 'Rename', 'promote': 'Register as', 'message': 'Message'}
|
|
196
|
-
PROMPT_WORDS = {'close': 'close', 'promote': 'register', 'hide': 'hide'}
|
|
203
|
+
PROMPT_WORDS = {'close': 'close', 'promote': 'register', 'hide': 'hide', 'rename': 'rename'}
|
|
204
|
+
# A typed sentence is no command (BEY-7248, Lanes 1.7.7). A prompt typed while the sidebar pane had the focus — one
|
|
205
|
+
# click away on a web terminal — reached handle_keys() as commands: its first `h` hid the cursor lane on every device of
|
|
206
|
+
# the owner (2026-11-04 the Worlds lanes, 2026-11-05 bw-tools--lanes-workspace) and the rest kept acting (`o` toggled
|
|
207
|
+
# the hidden view, `p` pinned, `m` opened the message line, `R` a rename). The rules, here and nowhere else:
|
|
208
|
+
# * The burst (typed_burst): BURST_KEYS printable keys inside BURST_WINDOW_S are typing, not navigation. From the
|
|
209
|
+
# last of them the sidebar is `typing` until BURST_QUIET_S of silence, Enter or Esc: every key of the burst is
|
|
210
|
+
# swallowed (its Enter too: it ended the sentence and opens nothing) and the footer says typing_text(); Esc does
|
|
211
|
+
# what Esc does. BURST_FREE (j k Space /) are never counted, so key repeat on j / k, Space and a fast `/abc` keep
|
|
212
|
+
# working; an escape sequence (an arrow, PageUp / PageDown, Shift-Tab, a mouse report) is never swallowed; the
|
|
213
|
+
# filter and a name field take their text as always.
|
|
214
|
+
# * Intent (INTENT_VERBS): `h` (hide the cursor lane), `H` (hide this workspace) and `R` (rename) ask first, and only
|
|
215
|
+
# Enter answers yes — a non-printable key: any other key, `y` included, cancels ("hey" and "hybrid" carry an `h`
|
|
216
|
+
# followed by a `y`). `x`'s close keeps `y`, then Enter.
|
|
217
|
+
# * The open-time rule (considered): a stage a PRINTABLE key opened takes no Enter for BURST_WINDOW_S after that
|
|
218
|
+
# key — the Enter cancels, so a second Enter opens the lane instead of confirming — and a field a letter opened
|
|
219
|
+
# (`m`, `P`) takes no letter in that time either: `h⏎`, `xy⏎` or `make it so⏎` typed at speed act on nothing.
|
|
220
|
+
# Esc cancels at any time.
|
|
221
|
+
BURST_WINDOW_S = 0.3
|
|
222
|
+
BURST_KEYS = 3
|
|
223
|
+
BURST_QUIET_S = 0.5
|
|
224
|
+
BURST_FREE = 'jk /'
|
|
225
|
+
INTENT_VERBS = ('hide', 'rename')
|
|
197
226
|
# The owner's profile (cockpit v3 R3, LNS-76): users/<login>.json (libexec/users.py) of the person this device belongs
|
|
198
227
|
# to. Opening a lane writes its mark there through users.update, which holds the profile's lock; the CLI waits up to
|
|
199
228
|
# users.LOCK_S (1 s) for it, a sidebar only PROFILE_LOCK_S — every writer holds it for milliseconds (read, merge, one
|
|
@@ -785,7 +814,10 @@ BOX_ROWS = 1 # the upload strip (spec §4.6(d)); it was a four-row box
|
|
|
785
814
|
# of a 24-row pane with the strip row; R5's `p h` / `H o` (LNS-78) took the two rows S10 left, and V2's row the line
|
|
786
815
|
# `u z` now share. Plan W10 W7's `d` (the cursor lane's docs link) joins the strip's own keys, `+ U d`, for the same reason,
|
|
787
816
|
# W11's `i` (fold the fleet block) the reload and the sheet, `r i ?`, W15 L2's `@` (the addresses) the find, `/ @`, and
|
|
788
|
-
# W15 L4's `m` (a message to the cursor lane) the rename, `R m`.
|
|
817
|
+
# W15 L4's `m` (a message to the cursor lane) the rename, `R m`. BEY-7248 (1.7.7) regrouped R5's two lines by what
|
|
818
|
+
# the keys do — `p o` (pin, show the hidden lanes: immediate) and `h H` (hide the lane / the tab: they ask first) — and
|
|
819
|
+
# marks the verbs that ask first with the `enter` mark after their action (`rename ⏎`, `hide lane / tab ⏎`: ⏎
|
|
820
|
+
# confirms). A row's optional fourth field is its action under ASCII glyphs (`Enter` is five cells, `⏎` one).
|
|
789
821
|
# test_sidebar.DocumentedKeys holds the sheet, the table and handle() to the same keys.
|
|
790
822
|
KEY_SHEET = (('↑ ↓ j k', 'Up Dn j k', 'move'), ('⏎ → Space', 'Enter Spc', 'open the cursor lane'),
|
|
791
823
|
('J K', 'J K', 'open next / prev lane'), ('Tab S-Tab', 'Tab S-Tab', 'next / prev needing you'),
|
|
@@ -793,8 +825,9 @@ KEY_SHEET = (('↑ ↓ j k', 'Up Dn j k', 'move'), ('⏎ → Space', 'Enter Spc'
|
|
|
793
825
|
('Esc', 'Esc', 'cancel, back to lane'), ('g G', 'g G', 'first / last'),
|
|
794
826
|
('+ U d', '+ U d', 'shell / upload / docs'), ('a', 'a', 'add to a workspace'),
|
|
795
827
|
('x', 'x', 'close (y, then Enter)'), ('u z', 'u z', 'unregister / undo 10 s'),
|
|
796
|
-
('R m', 'R m', 'rename / message'
|
|
797
|
-
('
|
|
828
|
+
('R m', 'R m', 'rename ⏎ / message', 'rename Enter / message'), ('P', 'P', 'register a session'),
|
|
829
|
+
('p o', 'p o', 'pin / show hidden lanes'), ('h H', 'h H', 'hide lane / tab ⏎', 'hide lane / tab Enter'),
|
|
830
|
+
('r i ?', 'r i ?', 'reload / fleet / keys'),
|
|
798
831
|
('Ctrl-Alt-l', 'Ctrl-Alt-l', 'focus the sidebar'))
|
|
799
832
|
PASTE_START, PASTE_END = '\033[200~', '\033[201~'
|
|
800
833
|
# A paste typed into a footer field (Sidebar.pasted): a run of line breaks / tabs is one space, never an Enter.
|
|
@@ -996,6 +1029,15 @@ class Sidebar:
|
|
|
996
1029
|
paste_buffer, paste_dropped, key_carry, carry_due = None, False, '', 0.0
|
|
997
1030
|
esc_taken, on_tty, utf8 = False, False, None
|
|
998
1031
|
last_visible = () # the list visible() last returned: the one `self.cursor` indexes
|
|
1032
|
+
# The key rules of BEY-7248 (BURST_* above; read-only defaults, handle_keys assigns): `key_clock` is their clock —
|
|
1033
|
+
# time.monotonic, the seam a test replaces with any function of no arguments (an instance attribute); `key_now` its
|
|
1034
|
+
# reading for the keys being handled, `key_typed` whether the key being dispatched is a printable one;
|
|
1035
|
+
# `stage_typed_at` the `key_now` of the printable key that opened the prompt's current stage (None: Enter, a click
|
|
1036
|
+
# or no key at all opened it); `burst` the stamps of the counted keys inside BURST_WINDOW_S; `typing` the typing
|
|
1037
|
+
# state and `typing_at` the stamp of its last key.
|
|
1038
|
+
key_clock = staticmethod(time.monotonic)
|
|
1039
|
+
key_now, key_typed, stage_typed_at = 0.0, False, None
|
|
1040
|
+
burst, typing, typing_at = (), False, 0.0
|
|
999
1041
|
economy = {} # read-only default; reload() assigns the loaded economy.json (load_economy)
|
|
1000
1042
|
economy_tiers = '' # this workspace's tier mix from economy.json, `F2 S1` (reload)
|
|
1001
1043
|
more_row = 0 # the 1-based screen row of `⋮ N more` (render), 0 = the list fits
|
|
@@ -2748,6 +2790,13 @@ class Sidebar:
|
|
|
2748
2790
|
# lead a section, never the matches).
|
|
2749
2791
|
lanes = self.shown_lanes()
|
|
2750
2792
|
entries = list(lanes) if self.filter else self.sectioned(lanes)
|
|
2793
|
+
hidden = 0 if self.filter or self.show_hidden else self.hidden_count()
|
|
2794
|
+
if hidden:
|
|
2795
|
+
# BEY-7248: a hidden lane is never invisible — one row at the bottom of the lanes says how many (no names)
|
|
2796
|
+
# and how to see them; a divider: no cursor mark, a click on it opens nothing (Rust: Entry::Hidden).
|
|
2797
|
+
sep = f' {self.glyphs["marks"]["sep"]} '
|
|
2798
|
+
entries.append({'id': '', 'divider': True, 'hidden_row': True,
|
|
2799
|
+
'name': f'hidden ({hidden}){sep}o shows {"it" if hidden == 1 else "them"}'})
|
|
2751
2800
|
if self.zmx:
|
|
2752
2801
|
entries.append({'id': '', 'divider': True, 'name': f'zmx lanes ({len(self.zmx)})'})
|
|
2753
2802
|
entries += self.zmx
|
|
@@ -2967,8 +3016,21 @@ class Sidebar:
|
|
|
2967
3016
|
handle_keys() (`name`: typed, ⏎ accepts; `confirm`: `y` arms, ⏎ acts, any other key cancels) and drawn by
|
|
2968
3017
|
footer_text() on the desktop and the phone alike."""
|
|
2969
3018
|
self.prompt = {'verb': verb, 'entry': entry, 'stage': stage, 'value': value, 'armed': False}
|
|
3019
|
+
self.stage_opened()
|
|
2970
3020
|
self.dirty = True
|
|
2971
3021
|
|
|
3022
|
+
def stage_opened(self):
|
|
3023
|
+
"""A prompt stage opened by the key being dispatched (BEY-7248): its `key_now` when that key is a printable one
|
|
3024
|
+
— the stage then takes no Enter (nor, a field, a letter) for BURST_WINDOW_S (considered) — else None."""
|
|
3025
|
+
self.stage_typed_at = self.key_now if self.key_typed else None
|
|
3026
|
+
|
|
3027
|
+
def considered(self):
|
|
3028
|
+
"""Whether the open stage has been on screen long enough for its answer to be a person's (BEY-7248): a stage
|
|
3029
|
+
that Enter, a click or no key opened (`stage_typed_at` None) at once; one a printable key opened once
|
|
3030
|
+
BURST_WINDOW_S has passed since that key. `h⏎`, `R⏎` and `xy⏎` typed at speed — one read, or reads
|
|
3031
|
+
milliseconds apart — answer nothing: the Enter cancels instead (answer_prompt)."""
|
|
3032
|
+
return self.stage_typed_at is None or self.key_now - self.stage_typed_at >= BURST_WINDOW_S
|
|
3033
|
+
|
|
2972
3034
|
def close_prompt(self):
|
|
2973
3035
|
"""End the prompt -> the one that was open ({} when none was): its caller acts on it, or says why not."""
|
|
2974
3036
|
prompt, self.prompt, self.dirty = self.prompt or {}, None, True
|
|
@@ -3070,8 +3132,19 @@ class Sidebar:
|
|
|
3070
3132
|
except OSError:
|
|
3071
3133
|
pass
|
|
3072
3134
|
|
|
3135
|
+
def request_rename(self, entry):
|
|
3136
|
+
"""`R` (BEY-7248, 1.7.7): ask first — ` › rename ‘name’? ⏎ confirms · Esc`, the one prompt — and open the name
|
|
3137
|
+
field (start_rename) on its Enter (commit_intent). Until 1.7.7 `R` opened the field at once, so the sentence
|
|
3138
|
+
typed after an `R` became the lane's name at that sentence's Enter. A row no rename applies to asks nothing,
|
|
3139
|
+
as start_rename refuses it."""
|
|
3140
|
+
self.begin_action()
|
|
3141
|
+
if entry.get('divider') or entry.get('action') or self.still_pending(entry):
|
|
3142
|
+
return
|
|
3143
|
+
self.open_prompt('rename', entry, 'confirm', entry.get('name', ''))
|
|
3144
|
+
|
|
3073
3145
|
def start_rename(self, entry):
|
|
3074
|
-
"""Begin inline rename of the lane under the cursor: the `rename` prompt's name field, prefilled
|
|
3146
|
+
"""Begin inline rename of the lane under the cursor: the `rename` prompt's name field, prefilled (`R`'s Enter;
|
|
3147
|
+
the conformance kit calls it directly)."""
|
|
3075
3148
|
self.begin_action()
|
|
3076
3149
|
if entry.get('divider') or entry.get('action') or self.still_pending(entry):
|
|
3077
3150
|
return
|
|
@@ -3185,6 +3258,7 @@ class Sidebar:
|
|
|
3185
3258
|
self.release_focus()
|
|
3186
3259
|
return
|
|
3187
3260
|
self.prompt.update(stage='confirm', value=name, armed=False)
|
|
3261
|
+
self.stage_opened() # Enter opened it: no open-time rule (BEY-7248)
|
|
3188
3262
|
self.dirty = True
|
|
3189
3263
|
|
|
3190
3264
|
def commit_promote(self):
|
|
@@ -3297,27 +3371,42 @@ class Sidebar:
|
|
|
3297
3371
|
return True
|
|
3298
3372
|
|
|
3299
3373
|
def answer_prompt(self, ch):
|
|
3300
|
-
"""One typed key at a `confirm` stage
|
|
3301
|
-
|
|
3374
|
+
"""One typed key at a `confirm` stage (cockpit v3 S6). `close` and `promote`: `y` arms; Enter, once armed, acts.
|
|
3375
|
+
The INTENT_VERBS (`h`, `H`, `R`; BEY-7248): Enter alone acts — `y` is any other key. Either way an Enter the
|
|
3376
|
+
stage cannot have been read for (considered: within BURST_WINDOW_S of the letter that opened it) is no answer,
|
|
3377
|
+
and anything else cancels, is consumed and hands the keyboard back. An escape sequence never gets here:
|
|
3302
3378
|
prompt_sequence() answers those, at either stage, before any (until S6 the register confirmation was read
|
|
3303
3379
|
after the escape sequences, so an arrow or a click under it moved the cursor or opened a lane and left it
|
|
3304
3380
|
open, DEF-1823)."""
|
|
3305
3381
|
prompt = self.prompt
|
|
3306
3382
|
self.dirty = True
|
|
3307
|
-
if
|
|
3383
|
+
if prompt['verb'] in INTENT_VERBS:
|
|
3384
|
+
if ch in '\r\n' and self.considered():
|
|
3385
|
+
self.commit_intent()
|
|
3386
|
+
return
|
|
3387
|
+
elif ch in 'yY' and not prompt['armed']:
|
|
3308
3388
|
prompt['armed'] = True
|
|
3309
3389
|
return
|
|
3310
|
-
|
|
3390
|
+
elif ch in '\r\n' and prompt['armed'] and self.considered():
|
|
3311
3391
|
if prompt['verb'] == 'close':
|
|
3312
3392
|
self.close_lane(self.close_prompt()['entry']) # hands the keyboard back when it is done
|
|
3313
|
-
elif prompt['verb'] == 'hide':
|
|
3314
|
-
self.commit_hide_workspace()
|
|
3315
3393
|
else:
|
|
3316
3394
|
self.commit_promote()
|
|
3317
3395
|
return
|
|
3318
3396
|
self.cancel_prompt()
|
|
3319
3397
|
self.release_focus()
|
|
3320
3398
|
|
|
3399
|
+
def commit_intent(self):
|
|
3400
|
+
"""Enter at an INTENT_VERBS confirmation (BEY-7248): `R` opens the name field (start_rename, which replaces the
|
|
3401
|
+
prompt), `H` hides this workspace (commit_hide_workspace), `h` hides the cursor lane (hide_lane)."""
|
|
3402
|
+
prompt = self.prompt
|
|
3403
|
+
if prompt['verb'] == 'rename':
|
|
3404
|
+
self.start_rename(prompt['entry'])
|
|
3405
|
+
elif prompt['entry'].get('board'):
|
|
3406
|
+
self.commit_hide_workspace()
|
|
3407
|
+
else:
|
|
3408
|
+
self.hide_lane(self.close_prompt()['entry'])
|
|
3409
|
+
|
|
3321
3410
|
def prompt_sequence(self, key):
|
|
3322
3411
|
"""ONE escape sequence (as key_length() cuts it) while the prompt is open, at either stage (cockpit v3 S6 fix
|
|
3323
3412
|
cycle 1, DEF-1824: S6 gave a rule to the confirmation only, and under a name field → or a click on a row opened
|
|
@@ -3513,10 +3602,26 @@ class Sidebar:
|
|
|
3513
3602
|
self.resolve_cursor(self.visible(), lane_id)
|
|
3514
3603
|
self.release_focus()
|
|
3515
3604
|
|
|
3605
|
+
def request_hide_lane(self, entry):
|
|
3606
|
+
"""`h` (BEY-7248, 1.7.7): ask before hiding the cursor lane — ` › hide ‘name’? ⏎ confirms · Esc`, the one
|
|
3607
|
+
prompt; its Enter hides it (commit_intent → hide_lane), any other key cancels. Hiding is shared by every device
|
|
3608
|
+
of the owner and was ONE key: a sentence typed while the sidebar had the focus hid the cursor lane with its
|
|
3609
|
+
first `h`. While `o` shows the hidden lanes, `h` on a hidden one shows it again at once: the recovery asks
|
|
3610
|
+
nothing. A refusal (not a registry lane, no owner) says why and keeps the keyboard, as before."""
|
|
3611
|
+
self.begin_action()
|
|
3612
|
+
self.dirty = True
|
|
3613
|
+
if not self.arrangeable(entry, 'hides'):
|
|
3614
|
+
return
|
|
3615
|
+
if entry['id'] in self.lane_hidden:
|
|
3616
|
+
self.hide_lane(entry)
|
|
3617
|
+
return
|
|
3618
|
+
self.open_prompt('hide', entry, 'confirm', entry.get('name', entry['id']))
|
|
3619
|
+
|
|
3516
3620
|
def hide_lane(self, entry):
|
|
3517
|
-
"""`h
|
|
3518
|
-
the cursor stays on its row (the next lane) — or, while `o`
|
|
3519
|
-
|
|
3621
|
+
"""`h`'s Enter (request_hide_lane, commit_intent): hide the cursor lane on every device of the owner — it leaves
|
|
3622
|
+
the list, the counts and the notifications, the cursor stays on its row (the next lane) — or, `h` while `o`
|
|
3623
|
+
shows the hidden lanes, show a hidden one again (at once). A session listed under Unregistered is never hidden
|
|
3624
|
+
(nothing alive is), a divider neither."""
|
|
3520
3625
|
self.begin_action()
|
|
3521
3626
|
self.dirty = True
|
|
3522
3627
|
if not self.arrangeable(entry, 'hides'):
|
|
@@ -3642,7 +3747,7 @@ class Sidebar:
|
|
|
3642
3747
|
The footer says how many; then the keyboard goes back to the lane."""
|
|
3643
3748
|
self.begin_action()
|
|
3644
3749
|
self.show_hidden, self.dirty = not self.show_hidden, True
|
|
3645
|
-
count =
|
|
3750
|
+
count = self.hidden_count()
|
|
3646
3751
|
g = self.glyphs['marks']
|
|
3647
3752
|
if not count:
|
|
3648
3753
|
self.message = 'no hidden lanes'
|
|
@@ -3652,10 +3757,15 @@ class Sidebar:
|
|
|
3652
3757
|
self.message = f'{count} hidden {g["sep"]} o shows {"it" if count == 1 else "them"}'
|
|
3653
3758
|
self.release_focus()
|
|
3654
3759
|
|
|
3760
|
+
def hidden_count(self):
|
|
3761
|
+
"""How many of this workspace's registry lanes the owner hid (the profile may hide other boards' lanes too)."""
|
|
3762
|
+
return sum(1 for entry in self.entries if entry.get('id') in self.lane_hidden)
|
|
3763
|
+
|
|
3655
3764
|
def request_hide_workspace(self):
|
|
3656
|
-
"""`H`: ask to hide this workspace for the owner (` › hide ‘title
|
|
3657
|
-
|
|
3658
|
-
|
|
3765
|
+
"""`H`: ask to hide this workspace for the owner (` › hide ‘title’? ⏎ confirms · Esc`, the one prompt; the entry
|
|
3766
|
+
is the board, `board: True`); Enter hides it (commit_intent → commit_hide_workspace; `y` then Enter until
|
|
3767
|
+
1.7.7, BEY-7248). Refused, keeping the keyboard, on a device nobody owns and for the last workspace the person
|
|
3768
|
+
still sees (users.arrange never leaves a view without one)."""
|
|
3659
3769
|
self.begin_action()
|
|
3660
3770
|
self.dirty = True
|
|
3661
3771
|
if not self.profile_path:
|
|
@@ -3665,10 +3775,10 @@ class Sidebar:
|
|
|
3665
3775
|
if shown == [self.workspace] or not shown:
|
|
3666
3776
|
self.message = 'the last workspace shown stays'
|
|
3667
3777
|
return
|
|
3668
|
-
self.open_prompt('hide', {'id': self.workspace, 'name': self.title}, 'confirm', self.title)
|
|
3778
|
+
self.open_prompt('hide', {'id': self.workspace, 'name': self.title, 'board': True}, 'confirm', self.title)
|
|
3669
3779
|
|
|
3670
3780
|
def commit_hide_workspace(self):
|
|
3671
|
-
"""
|
|
3781
|
+
"""`H`'s Enter: add this workspace to the profile's `workspaces.hidden` (refused when no other board
|
|
3672
3782
|
would be left — the profile may have changed since `H`), then start `lanes upgrade-session` in its own session:
|
|
3673
3783
|
it closes this workspace's tab on every live view of the owner (device_sync.reconcile, R4) — this pane's tab
|
|
3674
3784
|
included, which is why the child must not die with it. The lanes keep running in their containers."""
|
|
@@ -4069,7 +4179,8 @@ class Sidebar:
|
|
|
4069
4179
|
a `name` stage is the field ` › Rename: value█` / ` › Register as: value█` (ink; a value longer than the field
|
|
4070
4180
|
shows its END after the `truncation` mark, so what is typed and the caret stay in view); a `confirm` stage is
|
|
4071
4181
|
` › <word> ‘name’ — y⏎ confirm · Esc cancel` (close tone-urgent, register tone-attention), `⏎ confirm` once `y`
|
|
4072
|
-
armed it — so typed text whose `y` is followed by a letter closes or registers nothing (S3)
|
|
4182
|
+
armed it — so typed text whose `y` is followed by a letter closes or registers nothing (S3); an INTENT_VERBS
|
|
4183
|
+
confirmation (`h`, `H`, `R`; BEY-7248) is ` › <word> ‘name’? ⏎ confirms · Esc` (tone-attention). The instruction
|
|
4073
4184
|
always survives: ` cancel` gives way first, then ` · Esc`, then the name is clipped with the `truncation` mark.
|
|
4074
4185
|
Under ASCII glyphs `⏎` is the word `Enter`, so `y` and it are joined by `+`."""
|
|
4075
4186
|
prompt, tone, g = self.prompt, self.tone, self.glyphs['marks']
|
|
@@ -4086,12 +4197,18 @@ class Sidebar:
|
|
|
4086
4197
|
value = g['truncation'] + ''.join(reversed(tail))
|
|
4087
4198
|
return clip(head + value, max(1, cols - 2))[0], tone['ink'], True
|
|
4088
4199
|
enter = g['enter']
|
|
4089
|
-
keys = enter if prompt['armed'] else f'y{enter}' if cell_width(enter) == 1 else f'y+{enter}'
|
|
4090
4200
|
head = f' {g["lead"]} {PROMPT_WORDS[prompt["verb"]]} {g["quote-open"]}'
|
|
4091
|
-
act = f'{g["quote-close"]} {g["dash"]} {keys} confirm'
|
|
4092
4201
|
name = prompt['value']
|
|
4093
4202
|
style = tone['tone-urgent'] if prompt['verb'] == 'close' else tone['tone-attention']
|
|
4094
|
-
|
|
4203
|
+
if prompt['verb'] in INTENT_VERBS:
|
|
4204
|
+
# BEY-7248: ` › hide ‘sh’? ⏎ confirms · Esc` — Enter alone answers yes (`h`, `H`, `R`)
|
|
4205
|
+
act = f'{g["quote-close"]}? {enter} confirms'
|
|
4206
|
+
tails = (f'{act} {g["sep"]} Esc', act)
|
|
4207
|
+
else:
|
|
4208
|
+
keys = enter if prompt['armed'] else f'y{enter}' if cell_width(enter) == 1 else f'y+{enter}'
|
|
4209
|
+
act = f'{g["quote-close"]} {g["dash"]} {keys} confirm'
|
|
4210
|
+
tails = (f'{act} {g["sep"]} Esc cancel', f'{act} {g["sep"]} Esc', act)
|
|
4211
|
+
for tail in tails:
|
|
4095
4212
|
room = cols - 1 - cell_width(head) - cell_width(tail)
|
|
4096
4213
|
if cell_width(name) <= room:
|
|
4097
4214
|
return head + name + tail, style, False
|
|
@@ -4159,7 +4276,7 @@ class Sidebar:
|
|
|
4159
4276
|
lines = [f'{style}{version}{reset}']
|
|
4160
4277
|
for row in KEY_SHEET:
|
|
4161
4278
|
key = f'{row[index]:<9} '
|
|
4162
|
-
action, _ = clip(row[2], max(0, cols - 3 - cell_width(key)))
|
|
4279
|
+
action, _ = clip(row[3] if index and len(row) > 3 else row[2], max(0, cols - 3 - cell_width(key)))
|
|
4163
4280
|
lines.append(f'{dim} {key}{reset}{action}')
|
|
4164
4281
|
return (lines + [''] * body)[:body]
|
|
4165
4282
|
|
|
@@ -4632,6 +4749,7 @@ class Sidebar:
|
|
|
4632
4749
|
"""The keys and mouse reports of one read, or of the part of it before / after a paste (handle())."""
|
|
4633
4750
|
if not data:
|
|
4634
4751
|
return
|
|
4752
|
+
self.key_now, self.key_typed = self.key_clock(), False # BEY-7248: one reading for the keys of this read
|
|
4635
4753
|
entries = self.follow()
|
|
4636
4754
|
i = 0
|
|
4637
4755
|
while i < len(data):
|
|
@@ -4655,6 +4773,10 @@ class Sidebar:
|
|
|
4655
4773
|
continue
|
|
4656
4774
|
entries = self.follow() # per key: an action may have changed the list (spec §4.5)
|
|
4657
4775
|
ch = data[i]
|
|
4776
|
+
self.key_typed = ch.isprintable()
|
|
4777
|
+
if self.typed_burst(ch): # BEY-7248: a key of a typed sentence is no command
|
|
4778
|
+
i += 1
|
|
4779
|
+
continue
|
|
4658
4780
|
if self.prompt and ch == '\033':
|
|
4659
4781
|
# ONE escape sequence under the prompt, a name field or a confirmation (cockpit v3 S6 fix cycle 1,
|
|
4660
4782
|
# DEF-1824): consumed while the prompt stays, or handled as usual below — with the prompt cancelled
|
|
@@ -4751,6 +4873,7 @@ class Sidebar:
|
|
|
4751
4873
|
if self.registration:
|
|
4752
4874
|
self.cancel_registration()
|
|
4753
4875
|
self.armed = False
|
|
4876
|
+
self.typing, self.burst = False, [] # BEY-7248: Esc ends a typed burst, does what Esc does
|
|
4754
4877
|
self.filter, self.filtering = '', False
|
|
4755
4878
|
self.release_focus()
|
|
4756
4879
|
i += 1
|
|
@@ -4820,15 +4943,14 @@ class Sidebar:
|
|
|
4820
4943
|
self.unregister_lane(entries[min(self.cursor, len(entries) - 1)])
|
|
4821
4944
|
elif ch == 'z':
|
|
4822
4945
|
self.undo_unregister()
|
|
4823
|
-
elif ch == 'R' and entries:
|
|
4824
|
-
|
|
4825
|
-
self.start_rename(entry)
|
|
4946
|
+
elif ch == 'R' and entries: # BEY-7248: asks first, Enter opens the field
|
|
4947
|
+
self.request_rename(entries[min(self.cursor, len(entries) - 1)])
|
|
4826
4948
|
elif ch == 'm': # W15 L4: one line to the cursor lane, as a message
|
|
4827
4949
|
self.start_message(entries[min(self.cursor, len(entries) - 1)] if entries else None)
|
|
4828
4950
|
elif ch == 'p' and entries: # cockpit v3 R5: pins and hidden lanes, the owner's profile
|
|
4829
4951
|
self.pin_lane(entries[min(self.cursor, len(entries) - 1)])
|
|
4830
|
-
elif ch == 'h' and entries:
|
|
4831
|
-
self.
|
|
4952
|
+
elif ch == 'h' and entries: # BEY-7248: asks first (a hidden lane `o` shows: shown again at once)
|
|
4953
|
+
self.request_hide_lane(entries[min(self.cursor, len(entries) - 1)])
|
|
4832
4954
|
elif ch == 'H':
|
|
4833
4955
|
self.request_hide_workspace()
|
|
4834
4956
|
elif ch == 'o':
|
|
@@ -4854,6 +4976,57 @@ class Sidebar:
|
|
|
4854
4976
|
self.sheet, self.showing_keys = 'keys', True
|
|
4855
4977
|
self.dirty = True
|
|
4856
4978
|
i += 1
|
|
4979
|
+
self.key_typed = False
|
|
4980
|
+
|
|
4981
|
+
def typed_burst(self, ch):
|
|
4982
|
+
"""BEY-7248's typed-burst rule for ONE key of a read (`ch`, its first character), at `key_now` -> True when the
|
|
4983
|
+
key is swallowed: part of a sentence typed into the sidebar, never a command. See BURST_* for the rule.
|
|
4984
|
+
* Silence: a typing state whose last key is BURST_QUIET_S old has ended; this key is a key again.
|
|
4985
|
+
* Never typing: an escape sequence (Esc, an arrow, a mouse report — handle_keys reads it, and a bare Esc ends
|
|
4986
|
+
the state), the filter's text, a name field's text — save a letter within BURST_WINDOW_S of the letter that
|
|
4987
|
+
opened that field (`m`, `P`: the sentence went on into it).
|
|
4988
|
+
* While typing: every key is swallowed and keeps the state alive (and is still counted, so a sentence typed
|
|
4989
|
+
right after the Enter is typing from its first letter); Enter ends it (the sentence's own Enter opens
|
|
4990
|
+
nothing).
|
|
4991
|
+
* Otherwise a printable key outside BURST_FREE is counted; the BURST_KEYS-th inside BURST_WINDOW_S starts the
|
|
4992
|
+
state. An open prompt ends first, as any other key would end it there: cancelled, the keyboard handed back
|
|
4993
|
+
to the lane (cockpit v3 S3) — no question survives a typed burst.
|
|
4994
|
+
The footer says typing_text() for MESSAGE_S after the burst's last key."""
|
|
4995
|
+
now, prompt = self.key_now, self.prompt
|
|
4996
|
+
if self.typing and now - self.typing_at >= BURST_QUIET_S:
|
|
4997
|
+
self.typing = False
|
|
4998
|
+
if ch == '\033' or self.filtering:
|
|
4999
|
+
return False
|
|
5000
|
+
if prompt and prompt['stage'] == 'name':
|
|
5001
|
+
if not ch.isprintable() or self.considered():
|
|
5002
|
+
return False
|
|
5003
|
+
elif self.typing:
|
|
5004
|
+
self.typing_at, self.dirty = now, True
|
|
5005
|
+
if ch in '\r\n':
|
|
5006
|
+
self.typing = False
|
|
5007
|
+
elif ch.isprintable() and ch not in BURST_FREE: # still counted: a next sentence at once is typing too
|
|
5008
|
+
self.burst = [at for at in self.burst if now - at < BURST_WINDOW_S] + [now]
|
|
5009
|
+
self.message = self.typing_text()
|
|
5010
|
+
return True
|
|
5011
|
+
elif not ch.isprintable() or ch in BURST_FREE:
|
|
5012
|
+
return False
|
|
5013
|
+
else:
|
|
5014
|
+
self.burst = [at for at in self.burst if now - at < BURST_WINDOW_S] + [now]
|
|
5015
|
+
if len(self.burst) < BURST_KEYS:
|
|
5016
|
+
return False
|
|
5017
|
+
if prompt:
|
|
5018
|
+
self.cancel_prompt()
|
|
5019
|
+
self.release_focus()
|
|
5020
|
+
self.typing, self.typing_at, self.dirty = True, now, True
|
|
5021
|
+
self.message = self.typing_text()
|
|
5022
|
+
return True
|
|
5023
|
+
|
|
5024
|
+
def typing_text(self):
|
|
5025
|
+
"""The typed-burst notice (BEY-7248): ` Typing? ⏎ opens the lane · Esc` — the keys went to the sidebar, not the
|
|
5026
|
+
lane; Enter (once the burst is over) opens the cursor lane and gives it the keyboard, Esc gives the keyboard
|
|
5027
|
+
back to the lane on view. 31 cells, 35 under ASCII glyphs (`Enter`): the 36-cell pane's whole footer row."""
|
|
5028
|
+
g = self.glyphs['marks']
|
|
5029
|
+
return f'Typing? {g["enter"]} opens the lane {g["sep"]} Esc'
|
|
4857
5030
|
|
|
4858
5031
|
def start_bytes(self):
|
|
4859
5032
|
"""What run() writes once at start: alternate screen, mouse, bracketed paste, focus reports (`?1004h`, cockpit
|