Add opt-in Tentacle protocol 1.1, explicit remote grants, lifecycle IPC and expiring core leases in both SDKs. Revoke access before update preparation, including failed updates. Add transient secret entries, shared Braille cell export and isolated Xorg recovery experiments with focused tests and documented limitations. Production consent, desktop services and live interoperability remain pending.
53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
# Private conformance peer: author APIs only; no framing or lifecycle code.
|
|
import pathlib
|
|
import sys
|
|
import threading
|
|
|
|
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[3] / "sdk/python"))
|
|
from cthulhu_tentacle import Command, present, serve
|
|
|
|
started = threading.Event()
|
|
|
|
|
|
def echo(cancelled, arguments):
|
|
return arguments
|
|
|
|
|
|
def fail(cancelled, arguments):
|
|
raise RuntimeError("private handler details")
|
|
|
|
|
|
def large(cancelled, arguments):
|
|
return "x" * 65536
|
|
|
|
|
|
def wait(cancelled, arguments):
|
|
started.set()
|
|
cancelled.wait()
|
|
pathlib.Path(sys.argv[1]).write_text("cancelled")
|
|
|
|
|
|
def has_started(cancelled, arguments):
|
|
return started.wait(2)
|
|
|
|
|
|
commands = [Command("echo", "Echo", "", echo), Command("fail", "Fail", "", fail),
|
|
Command("large", "Large", "", large), Command("wait", "Wait", "", wait),
|
|
Command("started", "Started", "", has_started)]
|
|
if pathlib.Path(sys.argv[1]).name == "presentation":
|
|
commands.append(Command("present", "Present", "",
|
|
lambda cancelled, arguments: present(speech="Hello, é猫😀é", braille="Display é猫😀é", uninterruptible=True),
|
|
presentation=True))
|
|
if pathlib.Path(sys.argv[1]).name == "secret":
|
|
commands.extend([
|
|
Command("secret", "Secret", "", lambda cancelled, arguments: {
|
|
"form": {"title": "Connection", "elements": [
|
|
{"id": "key", "label": "Channel key", "kind": 2,
|
|
"secret": True, "required": True}]}, "next": "submit"},
|
|
presentation=True, interaction=True),
|
|
Command("submit", "Submit", "", lambda cancelled, arguments:
|
|
arguments["values"]["key"]["text"] == "fixture猫",
|
|
presentation=True, interaction=True),
|
|
])
|
|
serve(commands)
|