@vibelord/lanes 1.8.0 → 1.9.3
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/package.json +1 -1
- package/payload/lanes/README.md +29 -11
- package/payload/lanes/VERSION +1 -1
- package/payload/lanes/bin/lanes +159 -59
- package/payload/lanes/bin-rs/BINARIES.json +2 -17
- package/payload/lanes/client/lanes-launch +51 -2
- package/payload/lanes/container/lane +142 -19
- package/payload/lanes/container/lane-mcp +168 -55
- package/payload/lanes/container/lane-peerd +6 -6
- package/payload/lanes/container/lane-signal +48 -3
- package/payload/lanes/container/lane_core.py +1040 -164
- package/payload/lanes/container/throttle-pulse +13 -4
- package/payload/lanes/docs/AGENTS-lanes.md +15 -7
- package/payload/lanes/docs/ARCHITECTURE.md +478 -101
- package/payload/lanes/docs/DESIGN.md +7 -2
- package/payload/lanes/docs/INSTALL.md +20 -3
- package/payload/lanes/docs/PLAN-1.9.1-SIDEBAR-CODEX.md +128 -0
- package/payload/lanes/docs/RUNBOOK.md +1428 -107
- package/payload/lanes/docs/USERGUIDE.md +488 -86
- package/payload/lanes/holders/tmux.sh +3 -3
- package/payload/lanes/install/services.py +68 -11
- package/payload/lanes/libexec/agent_state.py +2 -5
- package/payload/lanes/libexec/attach.py +11 -3
- package/payload/lanes/libexec/cursor_sync.py +22 -2
- package/payload/lanes/libexec/docsd.py +38 -4
- package/payload/lanes/libexec/lanes_lib.py +377 -39
- package/payload/lanes/libexec/mdlite.py +43 -3
- package/payload/lanes/libexec/notify.py +69 -26
- package/payload/lanes/libexec/registrations.py +5 -0
- package/payload/lanes/libexec/session_actions.py +114 -27
- package/payload/lanes/libexec/sidebar.py +246 -64
- package/payload/lanes/libexec/site_hooks.py +65 -0
- package/payload/lanes/libexec/statusd.py +139 -189
- package/payload/lanes/libexec/studio_host.py +8 -2
- package/payload/lanes/libexec/tokens.py +6 -2
- package/payload/lanes/libexec/update.py +13 -5
- package/payload/lanes/libexec/view.sh +39 -4
- package/payload/lanes/libexec/workspace_keys.py +54 -0
- package/payload/lanes/site/protocol.py +15 -5
- package/payload/lanes/site/relay.py +5 -2
- package/payload/lanes/site/server.py +29 -18
- package/payload/lanes/systemd/lanes-economy.service +3 -1
- package/payload/lanes/tokens/README.md +10 -0
- package/payload/lanes/tokens/generate.py +1 -1
- package/payload/lanes/web/Caddyfile +9 -2
- package/payload/lanes/web/README.md +2410 -95
- package/payload/lanes/web/browser.css +2 -0
- package/payload/lanes/web/browser.js +18 -6
- package/payload/lanes/web/directory.js +1 -1
- package/payload/lanes/web/docs.js +23 -0
- package/payload/lanes/web/links.js +157 -0
- package/payload/lanes/web/manifest.webmanifest +0 -2
- package/payload/lanes/web/mobile.css +30 -32
- package/payload/lanes/web/mobile.js +286 -227
- package/payload/lanes/web/upload.js +65 -22
- package/payload/lanes/web/workspace-keys.js +65 -0
- package/payload/lanes/zellij/config.kdl +1 -1
- package/payload/manifest.json +5 -22
- package/payload/lanes/bin-rs/THIRD-PARTY-NOTICES +0 -18953
- 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
|
@@ -696,10 +696,15 @@ def carried_names(services):
|
|
|
696
696
|
return ('LANES_WORKSPACES',) + tuple(services.ECONOMY_SETTINGS) + tuple(services.NOTIFY_SETTINGS)
|
|
697
697
|
|
|
698
698
|
|
|
699
|
-
def carried_settings(units_dir, names, environ):
|
|
699
|
+
def carried_settings(units_dir, names, environ, home=None):
|
|
700
700
|
"""{name: value} for each of `names` an installed lanes unit in `units_dir` sets (`Environment="NAME=VALUE"`,
|
|
701
701
|
unescaped as services.unit_value escaped it) and `environ` does not: an update installs with the settings the
|
|
702
|
-
running units have, never without them (the economy poller's control URL, the notifier's config path).
|
|
702
|
+
running units have, never without them (the economy poller's control URL, the notifier's config path).
|
|
703
|
+
|
|
704
|
+
With `home`, LANES_THROTTLE_CONTROL is not carried while `<home>/.config/lanes/site.conf` has a line naming it
|
|
705
|
+
(lanes_lib.site_declares, the raw file): that line is the one declared source of the control URL (BEY-6845), and
|
|
706
|
+
the economy unit's copy of it from the last render must not shadow an edit — else the unit would keep the old URL
|
|
707
|
+
at every update while the pulse's `--control` follows site.conf. The environment stays an override."""
|
|
703
708
|
found = {}
|
|
704
709
|
for unit in sorted(Path(units_dir).glob('lanes*.service')):
|
|
705
710
|
try:
|
|
@@ -710,6 +715,8 @@ def carried_settings(units_dir, names, environ):
|
|
|
710
715
|
match = UNIT_SETTING.match(line)
|
|
711
716
|
if match and match.group(1) in names and match.group(1) not in found:
|
|
712
717
|
found[match.group(1)] = re.sub(r'\\(.)', r'\1', match.group(2).replace('%%', '%'))
|
|
718
|
+
if home is not None and L.site_declares(L.THROTTLE_CONTROL_KEY, home):
|
|
719
|
+
found.pop(L.THROTTLE_CONTROL_KEY, None)
|
|
713
720
|
return {name: value for name, value in found.items() if not environ.get(name)}
|
|
714
721
|
|
|
715
722
|
|
|
@@ -941,7 +948,8 @@ class Update:
|
|
|
941
948
|
"""npx runs the installer (`--server --update-only`) with the run lock released -> the installer's result as an
|
|
942
949
|
exit status (FAILED when it recorded no run: npx or the wrapper failed before it)."""
|
|
943
950
|
services = services_module()
|
|
944
|
-
carried = carried_settings(services.manager_unit_dir(self.home), carried_names(services), self.environ
|
|
951
|
+
carried = carried_settings(services.manager_unit_dir(self.home), carried_names(services), self.environ,
|
|
952
|
+
self.home)
|
|
945
953
|
if carried:
|
|
946
954
|
self.say(f"with {', '.join(sorted(carried))} from the installed units")
|
|
947
955
|
rc = run_npx(argv, npx_environment(argv[0], self.environ, carried, check['latest'], check['at']), self.output)
|
|
@@ -1028,9 +1036,9 @@ class Update:
|
|
|
1028
1036
|
log.flush()
|
|
1029
1037
|
try:
|
|
1030
1038
|
units = services.manager_unit_dir(self.home)
|
|
1031
|
-
env = dict(self.environ, **carried_settings(units, carried_names(services), self.environ))
|
|
1039
|
+
env = dict(self.environ, **carried_settings(units, carried_names(services), self.environ, self.home))
|
|
1032
1040
|
services.register(previous, self.home, L.SHARE, self.state, env.get('LANES_WORKSPACES'),
|
|
1033
|
-
services.economy_settings(env), services.notify_settings(env), units_dir=units,
|
|
1041
|
+
services.economy_settings(env, self.home), services.notify_settings(env), units_dir=units,
|
|
1034
1042
|
install=True)
|
|
1035
1043
|
except services.Refusal as error:
|
|
1036
1044
|
log.write(f'services.py: refused, nothing was changed: {error}\n')
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Viewport supervisor: shows whichever lane this view's target file names. It never exits on its own:
|
|
3
3
|
# a zellij command pane whose command exits is held ("ENTER to re-run") and can be closed, so the view
|
|
4
4
|
# loops forever and shows a status screen instead of dying.
|
|
5
|
-
# usage: view.sh <device> <workspace> [slot]
|
|
5
|
+
# usage: view.sh <device> <workspace> [slot] [--mobile [<workspace title>]]
|
|
6
6
|
# switch lane: write the lane id to $STATE/views/<device>/<workspace>.<slot>.target, then `kill -USR1` this pid.
|
|
7
7
|
# new tree (cockpit v3 U5): `kill -USR2` this pid after an update flipped ~/.local/share/lanes/current. The view
|
|
8
8
|
# re-executes itself (`exec "$0" …`: the same pid, the path it was started by — a `current` path runs the new tree) at
|
|
@@ -15,6 +15,9 @@ on_reexec() { reexec=1; }
|
|
|
15
15
|
trap on_reexec USR2
|
|
16
16
|
device=${1:?device} ws=${2:?workspace} slot=${3:-main}
|
|
17
17
|
mobile=0; [ "${4:-}" != --mobile ] || mobile=1
|
|
18
|
+
# A phone view's fifth argument is its workspace's title (bin/lanes mobile_workspace_tab, E6): it names the pane while
|
|
19
|
+
# no lane shows. A layout from before E6 passes none, and its pane keeps a layout name, which Zellij shows instead.
|
|
20
|
+
ws_title=${5:-$ws}
|
|
18
21
|
case "$device$ws$slot" in *[!A-Za-z0-9_.-]*) echo 'invalid view name'; exit 64 ;; esac
|
|
19
22
|
state=${LANES_STATE:-$HOME/.local/state/lanes}
|
|
20
23
|
# -P: the PHYSICAL tree. A layout names this script through the `current` link (W9 U1); resolving it once pins every
|
|
@@ -65,7 +68,7 @@ run() {
|
|
|
65
68
|
# failed exec ends a non-interactive shell, so a script that is gone (a pruned tree) is not exec'd: this one goes on.
|
|
66
69
|
if [ "$reexec" = 1 ]; then
|
|
67
70
|
reexec=0
|
|
68
|
-
if [ -x "$0" ] && [ "$mobile" = 1 ]; then exec "$0" "$device" "$ws" "$slot" --mobile; fi
|
|
71
|
+
if [ -x "$0" ] && [ "$mobile" = 1 ]; then exec "$0" "$device" "$ws" "$slot" --mobile "$ws_title"; fi
|
|
69
72
|
if [ -x "$0" ]; then exec "$0" "$device" "$ws" "$slot"; fi
|
|
70
73
|
fi
|
|
71
74
|
return "$rc"
|
|
@@ -76,6 +79,30 @@ reset_terminal() {
|
|
|
76
79
|
printf '\033[?1049l\033[?1000l\033[?1002l\033[?1003l\033[?1006l\033[?2004l\033[<u\033[0m\033[?25h\033[2J\033[3J\033[H'
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
# name_pane <title>: a phone view (--mobile) names its pane after what it shows, with an OSC 2 title: the lane's title
|
|
83
|
+
# (or id), else its workspace's (E6, BEY-8667; the lane lead's rulings E6-R1 and E6-R2). The phone's header reads its
|
|
84
|
+
# lane line from it (mobile.js `pane?.title`), which is why the pane has no layout name: Zellij reports a non-empty
|
|
85
|
+
# name instead of the pane's own title (DEF-1531). The title is user text, so nothing that could end or escape the
|
|
86
|
+
# sequence or reorder the header reaches the terminal: C0 controls (ESC and BEL included), DEL, the C1 range, a byte
|
|
87
|
+
# that is no UTF-8, and the bidirectional marks, embeddings, overrides and isolates. The rest is cut to 100 characters,
|
|
88
|
+
# never inside a UTF-8 sequence (the lead's condition 1). A shell cannot do that, so a Python one-shot does, and only
|
|
89
|
+
# when the title changed: a pass that shows the same lane forks nothing for it. A desktop view writes none: its panes
|
|
90
|
+
# keep their layout names, and nothing is added to its stream.
|
|
91
|
+
named=
|
|
92
|
+
name_pane() {
|
|
93
|
+
if [ "$mobile" != 1 ] || [ "$1" = "$named" ]; then return 0; fi
|
|
94
|
+
named=$1
|
|
95
|
+
python3 -I -S -c '
|
|
96
|
+
import os, sys
|
|
97
|
+
title = os.fsencode(sys.argv[1]).decode("utf-8", "surrogateescape")
|
|
98
|
+
def unsafe(char):
|
|
99
|
+
point = ord(char)
|
|
100
|
+
return (point < 0x20 or 0x7f <= point <= 0x9f or 0xd800 <= point <= 0xdfff or point in (0x61c, 0x200e, 0x200f)
|
|
101
|
+
or 0x202a <= point <= 0x202e or 0x2066 <= point <= 0x2069)
|
|
102
|
+
os.write(1, b"\033]2;" + "".join(char for char in title if not unsafe(char))[:100].encode() + b"\033\\")
|
|
103
|
+
' "$1" 2>/dev/null || :
|
|
104
|
+
}
|
|
105
|
+
|
|
79
106
|
# The SGR literals of the design tokens (libexec/tokens.py --sh): sourced once, printf only, no fork. A plain source
|
|
80
107
|
# assigns the 16-colour set; `lz_tones` re-points them to another set (assignments and a `case`, no fork either).
|
|
81
108
|
# They hold `\033[…m` as text, so they go into printf's FORMAT (which turns `\033` into ESC), never into a %s argument.
|
|
@@ -136,6 +163,7 @@ health_hint() {
|
|
|
136
163
|
if [ $(($1 - at)) -gt 30 ]; then host_hint="${host_hint:+$host_hint }The status data is $(($1 - at)) s old."; fi
|
|
137
164
|
}
|
|
138
165
|
|
|
166
|
+
name_pane "$ws_title"
|
|
139
167
|
delay=1
|
|
140
168
|
while :; do
|
|
141
169
|
switching=0
|
|
@@ -170,18 +198,25 @@ while :; do
|
|
|
170
198
|
if [ -z "$lane" ] && [ "$slot" = main ]; then lane=$(head -n 1 "$state/defaults/$ws" 2>/dev/null || :); fi
|
|
171
199
|
case "$lane" in
|
|
172
200
|
''|*[!A-Za-z0-9_.-]*)
|
|
173
|
-
|
|
201
|
+
# A phone has no sidebar, so it gets no hint: the lane lead's ruling of 21 November 2026 removes the false
|
|
202
|
+
# instruction and adds no sentence until the design master rules one (E6).
|
|
203
|
+
if [ "$mobile" = 1 ]; then hint=
|
|
204
|
+
elif [ "$slot" = main ]; then hint='Pick one in the sidebar (Ctrl-Alt-/ to find a lane).'
|
|
174
205
|
else hint='In the sidebar, move to a lane and press 2 (or 3) to show it here.'; fi
|
|
206
|
+
name_pane "$ws_title"
|
|
175
207
|
status_screen "$ws" 'No lane selected.' "$hint"
|
|
176
208
|
switching=0; run python3 "$repo/libexec/connection.py" --title "${title:-$ws}" --wait 5 --preserve-screen || :; continue ;;
|
|
177
209
|
esac
|
|
178
210
|
resolve=$state/resolve/$lane
|
|
179
211
|
if [ ! -r "$resolve" ]; then resolve=$state/resolve.dynamic/$lane; fi
|
|
180
212
|
if [ ! -r "$resolve" ]; then
|
|
181
|
-
|
|
213
|
+
hint='Pick another lane in the sidebar.'; [ "$mobile" != 1 ] || hint=
|
|
214
|
+
name_pane "$ws_title"
|
|
215
|
+
status_screen "$lane" 'This lane is no longer in the registry.' "$hint"
|
|
182
216
|
switching=0; run python3 "$repo/libexec/connection.py" --title "${title:-$ws}" --wait 5 --preserve-screen || :; continue
|
|
183
217
|
fi
|
|
184
218
|
{ IFS= read -r holder; IFS= read -r f2; IFS= read -r f3; IFS= read -r f4; IFS= read -r title; } < "$resolve"
|
|
219
|
+
name_pane "${title:-$lane}"
|
|
185
220
|
|
|
186
221
|
reset_terminal
|
|
187
222
|
switching=0
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Resolve numbered shortcuts from the device profile and Zellij's managed pane identities."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import shlex
|
|
5
|
+
|
|
6
|
+
import device_sync
|
|
7
|
+
import lanes_lib as L
|
|
8
|
+
import users
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def projection(device, meta, registry, profile, call=L.run_bounded, allowed=None):
|
|
12
|
+
"""Up to nine visible boards. A missing managed tab keeps its slot empty."""
|
|
13
|
+
base = [os.environ.get('LANES_ZELLIJ') or str(L.SHARE / 'bin' / 'zellij-0.45.1'), '-s', device, 'action']
|
|
14
|
+
def listing(action, *flags):
|
|
15
|
+
code, output, _ = call(base + [action, '--json', *flags], 2)
|
|
16
|
+
if code != 0:
|
|
17
|
+
raise L.LanesError('Workspace list unavailable')
|
|
18
|
+
rows = json.loads(output)
|
|
19
|
+
if not isinstance(rows, list) or not all(isinstance(row, dict) for row in rows):
|
|
20
|
+
raise ValueError('Invalid workspace list')
|
|
21
|
+
return rows
|
|
22
|
+
|
|
23
|
+
tabs = listing('list-tabs')
|
|
24
|
+
panes = listing('list-panes', '--all')
|
|
25
|
+
mobile = bool(meta.get('mobile'))
|
|
26
|
+
known = device_sync.identities(device, tabs, panes, registry, mobile)
|
|
27
|
+
boards = users.arrange(registry['workspaces'], profile)
|
|
28
|
+
def managed(pane, board):
|
|
29
|
+
try:
|
|
30
|
+
words = shlex.split(pane.get('terminal_command') or pane.get('pane_command') or '')
|
|
31
|
+
except ValueError:
|
|
32
|
+
return False
|
|
33
|
+
return any(at is not None and words[at + 1:at + 3] == [device, board] for at in
|
|
34
|
+
(L.tree_file_at(words, 'libexec/sidebar'), L.tree_file_at(words, 'libexec/view.sh')))
|
|
35
|
+
|
|
36
|
+
result = []
|
|
37
|
+
for board in boards:
|
|
38
|
+
if allowed is not None and board['id'] not in allowed:
|
|
39
|
+
continue
|
|
40
|
+
choices = {}
|
|
41
|
+
for role in ('picker', 'view'):
|
|
42
|
+
tab = known.get(f"workspace/{board['id']}/{role}")
|
|
43
|
+
if tab is None:
|
|
44
|
+
continue
|
|
45
|
+
members = [p for p in panes if p.get('tab_id') == tab['tab_id'] and
|
|
46
|
+
not (p.get('is_plugin') or p.get('exited') or p.get('is_floating')) and type(p.get('id')) is int
|
|
47
|
+
and managed(p, board['id'])]
|
|
48
|
+
pane = next((p for p in members if p.get('is_focused')), next(iter(members), None))
|
|
49
|
+
if pane is not None:
|
|
50
|
+
choices[role] = {'tab': tab['name'], 'id': tab['tab_id'], 'pane': pane['id']}
|
|
51
|
+
result.append({'board': board['id'], 'workspace': board['title'], 'tabs': choices})
|
|
52
|
+
if len(result) == 9:
|
|
53
|
+
break
|
|
54
|
+
return result
|
|
@@ -25,9 +25,13 @@ for exec.run and exec, delivery for tmux_write).
|
|
|
25
25
|
no command separator) and the socket is one a registered lane of that container
|
|
26
26
|
uses; `text` is at most READ_BYTES_MAX bytes once JSON-escaped (`fit_text`:
|
|
27
27
|
capture-pane keeps its newest lines, the other verbs their first)
|
|
28
|
-
tmux_write{lane, text, enter, [intent], [epoch]} -> {lane, typed, enter, [intent]}; the ONE
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
tmux_write{lane, text, enter, [intent], [epoch]} -> {lane, typed, enter, pane, submitted, [intent]}; the ONE
|
|
29
|
+
write: send-keys only (with list-panes and capture-pane reads), into the pane
|
|
30
|
+
that holds the agent of a lane registered to that guest (a lane without one:
|
|
31
|
+
its active pane; BEY-8655), `check_text`-bounded, under the recipient's dispatch
|
|
32
|
+
lock ~/.lz/state/dispatch/<lane>.lock; after the Enter the agent's screen is read
|
|
33
|
+
and an Enter its composer did not take is pressed once more, never blind:
|
|
34
|
+
`submitted` is lane_core.send_checked's verdict (null without an Enter)
|
|
31
35
|
exec{template, args{container}, [intent], [epoch]} -> {template, container, rc, outcome, out, err, detail,
|
|
32
36
|
[intent]}; by template id only (EXEC_TEMPLATES: the pulse and lane-peerd re-arms),
|
|
33
37
|
never an argv; the guest decides whether it is due (`skipped` with `detail`) and
|
|
@@ -64,10 +68,16 @@ TEXT_MAX = 4000 # = lane_core.MESSAGE_MAX: the characters o
|
|
|
64
68
|
ARGS_MAX = 16 # words of one tmux_read argv
|
|
65
69
|
ARG_MAX = 1024 # characters of one of them
|
|
66
70
|
DEADLINE_S = 5.0 # client-side default per request
|
|
67
|
-
#
|
|
71
|
+
# DISPATCH_WAIT_S 5 + 2 x TMUX_TIMEOUT 5 + ENTER_DELAY 0.5 + a round trip (AR §3.32, msg.deliver's bound; the relay's)
|
|
68
72
|
WRITE_DEADLINE_S = 16.0
|
|
69
73
|
TMUX_TIMEOUT = 5 # = lane_core.TMUX_TIMEOUT
|
|
70
74
|
ENTER_DELAY = 0.5 # = lane_core.ENTER_DELAY: the Enter is a second client (DEF-1803)
|
|
75
|
+
CHECK_DELAY = 0.8 # = lane_core.CHECK_DELAY: an Enter, then the agent's screen is read (BEY-8655)
|
|
76
|
+
CHECK_AGAIN = 1.0 # = lane_core.CHECK_AGAIN: the second read before one more Enter
|
|
77
|
+
SETTLE_S = 4.0 # = lane_core.SETTLE_S: the reads after that one more Enter, bounded in time
|
|
78
|
+
# tmux_write since BEY-8655: DISPATCH_WAIT_S 5 + 6 x TMUX_TIMEOUT 5 (list-panes, the text, its Enter, two screen reads,
|
|
79
|
+
# one more Enter) + ENTER_DELAY + CHECK_DELAY + CHECK_AGAIN + SETTLE_S + the last read's TMUX_TIMEOUT + a round trip
|
|
80
|
+
TMUX_WRITE_DEADLINE_S = 47.0
|
|
71
81
|
|
|
72
82
|
OPS = ('hello', 'boards.list', 'boards.lanes', 'tmux_read', 'tmux_write', 'exec', 'exec.run', 'msg.deliver',
|
|
73
83
|
'msg.status')
|
|
@@ -95,7 +105,7 @@ ERRORS = (
|
|
|
95
105
|
'text_too_long', # tmux_write text over TEXT_MAX
|
|
96
106
|
'text_unprintable', # tmux_write text empty or holding a control/format/separator character
|
|
97
107
|
'busy', # another sender held the recipient's dispatch lock past DISPATCH_WAIT_S
|
|
98
|
-
'tmux_failed', # tmux did not take the keys (
|
|
108
|
+
'tmux_failed', # tmux did not take the keys, or the pane to type into could not be told (in `human`)
|
|
99
109
|
'template_unknown', # exec of a template id not in EXEC_TEMPLATES
|
|
100
110
|
'argv_refused', # exec carrying anything but a template id and its container (a free-form argv)
|
|
101
111
|
'adapter_unavailable', # retired (FC-X31: the forced command always serves the Python server); sent by no server
|
|
@@ -8,7 +8,7 @@ that domain and becomes a relay: a `lanes.api/1` client speaking Frame lines (FC
|
|
|
8
8
|
`$LANES_STATE/run/lanesd.sock`.
|
|
9
9
|
|
|
10
10
|
op domain while lanes-py owns the domain while the lanes host owns it
|
|
11
|
-
msg.deliver delivery owner_unclaimed (
|
|
11
|
+
msg.deliver delivery owner_unclaimed (no message typed) request{inbox_compose} (FC-T1) under the
|
|
12
12
|
UUIDv7 operation id the aggregator's
|
|
13
13
|
client minted (FC-D4)
|
|
14
14
|
msg.status delivery owner_unclaimed command{query_operation}
|
|
@@ -20,6 +20,9 @@ that domain and becomes a relay: a `lanes.api/1` client speaking Frame lines (FC
|
|
|
20
20
|
tmux_write delivery served by the server owned_elsewhere (FC-R2: every Python
|
|
21
21
|
effect path checks its domain)
|
|
22
22
|
|
|
23
|
+
tmux_write is a person's typing (lanes_lib.lane_write: `lanes upload --paste`), never a message's delivery: since
|
|
24
|
+
BEY-7538 (2026-11-08) a message never types into a terminal, so a client never falls back from msg.deliver to it.
|
|
25
|
+
|
|
23
26
|
The read operations (boards.*, tmux_read; AR's containers.resolve, fs.read|list|stat, proc.facts, holder.discover,
|
|
24
27
|
holder.facts, holder.capture and capacity.pools as they arrive) stay local Python reads: they observe and take no
|
|
25
28
|
effect. A relay holds no store, no lock and no probe, and it refuses `owner_unavailable` while lanesd.sock is absent.
|
|
@@ -237,7 +240,7 @@ class Relay:
|
|
|
237
240
|
owner, code = self.owner(op)
|
|
238
241
|
if owner == 'lanes-py':
|
|
239
242
|
raise P.ProtocolError('owner_unclaimed', f'no lanes host owns {DOMAIN_OF[op]} on this guest ({code}); '
|
|
240
|
-
'
|
|
243
|
+
'nothing types a message instead (BEY-7538)')
|
|
241
244
|
return self.socket_path()
|
|
242
245
|
|
|
243
246
|
def deliver(self, args):
|
|
@@ -15,14 +15,15 @@ and the local effects of that domain (tmux_write for delivery; exec and exec.run
|
|
|
15
15
|
|
|
16
16
|
It answers from the guest's own Lanes state (`$LANES_STATE`: registry.json, containers.json — the files its own
|
|
17
17
|
`lanes sync` and statusd write) and holds no store: it reads them again for every request, so a sync between two
|
|
18
|
-
requests is seen. The one write (`tmux_write`) types into the
|
|
19
|
-
recipient's dispatch lock (lanes_lib.dispatch_lock, the inode every writer in the
|
|
20
|
-
template id only, and only when the guest itself finds it due (the checks its own
|
|
21
|
-
is critical, nothing that is not installed, nothing that is running). Every
|
|
22
|
-
normative order: its shape, its verb allowlist and text bound, and only then its
|
|
23
|
-
order, one at a time: every op is bounded (tmux TMUX_TIMEOUT, the lock
|
|
24
|
-
EXEC_TEMPLATES seconds), so the longest wait a later request sees is one tmux_write
|
|
25
|
-
and worker pool of AR §3.32 come with its slow ops
|
|
18
|
+
requests is seen. The one write (`tmux_write`) types into the pane that holds the agent (BEY-8655) of a lane
|
|
19
|
+
registered to this guest, under the recipient's dispatch lock (lanes_lib.dispatch_lock, the inode every writer in the
|
|
20
|
+
container takes); `exec` spawns by template id only, and only when the guest itself finds it due (the checks its own
|
|
21
|
+
statusd makes: never while its health is critical, nothing that is not installed, nothing that is running). Every
|
|
22
|
+
request is checked in protocol.py's normative order: its shape, its verb allowlist and text bound, and only then its
|
|
23
|
+
recipient. Requests are served in order, one at a time: every op is bounded (tmux TMUX_TIMEOUT, the lock
|
|
24
|
+
DISPATCH_WAIT_S, each template its EXEC_TEMPLATES seconds), so the longest wait a later request sees is one tmux_write
|
|
25
|
+
(TMUX_WRITE_DEADLINE_S, 47 s); the reader thread and worker pool of AR §3.32 come with its slow ops
|
|
26
|
+
(containers.resolve). stderr is never part of the protocol;
|
|
26
27
|
nothing here logs a typed text."""
|
|
27
28
|
import os
|
|
28
29
|
import platform
|
|
@@ -195,19 +196,29 @@ class Server:
|
|
|
195
196
|
if lane is None:
|
|
196
197
|
raise P.ProtocolError('lane_unregistered', f'{lane_id} is not a registered tmux lane of this guest')
|
|
197
198
|
info = self.local_info(lane['container'])
|
|
198
|
-
sock,
|
|
199
|
+
sock, session = lane['tmux']['socket'], lane['tmux']['session']
|
|
200
|
+
# BEY-8655: into the pane that holds the lane's agent (a lane without one: its active pane), never the
|
|
201
|
+
# session's current window; after the Enter the agent's screen is read, and an Enter it did not take is pressed
|
|
202
|
+
# once more only while its composer still holds the text (lane_core.agent_pane, send_checked). Every tmux
|
|
203
|
+
# client goes through self.tmux; the reads are list-panes and capture-pane.
|
|
204
|
+
C = self.L.lane_core()
|
|
205
|
+
run = self.L.probe_runner(self.tmux, info, sock, P.TMUX_TIMEOUT)
|
|
199
206
|
with self.lock(info, lane_id) as busy:
|
|
200
207
|
if busy:
|
|
201
208
|
raise P.ProtocolError('busy', busy)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
raise P.ProtocolError('tmux_failed', f'
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
try:
|
|
210
|
+
found = C.agent_pane(sock, session, self.L.container_proc(info), run=run)
|
|
211
|
+
except C.LaneError as error:
|
|
212
|
+
raise P.ProtocolError('tmux_failed', f'not typed: {error} ({error.code})') from None
|
|
213
|
+
results, verdict = C.send_checked(sock, found['pane'], text, enter, found['harness'], run=run,
|
|
214
|
+
wait=self.pause)
|
|
215
|
+
if results[0].returncode:
|
|
216
|
+
detail = (results[0].stderr or '').strip()
|
|
217
|
+
raise P.ProtocolError('tmux_failed', f'tmux did not take it ({run.outcomes[-1]}'
|
|
218
|
+
f'{": " + detail if detail else ""})')
|
|
219
|
+
entered = bool(enter) and len(results) >= 2 and results[1].returncode == 0
|
|
220
|
+
return dict({'lane': lane_id, 'typed': True, 'enter': entered, 'pane': found['pane'], 'submitted': verdict},
|
|
221
|
+
**({'intent': intent} if intent else {}))
|
|
211
222
|
|
|
212
223
|
def template_plan(self, template, container, now=None):
|
|
213
224
|
"""('spawn', argv) when the template is due in `container` by this guest's own reading — the checks its
|
|
@@ -5,7 +5,9 @@ After=lanes-statusd.service
|
|
|
5
5
|
# No installer enables this unit. It reads the production daemon's control port, so switching it on is an operator
|
|
6
6
|
# action: systemctl --user enable --now lanes-economy.service (RUNBOOK "Economy projection (opt-in)").
|
|
7
7
|
# It runs on the HOST, not in the daemon's container: point LANES_THROTTLE_CONTAINER at that container for the log,
|
|
8
|
-
# and use LANES_THROTTLE_CONTROL=none unless the control port is reachable from the host (RUNBOOK, DEF-1525).
|
|
8
|
+
# and use LANES_THROTTLE_CONTROL=none unless the control port is reachable from the host (RUNBOOK, DEF-1525). The
|
|
9
|
+
# installer takes LANES_THROTTLE_CONTROL from the server's site.conf when its environment does not set it (BEY-6845),
|
|
10
|
+
# judged with the pulse's table and written normalised; a refused line refuses the install, never reaching this file.
|
|
9
11
|
[Service]
|
|
10
12
|
ExecStart=/usr/bin/python3 -S -E "@REPO@/libexec/economy_poll.py" --interval 10
|
|
11
13
|
Restart=on-failure
|
|
@@ -46,6 +46,10 @@ is missing or unreadable.
|
|
|
46
46
|
- `none`: attributes only; `accent` is bold.
|
|
47
47
|
- **Glyphs and labels.** Unicode and ASCII twins with their tones for the agent, stream, mark and economy glyphs,
|
|
48
48
|
plus the phone's agent labels.
|
|
49
|
+
Label tables and glyph keys come from the input document. The generator carries Hypervibe Pipeline revision 6's
|
|
50
|
+
`mobile_agent` and `holder` words and its `fleet_admin` mark without changing the Lanes source.
|
|
51
|
+
These members are optional. When `mobile_agent` is absent, the resolved table's compatibility alias is empty.
|
|
52
|
+
The schema already permits these tables and keys, so it needs no new required member.
|
|
49
53
|
- **Text hierarchy.** `primary` ink and `secondary` ink-dim carry essential text (4.5:1); `tertiary` ink-faint is
|
|
50
54
|
non-essential text only — hints, ages, rules — held to 3:1 on every surface it sits on.
|
|
51
55
|
- **Semantic states.** The meanings IC §5.1 and the terminal UX spec name — identity, selection, focus, approval,
|
|
@@ -110,6 +114,12 @@ phone's variant.
|
|
|
110
114
|
`lanes/tests/conformance/prove_detectors.sh` edits the committed source and the generated table without a new revision
|
|
111
115
|
and requires the digest detector to fail.
|
|
112
116
|
|
|
117
|
+
`PipelineRevisionSix` in `test_lanes2_token_generator.py` compares all five projections with independent Hypervibe
|
|
118
|
+
Pipeline files. Its [fixture record](../tests/unit/fixtures/pipeline-rev6/README.md) identifies the source commit and
|
|
119
|
+
the fleet mark correction. The suite also changes every label word and the fleet mark's glyph, ASCII twin, and tone
|
|
120
|
+
to prove that the input controls them. AR-7 checks every committed Lanes 1.8 output byte, including its older words
|
|
121
|
+
and mark. Each detector has a registered sabotage leg.
|
|
122
|
+
|
|
113
123
|
## Why the values are what they are
|
|
114
124
|
|
|
115
125
|
The reasons recorded beside the tables in `tokens.py` before F1, carried here with the values they explain:
|
|
@@ -388,7 +388,7 @@ def resolved(doc):
|
|
|
388
388
|
'palette16': {v: tiers['palette16'][v] for v in VARIANTS}, 'palette16_roles': tiers['palette16']['slot_roles'],
|
|
389
389
|
'agent_glyphs': glyph(doc['glyphs']['agent']), 'glyphs': glyph(doc['glyphs']['stream']),
|
|
390
390
|
'marks': glyph(doc['glyphs']['marks']), 'economy_tail': glyph(doc['glyphs']['economy']),
|
|
391
|
-
'glyph_modes': doc['glyph_modes'], 'mobile_agent_labels': doc['labels']
|
|
391
|
+
'glyph_modes': doc['glyph_modes'], 'mobile_agent_labels': doc['labels'].get('mobile_agent', {}),
|
|
392
392
|
'labels': doc['labels'], 'aliases': doc['projections']['css_aliases'],
|
|
393
393
|
'zj': doc['projections']['zellij_slots'], 'docs_roles': doc['projections']['docs_roles'],
|
|
394
394
|
'sh_names': doc['projections']['sh_names'], 'text': doc['text'], 'semantics': doc['semantics'],
|
|
@@ -18,8 +18,8 @@ http://:8083 {
|
|
|
18
18
|
Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' ws: wss:; img-src 'self' data:"
|
|
19
19
|
}
|
|
20
20
|
# lanes-docsd.service (libexec/docsd.py): the docs cockpit, login-bound pages, downloads, artifacts and uploads.
|
|
21
|
-
# handle_path strips /lanes-docs. It stays the FIRST handle of the site: Caddy never
|
|
22
|
-
# a handle
|
|
21
|
+
# handle_path strips /lanes-docs. It stays the FIRST handle of the site: Caddy never moves a single-path block ahead
|
|
22
|
+
# of a handle whose matcher is not exactly one path (the Zellij routes below).
|
|
23
23
|
handle_path /lanes-docs/* {
|
|
24
24
|
reverse_proxy 127.0.0.1:8185 {
|
|
25
25
|
# As on /enrol/*: keep the X-Forwarded-For Tailscale Serve sets (the client's tailnet address): docsd
|
|
@@ -62,6 +62,13 @@ http://:8083 {
|
|
|
62
62
|
}
|
|
63
63
|
reverse_proxy unix/{$LANES_STATE}/run/lanes-connectors.sock
|
|
64
64
|
}
|
|
65
|
+
# `/lanes-docs` without its slash is the Docs page, not a view named lanes-docs (bin/lanes reserves the name):
|
|
66
|
+
# a permanent redirect to `/lanes-docs/`, its query kept (an empty one leaves a bare `?`, read from Caddy's documentation; BEY-8667 E1b-2). One
|
|
67
|
+
# path, so Caddy sorts it among the single-path routes above, ahead of the Zellij page route (Caddy issue #5037).
|
|
68
|
+
@docsbare path /lanes-docs
|
|
69
|
+
handle @docsbare {
|
|
70
|
+
redir * /lanes-docs/?{query} 308
|
|
71
|
+
}
|
|
65
72
|
@backend path /assets/* /ws/* /command/* /info/* /session /session-list
|
|
66
73
|
handle @backend {
|
|
67
74
|
reverse_proxy 127.0.0.1:8082
|