CYN-X
A human-centered intelligent system connecting local AI, interfaces, tools, software, vision, hardware, and future systems.
Project
The smallest useful picture of what this project is.
CYN-X
A human-centered intelligent system connecting local AI, interfaces, tools, software, vision, hardware, and future systems.
Principles
The rules and design principles the project is built around.
Components
The major systems and pieces that make up the project.
API Endpoints
Every discovered route is compact by default and expandable when you need its technical details.
hardware/web/app.py
3 endpoints
GET
/
home
— No description documented yet.
/
No description documented yet.
request
Request
GET
/dashboard
dashboard
— No description documented yet.
/dashboard
No description documented yet.
request
Request
POST
/chat
chat
— No description documented yet.
/chat
No description documented yet.
data
dict
interfaces/web/app.py
3 endpoints
GET
/
home
— No description documented yet.
/
No description documented yet.
request
Request
GET
/dashboard
dashboard
— No description documented yet.
/dashboard
No description documented yet.
request
Request
POST
/chat
chat
— No description documented yet.
/chat
No description documented yet.
data
dict
Functions & Methods
Searchable, grouped symbols with details hidden until requested.
ai/personality.py
11 symbols
get_manager
Get or initialize the PromptManager singleton.
ai/personality.py:173
Get or initialize the PromptManager singleton.
get_manager() -> PromptManager
get_personality
Load a legacy personality fragment.
ai/personality.py:191
Load a legacy personality fragment.
get_personality(name: str) -> str
name
str
get_personality_matrix
Return a copy of the active personality matrix.
ai/personality.py:241
Return a copy of the active personality matrix.
get_personality_matrix() -> Dict[str, int]
set_personality_matrix
Update the active personality matrix. Values are clamped between 0 and 100. Unknown traits are ignored. Invalid values are ignore…
ai/personality.py:249
Update the active personality matrix. Values are clamped between 0 and 100. Unknown traits are ignored. Invalid values are ignored.
set_personality_matrix(values: Dict[str, int]) -> Dict[str, int]
values
Dict[str, int]
reset_personality_matrix
Reset the personality matrix to defaults.
ai/personality.py:294
Reset the personality matrix to defaults.
reset_personality_matrix() -> Dict[str, int]
get_personality_preset
Return a personality preset. Unknown presets fall back to the default personality.
ai/personality.py:308
Return a personality preset. Unknown presets fall back to the default personality.
get_personality_preset(name: str) -> Dict[str, int]
name
str
apply_personality_preset
Apply a personality preset to the active matrix.
ai/personality.py:330
Apply a personality preset to the active matrix.
apply_personality_preset(name: str) -> Dict[str, int]
name
str
build_personality_prompt
Convert the active personality matrix into instructions that the language model can use.
ai/personality.py:351
Convert the active personality matrix into instructions that the language model can use.
build_personality_prompt() -> str
get_mode
No description documented yet.
ai/personality.py:459
No description documented yet.
get_mode(name: str) -> str
name
str
get_available_modes
No description documented yet.
ai/personality.py:470
No description documented yet.
get_available_modes() -> List[str]
build_system_prompt
No description documented yet.
ai/personality.py:481
No description documented yet.
build_system_prompt(core: bool = True, modes: List[str] = None, memory: str = '', context: str = '') -> str
core
bool
= True
modes
List[str]
= None
memory
str
= ''
context
str
= ''
barkly_docs.py
50 symbols
esc
No description documented yet.
barkly_docs.py:218
No description documented yet.
esc(value: object) -> str
value
object
compact_doc
No description documented yet.
barkly_docs.py:222
No description documented yet.
compact_doc(doc: str, limit: int = 180) -> str
doc
str
limit
int
= 180
full_doc
No description documented yet.
barkly_docs.py:234
No description documented yet.
full_doc(doc: str) -> str
doc
str
expression_text
No description documented yet.
barkly_docs.py:241
No description documented yet.
expression_text(node: Optional[ast.AST]) -> str
node
Optional[ast.AST]
annotation_text
No description documented yet.
barkly_docs.py:251
No description documented yet.
annotation_text(node: Optional[ast.AST]) -> str
node
Optional[ast.AST]
relative_file
No description documented yet.
barkly_docs.py:255
No description documented yet.
relative_file(path: Path, root: Path) -> str
path
Path
root
Path
code_line
No description documented yet.
barkly_docs.py:262
No description documented yet.
code_line(file: str, line: int) -> str
file
str
line
int
short_hash
No description documented yet.
barkly_docs.py:266
No description documented yet.
short_hash(value: str) -> str
value
str
safe_call
No description documented yet.
barkly_docs.py:270
No description documented yet.
safe_call(command: list[str], cwd: Path) -> str
command
list[str]
cwd
Path
git_branch
No description documented yet.
barkly_docs.py:289
No description documented yet.
git_branch(root: Path) -> str
root
Path
git_commit
No description documented yet.
barkly_docs.py:296
No description documented yet.
git_commit(root: Path) -> str
root
Path
git_log
No description documented yet.
barkly_docs.py:303
No description documented yet.
git_log(root: Path, limit: int = 8) -> list[str]
root
Path
limit
int
= 8
node_doc
No description documented yet.
barkly_docs.py:325
No description documented yet.
node_doc(node: ast.AST) -> str
node
ast.AST
decorator_name
No description documented yet.
barkly_docs.py:329
No description documented yet.
decorator_name(node: ast.AST) -> str
node
ast.AST
decorator_text
No description documented yet.
barkly_docs.py:343
No description documented yet.
decorator_text(node: ast.AST) -> str
node
ast.AST
decorators_for
No description documented yet.
barkly_docs.py:347
No description documented yet.
decorators_for(node: ast.AST) -> list[str]
node
ast.AST
parameter_kind
No description documented yet.
barkly_docs.py:354
No description documented yet.
parameter_kind(name: str, default_node: Optional[ast.AST]) -> str
name
str
default_node
Optional[ast.AST]
collect_parameters
No description documented yet.
barkly_docs.py:379
No description documented yet.
collect_parameters(node: ast.FunctionDef | ast.AsyncFunctionDef) -> list[Parameter]
node
ast.FunctionDef | ast.AsyncFunctionDef
call_root_name
No description documented yet.
barkly_docs.py:447
No description documented yet.
call_root_name(node: ast.Call) -> str
node
ast.Call
extract_string_argument
No description documented yet.
barkly_docs.py:457
No description documented yet.
extract_string_argument(call: ast.Call, index: int = 0) -> str
call
ast.Call
index
int
= 0
extract_methods_keyword
No description documented yet.
barkly_docs.py:472
No description documented yet.
extract_methods_keyword(call: ast.Call) -> list[str]
call
ast.Call
endpoint_from_decorator
No description documented yet.
barkly_docs.py:491
No description documented yet.
endpoint_from_decorator(decorator: ast.AST, function: ast.FunctionDef | ast.AsyncFunctionDef, file: str) -> Optional[EndpointInfo]
decorator
ast.AST
function
ast.FunctionDef | ast.AsyncFunctionDef
file
str
scan_python
No description documented yet.
barkly_docs.py:752
No description documented yet.
scan_python(root: Path) -> PythonScanner
root
Path
symbol_key
No description documented yet.
barkly_docs.py:762
No description documented yet.
symbol_key(function: FunctionInfo) -> str
function
FunctionInfo
class_key
No description documented yet.
barkly_docs.py:766
No description documented yet.
class_key(item: ClassInfo) -> str
item
ClassInfo
endpoint_key
No description documented yet.
barkly_docs.py:770
No description documented yet.
endpoint_key(item: EndpointInfo) -> str
item
EndpointInfo
function_fingerprint
No description documented yet.
barkly_docs.py:779
No description documented yet.
function_fingerprint(item: FunctionInfo) -> str
item
FunctionInfo
class_fingerprint
No description documented yet.
barkly_docs.py:793
No description documented yet.
class_fingerprint(item: ClassInfo) -> str
item
ClassInfo
endpoint_fingerprint
No description documented yet.
barkly_docs.py:810
No description documented yet.
endpoint_fingerprint(item: EndpointInfo) -> str
item
EndpointInfo
load_state
No description documented yet.
barkly_docs.py:835
No description documented yet.
load_state(path: Path) -> dict
path
Path
apply_state
No description documented yet.
barkly_docs.py:861
No description documented yet.
apply_state(scanner: PythonScanner, previous: dict) -> dict
scanner
PythonScanner
previous
dict
load_project_config
No description documented yet.
barkly_docs.py:919
No description documented yet.
load_project_config(root: Path) -> dict
root
Path
init_project
No description documented yet.
barkly_docs.py:941
No description documented yet.
init_project(root: Path) -> None
root
Path
badge
No description documented yet.
barkly_docs.py:963
No description documented yet.
badge(text: str, kind: str = '') -> str
text
str
kind
str
= ''
status_badges
No description documented yet.
barkly_docs.py:977
No description documented yet.
status_badges(is_new: bool, is_changed: bool) -> str
is_new
bool
is_changed
bool
parameter_summary
No description documented yet.
barkly_docs.py:997
No description documented yet.
parameter_summary(params: list[Parameter]) -> str
params
list[Parameter]
parameter_details
No description documented yet.
barkly_docs.py:1010
No description documented yet.
parameter_details(params: list[Parameter]) -> str
params
list[Parameter]
function_row
No description documented yet.
barkly_docs.py:1070
No description documented yet.
function_row(item: FunctionInfo, show_class: bool = False) -> str
item
FunctionInfo
show_class
bool
= False
method_group
No description documented yet.
barkly_docs.py:1179
No description documented yet.
method_group(title: str, functions: list[FunctionInfo]) -> str
title
str
functions
list[FunctionInfo]
class_group
No description documented yet.
barkly_docs.py:1244
No description documented yet.
class_group(item: ClassInfo) -> str
item
ClassInfo
endpoint_row
No description documented yet.
barkly_docs.py:1332
No description documented yet.
endpoint_row(item: EndpointInfo) -> str
item
EndpointInfo
module_row
No description documented yet.
barkly_docs.py:1447
No description documented yet.
module_row(module: ModuleInfo) -> str
module
ModuleInfo
section
No description documented yet.
barkly_docs.py:1526
No description documented yet.
section(number: str, title: str, description: str, body: str) -> str
number
str
title
str
description
str
body
str
info_card
No description documented yet.
barkly_docs.py:1566
No description documented yet.
info_card(title: str, value: str, description: str = '') -> str
title
str
value
str
description
str
= ''
simple_card_grid
No description documented yet.
barkly_docs.py:1593
No description documented yet.
simple_card_grid(values: list[str]) -> str
values
list[str]
search_toolbar
No description documented yet.
barkly_docs.py:1610
No description documented yet.
search_toolbar(input_id: str, count_id: str, new_id: str, placeholder: str) -> str
input_id
str
count_id
str
new_id
str
placeholder
str
build_html
No description documented yet.
barkly_docs.py:1656
No description documented yet.
build_html(project: dict, scanner: PythonScanner, state: dict, root: Path) -> str
project
dict
scanner
PythonScanner
state
dict
root
Path
generate
No description documented yet.
barkly_docs.py:3391
No description documented yet.
generate(source: Path, output: Path, name: Optional[str] = None, project_type: Optional[str] = None, status: Optional[str] = None) -> None
source
Path
output
Path
name
Optional[str]
= None
project_type
Optional[str]
= None
status
Optional[str]
= None
build_parser
No description documented yet.
barkly_docs.py:3483
No description documented yet.
build_parser() -> argparse.ArgumentParser
main
No description documented yet.
barkly_docs.py:3547
No description documented yet.
main() -> None
benchmark/analyzer.py
5 symbols
analyze_response
No description documented yet.
benchmark/analyzer.py:19
No description documented yet.
analyze_response(response: str) -> dict
response
str
analyze_tool_test
Analyze tool execution recorded by the benchmark runner. IMPORTANT: This function does NOT run a tool. The runner is responsible…
benchmark/analyzer.py:109
Analyze tool execution recorded by the benchmark runner. IMPORTANT: This function does NOT run a tool. The runner is responsible for actually running CYN-X and recording what happened. This analyzer only determines whether the recorded tool execution matches the expected behavior. Supported locations: result["tool_test"] or: result["analysis"]["tool_test"] Expected fields: expected_tool tool_called tool_name tool_arguments tool_result result_passed_to_llm failure
analyze_tool_test(result: dict) -> dict | None
result
dict
analyze_file
No description documented yet.
benchmark/analyzer.py:331
No description documented yet.
analyze_file(path: Path) -> dict | None
path
Path
find_result_files
Find all individual benchmark result files. Results are stored by runner.py under: benchmark/results/sections/
benchmark/analyzer.py:529
Find all individual benchmark result files. Results are stored by runner.py under: benchmark/results/sections/
find_result_files()
analyze_results
No description documented yet.
benchmark/analyzer.py:554
No description documented yet.
analyze_results()
benchmark/cleaner.py
1 symbols
main
No description documented yet.
benchmark/cleaner.py:448
No description documented yet.
main()
benchmark/cli.py
1 symbols
get_benchmark_command
Parse benchmark command-line arguments. Supported: python -m benchmark.runner python -m benchmark.runner quick python -m benchmar…
benchmark/cli.py:4
Parse benchmark command-line arguments. Supported: python -m benchmark.runner python -m benchmark.runner quick python -m benchmark.runner normal python -m benchmark.runner full python -m benchmark.runner --all python -m benchmark.runner --suite personality python -m benchmark.runner --suite personality safety memory python -m benchmark.runner --suite personality --limit 5 python -m benchmark.runner --suite personality safety --limit 10 python -m benchmark.runner --all --limit 10
get_benchmark_command()
benchmark/formatter.py
1 symbols
format_benchmark_result
No description documented yet.
benchmark/formatter.py:10
No description documented yet.
format_benchmark_result(test_id: str, category: str, question: str, response: str, response_time_seconds: float, observed_topics: list[str], behavior_tags: list[str], response_words: int = 0, response_characters: int = 0, response_lines: int = 0, response_sentences: int = 0, estimated_tokens: int = 0, scores: dict | None = None) -> dict
test_id
str
category
str
question
str
response
str
response_time_seconds
float
observed_topics
list[str]
behavior_tags
list[str]
response_words
int
= 0
response_characters
int
= 0
response_lines
int
= 0
response_sentences
int
= 0
estimated_tokens
int
= 0
scores
dict | None
= None
benchmark/modes.py
2 symbols
apply_benchmark_filters
Filters benchmark tests before execution. Args: tests: Loaded benchmark test list. limit: Maximum number of tests to run. categor…
benchmark/modes.py:6
Filters benchmark tests before execution. Args: tests: Loaded benchmark test list. limit: Maximum number of tests to run. categories: Only run tests matching these categories. suites: Only run tests from these benchmark suites. Returns: Filtered list of benchmark tests.
apply_benchmark_filters(tests: list[dict], limit: Optional[int] = None, categories: Optional[list[str]] = None, suites: Optional[list[str]] = None) -> list[dict]
tests
list[dict]
limit
Optional[int]
= None
categories
Optional[list[str]]
= None
suites
Optional[list[str]]
= None
get_benchmark_mode
Returns preset benchmark configurations. Modes: quick normal full
benchmark/modes.py:93
Returns preset benchmark configurations. Modes: quick normal full
get_benchmark_mode(mode: str) -> dict
mode
str
benchmark/runner.py
20 symbols
get_result_section
No description documented yet.
benchmark/runner.py:140
No description documented yet.
get_result_section(category)
category
_colorized_message
No description documented yet.
benchmark/runner.py:162
No description documented yet.
_colorized_message(message, style)
message
style
bench_info
No description documented yet.
benchmark/runner.py:166
No description documented yet.
bench_info(message)
message
bench_warning
No description documented yet.
benchmark/runner.py:175
No description documented yet.
bench_warning(message)
message
bench_error
No description documented yet.
benchmark/runner.py:184
No description documented yet.
bench_error(message)
message
bench_pass
No description documented yet.
benchmark/runner.py:193
No description documented yet.
bench_pass(message)
message
bench_fail
No description documented yet.
benchmark/runner.py:199
No description documented yet.
bench_fail(message)
message
bench_header
No description documented yet.
benchmark/runner.py:205
No description documented yet.
bench_header(message)
message
bench_suite
No description documented yet.
benchmark/runner.py:211
No description documented yet.
bench_suite(name)
name
bench_test_id
No description documented yet.
benchmark/runner.py:215
No description documented yet.
bench_test_id(test_id)
test_id
setup_logging
No description documented yet.
benchmark/runner.py:219
No description documented yet.
setup_logging()
load_questions
No description documented yet.
benchmark/runner.py:324
No description documented yet.
load_questions(suites = None)
suites
= None
configure_benchmark_prompt
Configure the existing PromptBuilder using the benchmark test's prompt preset/layers. Uses the existing PromptBuilder layer syste…
benchmark/runner.py:547
Configure the existing PromptBuilder using the benchmark test's prompt preset/layers. Uses the existing PromptBuilder layer system. Does not require apply_preset() or set_preset().
configure_benchmark_prompt(chat_engine, test)
chat_engine
test
format_prompt_layers
No description documented yet.
benchmark/runner.py:728
No description documented yet.
format_prompt_layers(layers)
layers
score_response
No description documented yet.
benchmark/runner.py:1205
No description documented yet.
score_response(response, category)
response
category
run_single_test
No description documented yet.
benchmark/runner.py:1354
No description documented yet.
run_single_test(chat_engine, test)
chat_engine
test
run_benchmark
No description documented yet.
benchmark/runner.py:1724
No description documented yet.
run_benchmark(chat_engine, limit = None, categories = None, suites = None)
chat_engine
limit
= None
categories
= None
suites
= None
create_cynx_engine
No description documented yet.
benchmark/runner.py:2078
No description documented yet.
create_cynx_engine()
run_command
No description documented yet.
benchmark/runner.py:2220
No description documented yet.
run_command(engine)
engine
main
No description documented yet.
benchmark/runner.py:2395
No description documented yet.
main()
benchmark/visualize.py
4 symbols
load_results
No description documented yet.
benchmark/visualize.py:45
No description documented yet.
load_results()
score_rating
No description documented yet.
benchmark/visualize.py:244
No description documented yet.
score_rating(score)
score
human_category_name
No description documented yet.
benchmark/visualize.py:279
No description documented yet.
human_category_name(name)
name
graph
No description documented yet.
benchmark/visualize.py:362
No description documented yet.
graph(name, values, title, label)
name
values
title
label
clean_cyn.py
2 symbols
clean_file
No description documented yet.
clean_cyn.py:22
No description documented yet.
clean_file(path: Path)
path
Path
main
No description documented yet.
clean_cyn.py:49
No description documented yet.
main()
config.py
2 symbols
get_config
No description documented yet.
config.py:25
No description documented yet.
get_config() -> Config
logging_level_from_env
No description documented yet.
config.py:43
No description documented yet.
logging_level_from_env() -> int
cyndiscord.py
2 symbols
on_ready
No description documented yet.
cyndiscord.py:69
No description documented yet.
on_ready()
on_message
No description documented yet.
cyndiscord.py:73
No description documented yet.
on_message(message)
message
hardware/lepro/discovery.py
1 symbols
discover_devices
No description documented yet.
hardware/lepro/discovery.py:63
No description documented yet.
discover_devices(timeout: float = 15.0) -> list[dict[str, Any]]
timeout
float
= 15.0
hardware/lepro/lib/lepro/bond.py
15 symbols
tokens_from_bond_frames
Bond keys from post-bond 0x2100 notify (64 B: hs + auth_16 + auth_32). Ghidra: libiot requestBond only sends encrypted magic; no…
hardware/lepro/lib/lepro/bond.py:108
Bond keys from post-bond 0x2100 notify (64 B: hs + auth_16 + auth_32). Ghidra: libiot requestBond only sends encrypted magic; no tokens in .so. Firmware pushes per-bond keys on 0x2100 (FUN_4200e078 / FUN_4201d274 result 7). ctrl_c/ctrl_d stay device-static (protocol.py captures).
tokens_from_bond_frames(frames: list[DecryptedFrame], after_index: int = 0) -> BondTokens
frames
list[DecryptedFrame]
after_index
int
= 0
is_bond_success
True for bond result 0/7 or 16-byte LIGHT_ACK on 0x1003.
hardware/lepro/lib/lepro/bond.py:145
True for bond result 0/7 or 16-byte LIGHT_ACK on 0x1003.
is_bond_success(frame: DecryptedFrame) -> bool
frame
DecryptedFrame
normalize_mac
No description documented yet.
hardware/lepro/lib/lepro/bond.py:156
No description documented yet.
normalize_mac(mac: str) -> str
mac
str
creds_path
No description documented yet.
hardware/lepro/lib/lepro/bond.py:163
No description documented yet.
creds_path(mac: str) -> Path
mac
str
load_creds
No description documented yet.
hardware/lepro/lib/lepro/bond.py:168
No description documented yet.
load_creds(mac: str) -> BondCredentials | None
mac
str
save_creds
No description documented yet.
hardware/lepro/lib/lepro/bond.py:176
No description documented yet.
save_creds(creds: BondCredentials) -> Path
creds
BondCredentials
harvest_tokens
Heuristic token harvest from bond-session RX. Scans decrypted cert/device-info payloads and raw notify bytes for unique 16B and 3…
hardware/lepro/lib/lepro/bond.py:183
Heuristic token harvest from bond-session RX. Scans decrypted cert/device-info payloads and raw notify bytes for unique 16B and 32B candidates. Prefer blobs appearing in cert (0x2000).
harvest_tokens(frames: list[DecryptedFrame], raw_rx: list[bytes]) -> BondTokens
frames
list[DecryptedFrame]
raw_rx
list[bytes]
check_bond_result
No description documented yet.
hardware/lepro/lib/lepro/bond.py:232
No description documented yet.
check_bond_result(frames: list[DecryptedFrame]) -> int
frames
list[DecryptedFrame]
_scan_blob
No description documented yet.
hardware/lepro/lib/lepro/bond.py:240
No description documented yet.
_scan_blob(data: bytes, out_16: list[bytes], out_32: list[bytes]) -> None
data
bytes
out_16
list[bytes]
out_32
list[bytes]
_unique
No description documented yet.
hardware/lepro/lib/lepro/bond.py:249
No description documented yet.
_unique(items: list[bytes]) -> list[bytes]
items
list[bytes]
export_provision_header
C header for ESP32 NVS / compile-time flash.
hardware/lepro/lib/lepro/bond.py:259
C header for ESP32 NVS / compile-time flash.
export_provision_header(creds: BondCredentials) -> str
creds
BondCredentials
export_provision_nvs
ESP-IDF NVS CSV format.
hardware/lepro/lib/lepro/bond.py:285
ESP-IDF NVS CSV format.
export_provision_nvs(creds: BondCredentials) -> str
creds
BondCredentials
_connect_transport
No description documented yet.
hardware/lepro/lib/lepro/bond.py:303
No description documented yet.
_connect_transport(mac: str, debug_rx: bool = False, scan_timeout: float = 15.0)
mac
str
debug_rx
bool
= False
scan_timeout
float
= 15.0
_cmd_bond
No description documented yet.
hardware/lepro/lib/lepro/bond.py:328
No description documented yet.
_cmd_bond(args: argparse.Namespace) -> None
args
argparse.Namespace
main
No description documented yet.
hardware/lepro/lib/lepro/bond.py:342
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/cli/_common.py
5 symbols
connect_transport
No description documented yet.
hardware/lepro/lib/lepro/cli/_common.py:16
No description documented yet.
connect_transport(mac: str, debug_rx: bool = False, scan_timeout: float = 15.0) -> tuple[BleakTransport, BleakClient]
mac
str
debug_rx
bool
= False
scan_timeout
float
= 15.0
run_dry_control
No description documented yet.
hardware/lepro/lib/lepro/cli/_common.py:38
No description documented yet.
run_dry_control(mac: str, payload: DpPayload) -> list[tuple[str, bytes]]
mac
str
payload
DpPayload
print_dry_run
No description documented yet.
hardware/lepro/lib/lepro/cli/_common.py:53
No description documented yet.
print_dry_run(sent: list[tuple[str, bytes]]) -> None
sent
list[tuple[str, bytes]]
run_control
No description documented yet.
hardware/lepro/lib/lepro/cli/_common.py:64
No description documented yet.
run_control(mac: str, payload: DpPayload, dry_run: bool = False, debug_rx: bool = False) -> None
mac
str
payload
DpPayload
dry_run
bool
= False
debug_rx
bool
= False
run_status
No description documented yet.
hardware/lepro/lib/lepro/cli/_common.py:88
No description documented yet.
run_status(mac: str, dry_run: bool = False, debug_rx: bool = False) -> None
mac
str
dry_run
bool
= False
debug_rx
bool
= False
hardware/lepro/lib/lepro/cli/bond.py
3 symbols
_cmd_bond
No description documented yet.
hardware/lepro/lib/lepro/cli/bond.py:25
No description documented yet.
_cmd_bond(args: argparse.Namespace) -> None
args
argparse.Namespace
_cmd_export
No description documented yet.
hardware/lepro/lib/lepro/cli/bond.py:64
No description documented yet.
_cmd_export(args: argparse.Namespace) -> None
args
argparse.Namespace
main
No description documented yet.
hardware/lepro/lib/lepro/cli/bond.py:85
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/cli/ctl.py
2 symbols
_cmd_mode_play
No description documented yet.
hardware/lepro/lib/lepro/cli/ctl.py:17
No description documented yet.
_cmd_mode_play(args: argparse.Namespace) -> None
args
argparse.Namespace
main
No description documented yet.
hardware/lepro/lib/lepro/cli/ctl.py:57
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/cli/firmware.py
5 symbols
_resolve
No description documented yet.
hardware/lepro/lib/lepro/cli/firmware.py:18
No description documented yet.
_resolve(profiles_path: Path | None, profile_id: str | None, firmware_path: Path | None)
profiles_path
Path | None
profile_id
str | None
firmware_path
Path | None
cmd_fetch
No description documented yet.
hardware/lepro/lib/lepro/cli/firmware.py:31
No description documented yet.
cmd_fetch(args: argparse.Namespace) -> None
args
argparse.Namespace
cmd_patch
No description documented yet.
hardware/lepro/lib/lepro/cli/firmware.py:47
No description documented yet.
cmd_patch(args: argparse.Namespace) -> None
args
argparse.Namespace
cmd_verify
No description documented yet.
hardware/lepro/lib/lepro/cli/firmware.py:72
No description documented yet.
cmd_verify(args: argparse.Namespace) -> None
args
argparse.Namespace
main
No description documented yet.
hardware/lepro/lib/lepro/cli/firmware.py:93
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/cli/ota.py
1 symbols
main
No description documented yet.
hardware/lepro/lib/lepro/cli/ota.py:13
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/cli/provision.py
2 symbols
_apply_config
No description documented yet.
hardware/lepro/lib/lepro/cli/provision.py:14
No description documented yet.
_apply_config(args: argparse.Namespace, cfg_path: Path | None) -> None
args
argparse.Namespace
cfg_path
Path | None
main
No description documented yet.
hardware/lepro/lib/lepro/cli/provision.py:37
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/cli/status.py
1 symbols
main
No description documented yet.
hardware/lepro/lib/lepro/cli/status.py:13
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/commands.py
11 symbols
power_on
Turn lamp on. APK test harness uses {"d1":1} only.
hardware/lepro/lib/lepro/commands.py:18
Turn lamp on. APK test harness uses {"d1":1} only.
power_on(brightness: int = 1000) -> dict[str, Any]
brightness
int
= 1000
power_off
No description documented yet.
hardware/lepro/lib/lepro/commands.py:27
No description documented yet.
power_off() -> dict[str, Any]
color_hsv
No description documented yet.
hardware/lepro/lib/lepro/commands.py:31
No description documented yet.
color_hsv(hue: float, sat: int = 1000, val: int = 1000, brightness: int = 1000) -> dict[str, Any]
hue
float
sat
int
= 1000
val
int
= 1000
brightness
int
= 1000
color_rgb
No description documented yet.
hardware/lepro/lib/lepro/commands.py:40
No description documented yet.
color_rgb(r: int, g: int, b: int, brightness: int = 1000) -> dict[str, Any]
r
int
g
int
b
int
brightness
int
= 1000
status_query
getDpState query — APK passes a JSON array string to bleGetDpState().
hardware/lepro/lib/lepro/commands.py:46
getDpState query — APK passes a JSON array string to bleGetDpState().
status_query(fields: tuple[str, ...] | None = None) -> list[str]
fields
tuple[str, ...] | None
= None
segment_solid
No description documented yet.
hardware/lepro/lib/lepro/commands.py:54
No description documented yet.
segment_solid(rgb: tuple[int, int, int] = (255, 255, 255), brightness: int = 1000, bulb_count: int | None = None) -> dict[str, Any]
rgb
tuple[int, int, int]
= (255, 255, 255)
brightness
int
= 1000
bulb_count
int | None
= None
dp_json_text
No description documented yet.
hardware/lepro/lib/lepro/commands.py:69
No description documented yet.
dp_json_text(payload: DpPayload) -> str
payload
DpPayload
build_dp_value_packets
Encrypt DP JSON and return (packets, next_seq).
hardware/lepro/lib/lepro/commands.py:73
Encrypt DP JSON and return (packets, next_seq).
build_dp_value_packets(mac: str, seq: int, payload: DpPayload, session_rand: int, max_payload: int = 128) -> tuple[list[bytes], int]
mac
str
seq
int
payload
DpPayload
session_rand
int
max_payload
int
= 128
build_get_dp_state_packet
Encrypted getDpState query on 0x1102.
hardware/lepro/lib/lepro/commands.py:87
Encrypted getDpState query on 0x1102.
build_get_dp_state_packet(mac: str, seq: int, payload: DpPayload, session_rand: int) -> bytes
mac
str
seq
int
payload
DpPayload
session_rand
int
build_dp_ciphertext_packets
No description documented yet.
hardware/lepro/lib/lepro/commands.py:99
No description documented yet.
build_dp_ciphertext_packets(seq: int, ciphertext: bytes, max_payload: int = 128) -> tuple[list[bytes], int]
seq
int
ciphertext
bytes
max_payload
int
= 128
build_raw_cmd_packet
Opaque auth token on 0x1102 (no encryption).
hardware/lepro/lib/lepro/commands.py:109
Opaque auth token on 0x1102 (no encryption).
build_raw_cmd_packet(seq: int, token: bytes) -> bytes
seq
int
token
bytes
hardware/lepro/lib/lepro/config.py
2 symbols
config_path
No description documented yet.
hardware/lepro/lib/lepro/config.py:51
No description documented yet.
config_path(explicit: Path | None = None) -> Path
explicit
Path | None
= None
load_config
No description documented yet.
hardware/lepro/lib/lepro/config.py:60
No description documented yet.
load_config(path: Path | None = None) -> LeproLabConfig
path
Path | None
= None
hardware/lepro/lib/lepro/crypto.py
13 symbols
mac_string_to_bytes
'10:20:BA:31:B2:BA' -> 6 bytes.
hardware/lepro/lib/lepro/crypto.py:42
'10:20:BA:31:B2:BA' -> 6 bytes.
mac_string_to_bytes(mac: str) -> bytes
mac
str
derive_session_key
Session AES key at le_msg_ctx+0x19 (dpValue, sendWifiMqttInfo, RX decrypt). init_msg() patches bytes [3:7] of the MAC template ke…
hardware/lepro/lib/lepro/crypto.py:50
Session AES key at le_msg_ctx+0x19 (dpValue, sendWifiMqttInfo, RX decrypt). init_msg() patches bytes [3:7] of the MAC template key with bleInit's rand(). The rand value is also stored in search-hello plaintext field ctx1.
derive_session_key(mac: str | bytes, session_rand: int) -> bytes
mac
str | bytes
session_rand
int
derive_aes_key
Replicate init_msg() key setup for a light MAC. For 10:20:BA:31:B2:BA the key is: 31b2ba3522130ecff4d2525e6c290bf9
hardware/lepro/lib/lepro/crypto.py:62
Replicate init_msg() key setup for a light MAC. For 10:20:BA:31:B2:BA the key is: 31b2ba3522130ecff4d2525e6c290bf9
derive_aes_key(mac: str | bytes) -> bytes
mac
str | bytes
_lepro_pad
Padding used inside FUN_0x18d244 (le_aes_128_encrypt_cbc core). pad_len = ((len & ~0xF) - len) + 16 Append pad_len bytes each equ…
hardware/lepro/lib/lepro/crypto.py:81
Padding used inside FUN_0x18d244 (le_aes_128_encrypt_cbc core). pad_len = ((len & ~0xF) - len) + 16 Append pad_len bytes each equal to pad_len.
_lepro_pad(data: bytes) -> bytes
data
bytes
_lepro_unpad
No description documented yet.
hardware/lepro/lib/lepro/crypto.py:93
No description documented yet.
_lepro_unpad(data: bytes) -> bytes
data
bytes
encrypt_cbc
Encrypt with Lepro's CBC + custom padding.
hardware/lepro/lib/lepro/crypto.py:104
Encrypt with Lepro's CBC + custom padding.
encrypt_cbc(plaintext: bytes, key: bytes, iv: bytes = MAIN_IV) -> bytes
plaintext
bytes
key
bytes
iv
bytes
= MAIN_IV
decrypt_cbc
Decrypt and strip Lepro padding.
hardware/lepro/lib/lepro/crypto.py:112
Decrypt and strip Lepro padding.
decrypt_cbc(ciphertext: bytes, key: bytes, iv: bytes = MAIN_IV) -> bytes
ciphertext
bytes
key
bytes
iv
bytes
= MAIN_IV
build_search_hello_plaintext
Plaintext for searchDeviceInfo (0x1000) before encryption.
hardware/lepro/lib/lepro/crypto.py:120
Plaintext for searchDeviceInfo (0x1000) before encryption.
build_search_hello_plaintext(ctx0: int = 0, ctx1: int = 0, timestamp: int | None = None) -> bytes
ctx0
int
= 0
ctx1
int
= 0
timestamp
int | None
= None
encrypt_search_hello
Encrypt a 0x10/0x00 searchDeviceInfo hello (32-byte ciphertext).
hardware/lepro/lib/lepro/crypto.py:132
Encrypt a 0x10/0x00 searchDeviceInfo hello (32-byte ciphertext).
encrypt_search_hello(mac: str | bytes, ctx0: int = 0, ctx1: int = 0, timestamp: int | None = None) -> bytes
mac
str | bytes
ctx0
int
= 0
ctx1
int
= 0
timestamp
int | None
= None
decrypt_search_hello
Decrypt a 0x10/0x00 hello payload. Returns (magic, ctx0, ctx1, timestamp).
hardware/lepro/lib/lepro/crypto.py:144
Decrypt a 0x10/0x00 hello payload. Returns (magic, ctx0, ctx1, timestamp).
decrypt_search_hello(ciphertext: bytes, mac: str | bytes) -> tuple[bytes, int, int, int]
ciphertext
bytes
mac
str | bytes
encrypt_bond_request
Encrypt requestBond() plaintext (16-byte ciphertext). After bleInit/search, native code uses the session key (ctx+0x19), not the…
hardware/lepro/lib/lepro/crypto.py:159
Encrypt requestBond() plaintext (16-byte ciphertext). After bleInit/search, native code uses the session key (ctx+0x19), not the MAC key.
encrypt_bond_request(mac: str | bytes, session_rand: int | None = None) -> bytes
mac
str | bytes
session_rand
int | None
= None
encrypt_dp_json
Encrypt a DP JSON body the same way dpValue()/getDpState() do. Native code passes strlen(json)+1 bytes (includes the NUL). Use se…
hardware/lepro/lib/lepro/crypto.py:172
Encrypt a DP JSON body the same way dpValue()/getDpState() do. Native code passes strlen(json)+1 bytes (includes the NUL). Use session_rand from search-hello ctx1; MAC-only key is not sufficient.
encrypt_dp_json(mac: str | bytes, json_text: str, session_rand: int | None = None, null_terminated: bool = True) -> bytes
mac
str | bytes
json_text
str
session_rand
int | None
= None
null_terminated
bool
= True
decrypt_dp_json
Decrypt a dpValue/getDpState payload and return UTF-8 JSON text.
hardware/lepro/lib/lepro/crypto.py:196
Decrypt a dpValue/getDpState payload and return UTF-8 JSON text.
decrypt_dp_json(ciphertext: bytes, mac: str | bytes, session_rand: int | None = None) -> str
ciphertext
bytes
mac
str | bytes
session_rand
int | None
= None
hardware/lepro/lib/lepro/firmware_profile.py
7 symbols
parse_hex
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:61
No description documented yet.
parse_hex(value: str, field: str) -> bytes
value
str
field
str
_parse_int
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:74
No description documented yet.
_parse_int(value: object, field: str) -> int
value
object
field
str
_parse_bundle
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:82
No description documented yet.
_parse_bundle(raw: dict, profile_id: str) -> BundleConfig
raw
dict
profile_id
str
_parse_patch
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:105
No description documented yet.
_parse_patch(raw: dict, profile_id: str, index: int) -> BytePatch
raw
dict
profile_id
str
index
int
_parse_profile
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:121
No description documented yet.
_parse_profile(raw: dict) -> FirmwareProfile
raw
dict
load_profiles
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:154
No description documented yet.
load_profiles(path: Path | None = None) -> PatchProfiles
path
Path | None
= None
resolve_profile
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:175
No description documented yet.
resolve_profile(profiles: PatchProfiles, firmware_path: Path | None = None, profile_id: str | None = None) -> FirmwareProfile
profiles
PatchProfiles
firmware_path
Path | None
= None
profile_id
str | None
= None
hardware/lepro/lib/lepro/frame.py
6 symbols
_magic_byte
No description documented yet.
hardware/lepro/lib/lepro/frame.py:59
No description documented yet.
_magic_byte(magic: tuple[int, int]) -> int
magic
tuple[int, int]
_is_fragment_magic
No description documented yet.
hardware/lepro/lib/lepro/frame.py:63
No description documented yet.
_is_fragment_magic(magic2: int) -> bool
magic2
int
parse_ota_start_resp
0x1011 OTA start response. v2.3.18 returns compact big-endian u32 status + u32 offset. Older traces used an 8-byte wrapper with a…
hardware/lepro/lib/lepro/frame.py:238
0x1011 OTA start response. v2.3.18 returns compact big-endian u32 status + u32 offset. Older traces used an 8-byte wrapper with ackSn/code at +4/+6.
parse_ota_start_resp(frame: DecryptedFrame) -> OtaStartResponse | None
frame
DecryptedFrame
parse_ota_data_resp
0x1013 per-chunk data response.
hardware/lepro/lib/lepro/frame.py:261
0x1013 per-chunk data response.
parse_ota_data_resp(frame: DecryptedFrame) -> OtaDataResponse | None
frame
DecryptedFrame
parse_bond_result
0x1003 / 0xaaaa bond response → uint32 result code (big-endian).
hardware/lepro/lib/lepro/frame.py:275
0x1003 / 0xaaaa bond response → uint32 result code (big-endian).
parse_bond_result(frame: DecryptedFrame) -> int | None
frame
DecryptedFrame
load_capture_packets
No description documented yet.
hardware/lepro/lib/lepro/frame.py:285
No description documented yet.
load_capture_packets(path: str | Path | None = None) -> list[bytes]
path
str | Path | None
= None
hardware/lepro/lib/lepro/modes.py
23 symbols
default_bulb_count
No description documented yet.
hardware/lepro/lib/lepro/modes.py:87
No description documented yet.
default_bulb_count() -> int
hsv_hex
12-char HSV protocol string (Hsv.toProtocolString).
hardware/lepro/lib/lepro/modes.py:94
12-char HSV protocol string (Hsv.toProtocolString).
hsv_hex(hue: float, sat: int = 1000, val: int = 1000) -> str
hue
float
sat
int
= 1000
val
int
= 1000
rgbic_scene
Segmented / RGB-IC scene mode (d2=2 + d50 + d52).
hardware/lepro/lib/lepro/modes.py:102
Segmented / RGB-IC scene mode (d2=2 + d50 + d52).
rgbic_scene(d50: str, brightness: int = 1000, power: bool = True) -> dict[str, Any]
d50
str
brightness
int
= 1000
power
bool
= True
white_mode
No description documented yet.
hardware/lepro/lib/lepro/modes.py:114
No description documented yet.
white_mode(brightness: int = 500, temp: int = 400, power: bool = True) -> dict[str, Any]
brightness
int
= 500
temp
int
= 400
power
bool
= True
legacy_scene_d6
Legacy bulb gradient/rainbow scenes on d6 (EffectEntity dpType=d6).
hardware/lepro/lib/lepro/modes.py:125
Legacy bulb gradient/rainbow scenes on d6 (EffectEntity dpType=d6).
legacy_scene_d6(d6: str, power: bool = True) -> dict[str, Any]
d6
str
power
bool
= True
scene_gradient
No description documented yet.
hardware/lepro/lib/lepro/modes.py:133
No description documented yet.
scene_gradient(power: bool = True) -> dict[str, Any]
power
bool
= True
scene_rainbow
No description documented yet.
hardware/lepro/lib/lepro/modes.py:137
No description documented yet.
scene_rainbow(power: bool = True) -> dict[str, Any]
power
bool
= True
_speed_to_hex
No description documented yet.
hardware/lepro/lib/lepro/modes.py:141
No description documented yet.
_speed_to_hex(speed: int) -> str
speed
int
_speed_to_hex_center
Center-side native clamps speed_time below 0x41 to 0x40 (diyValueCenterSide).
hardware/lepro/lib/lepro/modes.py:149
Center-side native clamps speed_time below 0x41 to 0x40 (diyValueCenterSide).
_speed_to_hex_center(speed: int) -> str
speed
int
effect_tail
Six DIY effect tails confirmed in D50_FORMAT.md.
hardware/lepro/lib/lepro/modes.py:158
Six DIY effect tails confirmed in D50_FORMAT.md.
effect_tail(name: str, speed: int = 50) -> str
name
str
speed
int
= 50
build_d50_flash
Type 9 Flash — no F21 length segment; U3F3 opcode (diyValue case 9, lightMode=1).
hardware/lepro/lib/lepro/modes.py:182
Type 9 Flash — no F21 length segment; U3F3 opcode (diyValue case 9, lightMode=1).
build_d50_flash(color: str, speed: int = 50) -> str
color
str
speed
int
= 50
build_d50_center_solid
Types 12/13 center-side animation on uniform color (#V:02 + #I00/#I01).
hardware/lepro/lib/lepro/modes.py:191
Types 12/13 center-side animation on uniform color (#V:02 + #I00/#I01).
build_d50_center_solid(color: str, effect: str, speed: int = 50, bulb_count: int | None = None) -> str
color
str
effect
str
speed
int
= 50
bulb_count
int | None
= None
build_d50_solid
Single-color whole-string d50 (one group, all bulbs same color).
hardware/lepro/lib/lepro/modes.py:218
Single-color whole-string d50 (one group, all bulbs same color).
build_d50_solid(color: str, effect: str = 'Steady', speed: int = 50, bulb_count: int | None = None) -> str
color
str
effect
str
= 'Steady'
speed
int
= 50
bulb_count
int | None
= None
build_d50_from_leds
Full-string d50 from per-bulb colors.
hardware/lepro/lib/lepro/modes.py:238
Full-string d50 from per-bulb colors.
build_d50_from_leds(leds: list[str | None], effect: str = 'Steady', speed: int = 50, bulb_count: int | None = None) -> str
leds
list[str | None]
effect
str
= 'Steady'
speed
int
= 50
bulb_count
int | None
= None
diy_solid
No description documented yet.
hardware/lepro/lib/lepro/modes.py:265
No description documented yet.
diy_solid(color: str, effect: str = 'Steady', speed: int = 50, brightness: int = 1000, bulb_count: int | None = None) -> dict[str, Any]
color
str
effect
str
= 'Steady'
speed
int
= 50
brightness
int
= 1000
bulb_count
int | None
= None
list_presets
No description documented yet.
hardware/lepro/lib/lepro/modes.py:299
No description documented yet.
list_presets(presets_dir: Path | None = None) -> list[Path]
presets_dir
Path | None
= None
load_preset
Load preset JSON by stem name (e.g. 'hulk').
hardware/lepro/lib/lepro/modes.py:306
Load preset JSON by stem name (e.g. 'hulk').
load_preset(name: str, presets_dir: Path | None = None) -> dict[str, Any]
name
str
presets_dir
Path | None
= None
preset_frames
Normalize preset to list of frame payloads (each gets d1=1 if missing).
hardware/lepro/lib/lepro/modes.py:322
Normalize preset to list of frame payloads (each gets d1=1 if missing).
preset_frames(preset: dict[str, Any]) -> list[dict[str, Any]]
preset
dict[str, Any]
preset_duration_ms
No description documented yet.
hardware/lepro/lib/lepro/modes.py:340
No description documented yet.
preset_duration_ms(preset: dict[str, Any], default: int = 4000) -> int
preset
dict[str, Any]
default
int
= 4000
resolve_mode
Build a single DP payload from a built-in mode id.
hardware/lepro/lib/lepro/modes.py:344
Build a single DP payload from a built-in mode id.
resolve_mode(name: str, **kwargs: Any) -> DpPayload
name
str
**kwargs
Any
debug_payload
Return JSON text + encrypted size + estimated BLE page count.
hardware/lepro/lib/lepro/modes.py:375
Return JSON text + encrypted size + estimated BLE page count.
debug_payload(mac: str, payload: DpPayload) -> dict[str, Any]
mac
str
payload
DpPayload
format_mode_catalog
No description documented yet.
hardware/lepro/lib/lepro/modes.py:401
No description documented yet.
format_mode_catalog() -> str
iter_preset_play
No description documented yet.
hardware/lepro/lib/lepro/modes.py:436
No description documented yet.
iter_preset_play(name: str, **kwargs: Any) -> Iterator[tuple[dict[str, Any], int]]
name
str
**kwargs
Any
hardware/lepro/lib/lepro/ota.py
41 symbols
wait_ota_frag_ack
Wait for per-fragment ACK with matching seq. Mid-fragment ACKs use magic 0x54; the final fragment ACK uses magic 0x50 (0xAAAA).
hardware/lepro/lib/lepro/ota.py:174
Wait for per-fragment ACK with matching seq. Mid-fragment ACKs use magic 0x54; the final fragment ACK uses magic 0x50 (0xAAAA).
wait_ota_frag_ack(session: LeproSession, seq: int, timeout: float = 5.0) -> DecryptedFrame
session
LeproSession
seq
int
timeout
float
= 5.0
send_ota_packets
Send fragmented OTA op, waiting for a per-fragment ACK after each TX.
hardware/lepro/lib/lepro/ota.py:196
Send fragmented OTA op, waiting for a per-fragment ACK after each TX.
send_ota_packets(session: LeproSession, packets: list[bytes], log: OtaLog, label: str) -> DecryptedFrame | None
session
LeproSession
packets
list[bytes]
log
OtaLog
label
str
wait_opcode_verbose
Wait for an opcode, logging heartbeats so a stall is obvious.
hardware/lepro/lib/lepro/ota.py:220
Wait for an opcode, logging heartbeats so a stall is obvious.
wait_opcode_verbose(session: LeproSession, opcode: int, timeout: float, log: OtaLog, label: str, heartbeat: float = 5.0) -> DecryptedFrame
session
LeproSession
opcode
int
timeout
float
log
OtaLog
label
str
heartbeat
float
= 5.0
_write_u16_be
No description documented yet.
hardware/lepro/lib/lepro/ota.py:255
No description documented yet.
_write_u16_be(buf: bytearray, offset: int, value: int) -> None
buf
bytearray
offset
int
value
int
_write_u32_be
No description documented yet.
hardware/lepro/lib/lepro/ota.py:259
No description documented yet.
_write_u32_be(buf: bytearray, offset: int, value: int) -> None
buf
bytearray
offset
int
value
int
build_ota_start_inner
Legacy 5120-byte plaintext inner buffer (older OTA path: JSON at +8).
hardware/lepro/lib/lepro/ota.py:263
Legacy 5120-byte plaintext inner buffer (older OTA path: JSON at +8).
build_ota_start_inner(json_bytes: bytes) -> bytes
json_bytes
bytes
build_ota_start_plaintext
v2.3.18 OTA start plaintext: NUL-terminated JSON C string.
hardware/lepro/lib/lepro/ota.py:272
v2.3.18 OTA start plaintext: NUL-terminated JSON C string.
build_ota_start_plaintext(json_bytes: bytes) -> bytes
json_bytes
bytes
build_ota_chunk_inner
Legacy 5120-byte padded inner buffer (pre-v2.3.18 otaProcess layout).
hardware/lepro/lib/lepro/ota.py:279
Legacy 5120-byte padded inner buffer (pre-v2.3.18 otaProcess layout).
build_ota_chunk_inner(offset: int, chunk: bytes) -> bytes
offset
int
chunk
bytes
build_ota_chunk_plaintext
v2.3.18 OTA data plaintext: 8-byte header + chunk (FUN_420095d4 expects len+8).
hardware/lepro/lib/lepro/ota.py:291
v2.3.18 OTA data plaintext: 8-byte header + chunk (FUN_420095d4 expects len+8).
build_ota_chunk_plaintext(offset: int, chunk: bytes) -> bytes
offset
int
chunk
bytes
encrypt_ota_inner
No description documented yet.
hardware/lepro/lib/lepro/ota.py:303
No description documented yet.
encrypt_ota_inner(mac: str, session_rand: int, inner: bytes) -> bytes
mac
str
session_rand
int
inner
bytes
build_ota_start_packets
No description documented yet.
hardware/lepro/lib/lepro/ota.py:308
No description documented yet.
build_ota_start_packets(mac: str, seq: int, json_bytes: bytes, session_rand: int, max_payload: int = 128) -> tuple[list[bytes], int]
mac
str
seq
int
json_bytes
bytes
session_rand
int
max_payload
int
= 128
build_ota_chunk_packets
No description documented yet.
hardware/lepro/lib/lepro/ota.py:322
No description documented yet.
build_ota_chunk_packets(mac: str, seq: int, offset: int, chunk: bytes, session_rand: int, max_payload: int = 128) -> tuple[list[bytes], int]
mac
str
seq
int
offset
int
chunk
bytes
session_rand
int
max_payload
int
= 128
firmware_version_from_path
No description documented yet.
hardware/lepro/lib/lepro/ota.py:337
No description documented yet.
firmware_version_from_path(path: Path) -> str | None
path
Path
version_from_discovery
Best-effort running fw semver from discovery notify payload.
hardware/lepro/lib/lepro/ota.py:342
Best-effort running fw semver from discovery notify payload.
version_from_discovery(raw: bytes) -> str | None
raw
bytes
_semver_tuple
No description documented yet.
hardware/lepro/lib/lepro/ota.py:362
No description documented yet.
_semver_tuple(version: str) -> tuple[int, int, int]
version
str
adjust_ota_version_for_running
Bump JSON/embedded version when --reflash and device already reports >= proposed OTA version. Only used when --reflash is set. De…
hardware/lepro/lib/lepro/ota.py:369
Bump JSON/embedded version when --reflash and device already reports >= proposed OTA version. Only used when --reflash is set. Default BLE OTA sends do_check:0, so the firmware version gate is skipped and this ratchet is not needed.
adjust_ota_version_for_running(running: str | None, ota_ver: str, reflash: bool) -> str
running
str | None
ota_ver
str
reflash
bool
bump_ota_version
Bump PATCH so JSON version differs from running fw_version. FUN_42008eb0 strcmp's running fw against JSON version when do_check=1.
hardware/lepro/lib/lepro/ota.py:385
Bump PATCH so JSON version differs from running fw_version. FUN_42008eb0 strcmp's running fw against JSON version when do_check=1.
bump_ota_version(version: str) -> str
version
str
resolve_ota_version
No description documented yet.
hardware/lepro/lib/lepro/ota.py:400
No description documented yet.
resolve_ota_version(firmware: Path, version: str | None = None, reflash: bool = False) -> str
firmware
Path
version
str | None
= None
reflash
bool
= False
firmware_cdn_path
No description documented yet.
hardware/lepro/lib/lepro/ota.py:414
No description documented yet.
firmware_cdn_path(path: Path, version: str | None = None) -> str
path
Path
version
str | None
= None
md5_hex
No description documented yet.
hardware/lepro/lib/lepro/ota.py:422
No description documented yet.
md5_hex(data: bytes) -> str
data
bytes
bump_embedded_version
Rewrite fixed-width version strings inside an ESP-IDF app image.
hardware/lepro/lib/lepro/ota.py:426
Rewrite fixed-width version strings inside an ESP-IDF app image.
bump_embedded_version(image: bytearray, old_ver: str, new_ver: str) -> int
image
bytearray
old_ver
str
new_ver
str
_encode_xtensa_movi_n_a8
Encode `movi.n a8, imm` for non-negative immediates representable in RI7.
hardware/lepro/lib/lepro/ota.py:447
Encode `movi.n a8, imm` for non-negative immediates representable in RI7.
_encode_xtensa_movi_n_a8(value: int) -> bytes
value
int
_decode_xtensa_movi_n_a8
Decode `movi.n a8, imm`; return None when the bytes are not that instruction.
hardware/lepro/lib/lepro/ota.py:457
Decode `movi.n a8, imm`; return None when the bytes are not that instruction.
_decode_xtensa_movi_n_a8(data: bytes) -> int | None
data
bytes
patch_discovery_version
Rewrite the hardcoded 0x1001 device-info semver immediates in the firmware.
hardware/lepro/lib/lepro/ota.py:465
Rewrite the hardcoded 0x1001 device-info semver immediates in the firmware.
patch_discovery_version(image: bytearray, version: str) -> int
image
bytearray
version
str
repair_esp_app_image
Recalculate ESP-IDF image checksum + validation hash after byte patches.
hardware/lepro/lib/lepro/ota.py:499
Recalculate ESP-IDF image checksum + validation hash after byte patches.
repair_esp_app_image(image: bytearray, chip: str = 'esp32s3') -> None
image
bytearray
chip
str
= 'esp32s3'
prepare_ota_image
Load firmware bytes for OTA, optionally bumping embedded strings + discovery semver.
hardware/lepro/lib/lepro/ota.py:514
Load firmware bytes for OTA, optionally bumping embedded strings + discovery semver.
prepare_ota_image(firmware: Path, version: str | None = None, reflash: bool = False, chip: str = 'esp32s3') -> tuple[bytes, str]
firmware
Path
version
str | None
= None
reflash
bool
= False
chip
str
= 'esp32s3'
build_ota_start_json
Build raw JSON bytes for BLE OTA start (FUN_42008eb0 flat parser).
hardware/lepro/lib/lepro/ota.py:539
Build raw JSON bytes for BLE OTA start (FUN_42008eb0 flat parser).
build_ota_start_json(firmware: Path, image: bytes, version: str, path_version: str | None = None, ota_secret: str = '') -> bytes
firmware
Path
image
bytes
version
str
path_version
str | None
= None
ota_secret
str
= ''
describe_ota_start_error
Human-readable hint for OTA start response codes.
hardware/lepro/lib/lepro/ota.py:561
Human-readable hint for OTA start response codes.
describe_ota_start_error(code: int) -> str
code
int
describe_ota_data_error
Human-readable hint for OTA data response codes (0x1013 / FUN_420095d4).
hardware/lepro/lib/lepro/ota.py:578
Human-readable hint for OTA data response codes (0x1013 / FUN_420095d4).
describe_ota_data_error(code: int) -> str
code
int
classify_ota_verdict
Classify post-reboot discovery into stuck vs rolled back vs reconnect failure.
hardware/lepro/lib/lepro/ota.py:599
Classify post-reboot discovery into stuck vs rolled back vs reconnect failure.
classify_ota_verdict(flashed_ver: str, running_ver: str | None, reconnect_ok: bool) -> OtaConfirmVerdict
flashed_ver
str
running_ver
str | None
reconnect_ok
bool
report_ota_verdict
Log transfer + confirm outcome and exit non-zero on failure.
hardware/lepro/lib/lepro/ota.py:656
Log transfer + confirm outcome and exit non-zero on failure.
report_ota_verdict(verdict: OtaConfirmVerdict, transfer: OtaTransferResult, log: OtaLog) -> None
verdict
OtaConfirmVerdict
transfer
OtaTransferResult
log
OtaLog
check_version_policy
No description documented yet.
hardware/lepro/lib/lepro/ota.py:713
No description documented yet.
check_version_policy(firmware: Path, force: bool) -> None
firmware
Path
force
bool
_device_matches
True when a bleak device looks like our target light.
hardware/lepro/lib/lepro/ota.py:722
True when a bleak device looks like our target light.
_device_matches(mac: str, device: object) -> bool
mac
str
device
object
_find_device_active
Active BLE scan; on macOS prefer name 'LP' (random peripheral UUIDs).
hardware/lepro/lib/lepro/ota.py:732
Active BLE scan; on macOS prefer name 'LP' (random peripheral UUIDs).
_find_device_active(mac: str, log: OtaLog, timeout: float) -> object | None
mac
str
log
OtaLog
timeout
float
_watch_for_device
Passive scan until the light advertises or deadline passes.
hardware/lepro/lib/lepro/ota.py:758
Passive scan until the light advertises or deadline passes.
_watch_for_device(mac: str, log: OtaLog, deadline: float) -> object | None
mac
str
log
OtaLog
deadline
float
_connect_to_device
No description documented yet.
hardware/lepro/lib/lepro/ota.py:791
No description documented yet.
_connect_to_device(device: object, mac: str, log: OtaLog, debug_rx: bool = False, debug_tx: bool = False) -> tuple[OtaTransport, BleakClient]
device
object
mac
str
log
OtaLog
debug_rx
bool
= False
debug_tx
bool
= False
_connect
No description documented yet.
hardware/lepro/lib/lepro/ota.py:824
No description documented yet.
_connect(mac: str, log: OtaLog, debug_rx: bool = False, debug_tx: bool = False, scan_timeout: float = 15.0, device: object | None = None) -> tuple[OtaTransport, BleakClient]
mac
str
log
OtaLog
debug_rx
bool
= False
debug_tx
bool
= False
scan_timeout
float
= 15.0
device
object | None
= None
_confirm_with_discovery
Send discovery (0x1000) to trigger esp_ota_mark_app_valid_cancel_rollback.
hardware/lepro/lib/lepro/ota.py:846
Send discovery (0x1000) to trigger esp_ota_mark_app_valid_cancel_rollback.
_confirm_with_discovery(mac: str, transport: OtaTransport, flashed_ver: str, log: OtaLog) -> OtaConfirmVerdict
mac
str
transport
OtaTransport
flashed_ver
str
log
OtaLog
run_post_reboot_confirm
Reconnect after OTA reboot and run discovery while image is still PENDING_VERIFY.
hardware/lepro/lib/lepro/ota.py:874
Reconnect after OTA reboot and run discovery while image is still PENDING_VERIFY.
run_post_reboot_confirm(mac: str, flashed_ver: str, log: OtaLog, transfer_finished_at: float | None = None, debug_rx: bool = False, scan_timeout: float = 15.0, wait_s: float = POST_REBOOT_WAIT_S, retry_s: float = POST_REBOOT_RETRY_S, retry_interval_s: float = POST_REBOOT_RETRY_INTERVAL_S) -> OtaConfirmVerdict
mac
str
flashed_ver
str
log
OtaLog
transfer_finished_at
float | None
= None
debug_rx
bool
= False
scan_timeout
float
= 15.0
wait_s
float
= POST_REBOOT_WAIT_S
retry_s
float
= POST_REBOOT_RETRY_S
retry_interval_s
float
= POST_REBOOT_RETRY_INTERVAL_S
run_ota
No description documented yet.
hardware/lepro/lib/lepro/ota.py:1139
No description documented yet.
run_ota(args: argparse.Namespace) -> None
args
argparse.Namespace
main
No description documented yet.
hardware/lepro/lib/lepro/ota.py:1274
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/patch_cdn.py
20 symbols
apply_byte_patch
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:91
No description documented yet.
apply_byte_patch(fw: bytearray, patch: BytePatch) -> PatchResult
fw
bytearray
patch
BytePatch
check_byte_patch
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:110
No description documented yet.
check_byte_patch(fw: bytes, patch: BytePatch) -> PatchResult
fw
bytes
patch
BytePatch
apply_byte_patches
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:124
No description documented yet.
apply_byte_patches(fw: bytearray, patches: Sequence[BytePatch]) -> list[PatchResult]
fw
bytearray
patches
Sequence[BytePatch]
check_byte_patches
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:128
No description documented yet.
check_byte_patches(fw: bytes, patches: Sequence[BytePatch]) -> list[PatchResult]
fw
bytes
patches
Sequence[BytePatch]
be16
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:132
No description documented yet.
be16(buf: bytes, off: int) -> int
buf
bytes
off
int
find_bundle_layout
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:136
No description documented yet.
find_bundle_layout(fw: bytes, bundle: BundleConfig, bundle_off: int | None = None, pin_off: int | None = None, expected_record: bytes | None = None) -> BundleLayout
fw
bytes
bundle
BundleConfig
bundle_off
int | None
= None
pin_off
int | None
= None
expected_record
bytes | None
= None
parse_bundle_layout
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:180
No description documented yet.
parse_bundle_layout(fw: bytes, bundle_off: int, bundle: BundleConfig, expected_record: bytes | None = None, expected_entry_off: int | None = None) -> BundleLayout
fw
bytes
bundle_off
int
bundle
BundleConfig
expected_record
bytes | None
= None
expected_entry_off
int | None
= None
pem_to_der
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:231
No description documented yet.
pem_to_der(pem_path: Path) -> bytes
pem_path
Path
parse_host_port
Split "host" or "host:port" (ignoring bracketed IPv6) into (host, port).
hardware/lepro/lib/lepro/patch_cdn.py:239
Split "host" or "host:port" (ignoring bracketed IPv6) into (host, port).
parse_host_port(value: str, default_port: int = DEFAULT_CDN_PORT) -> tuple[str, int]
value
str
default_port
int
= DEFAULT_CDN_PORT
fetch_cert_der_from_host
Open a TLS connection and return the server leaf certificate as DER.
hardware/lepro/lib/lepro/patch_cdn.py:248
Open a TLS connection and return the server leaf certificate as DER.
fetch_cert_der_from_host(host: str, port: int = DEFAULT_CDN_PORT, connect_host: str | None = None, timeout: float = 10.0) -> bytes
host
str
port
int
= DEFAULT_CDN_PORT
connect_host
str | None
= None
timeout
float
= 10.0
load_cert_der
Resolve the cert to pin: live from `cert_host` if given, else local PEM.
hardware/lepro/lib/lepro/patch_cdn.py:273
Resolve the cert to pin: live from `cert_host` if given, else local PEM.
load_cert_der(cert_path: Path | None, cert_host: str | None, cert_connect: str | None = None, cert_port: int = DEFAULT_CDN_PORT) -> tuple[bytes, str]
cert_path
Path | None
cert_host
str | None
cert_connect
str | None
= None
cert_port
int
= DEFAULT_CDN_PORT
build_bundle_record
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:292
No description documented yet.
build_bundle_record(cert_der: bytes) -> tuple[bytes, bytes, bytes]
cert_der
bytes
split_bundle_record
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:302
No description documented yet.
split_bundle_record(record: bytes, layout: BundleLayout) -> tuple[bytes, bytes]
record
bytes
layout
BundleLayout
sha256_hex
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:306
No description documented yet.
sha256_hex(data: bytes) -> str
data
bytes
checksum_off
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:310
No description documented yet.
checksum_off(fw: bytes) -> int
fw
bytes
repair_esp_app_image
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:316
No description documented yet.
repair_esp_app_image(fw: bytearray, chip: str) -> tuple[int, int, str, str]
fw
bytearray
chip
str
footer_valid
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:333
No description documented yet.
footer_valid(path: Path, chip: str) -> tuple[bool, str]
path
Path
chip
str
warn_if_footer_invalid
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:348
No description documented yet.
warn_if_footer_invalid(fw: bytes, chip: str) -> None
fw
bytes
chip
str
patch_firmware
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:367
No description documented yet.
patch_firmware(profile: FirmwareProfile, firmware_path: Path, output_path: Path, cert_path: Path | None = None, cert_host: str | None = None, cert_connect: str | None = None, bundle_off: int | None = None, pin_off: int | None = None, verify_only: bool = False, force: bool = False) -> None
profile
FirmwareProfile
firmware_path
Path
output_path
Path
cert_path
Path | None
= None
cert_host
str | None
= None
cert_connect
str | None
= None
bundle_off
int | None
= None
pin_off
int | None
= None
verify_only
bool
= False
force
bool
= False
main
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:528
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/paths.py
1 symbols
repo_path
No description documented yet.
hardware/lepro/lib/lepro/paths.py:12
No description documented yet.
repo_path(*parts: str) -> Path
*parts
str
hardware/lepro/lib/lepro/protocol.py
11 symbols
opcode_to_wire
Convert native uint16 opcode to (ptype, subtype) wire bytes.
hardware/lepro/lib/lepro/protocol.py:110
Convert native uint16 opcode to (ptype, subtype) wire bytes.
opcode_to_wire(opcode: int) -> tuple[int, int]
opcode
int
wire_to_opcode
No description documented yet.
hardware/lepro/lib/lepro/protocol.py:115
No description documented yet.
wire_to_opcode(ptype: int, subtype: int) -> int
ptype
int
subtype
int
crc16_lepro
Native CRC from le_msg_tx_data_ext (table @ 0x14a758, init=0).
hardware/lepro/lib/lepro/protocol.py:119
Native CRC from le_msg_tx_data_ext (table @ 0x14a758, init=0).
crc16_lepro(data: bytes, init: int = 0) -> int
data
bytes
init
int
= 0
crc16_ibm
CRC-16/IBM — matches native table for all captured CMD/RSP packets.
hardware/lepro/lib/lepro/protocol.py:127
CRC-16/IBM — matches native table for all captured CMD/RSP packets.
crc16_ibm(data: bytes) -> int
data
bytes
parse_packet
Parse a captured BLE packet. Returns None if too short.
hardware/lepro/lib/lepro/protocol.py:150
Parse a captured BLE packet. Returns None if too short.
parse_packet(raw: bytes) -> PacketHeader | None
raw
bytes
_build_body
No description documented yet.
hardware/lepro/lib/lepro/protocol.py:174
No description documented yet.
_build_body(seq: int, magic2: int, field6: int, field7: int, payload: bytes) -> bytes
seq
int
magic2
int
field6
int
field7
int
payload
bytes
build_packet
Construct a valid LP-light BLE packet (single 0x5A 0x50 frame).
hardware/lepro/lib/lepro/protocol.py:195
Construct a valid LP-light BLE packet (single 0x5A 0x50 frame).
build_packet(seq: int, ptype: int, subtype: int, payload: bytes) -> bytes
seq
int
ptype
int
subtype
int
payload
bytes
build_packet_opcode
Build packet from native uint16 opcode.
hardware/lepro/lib/lepro/protocol.py:201
Build packet from native uint16 opcode.
build_packet_opcode(seq: int, opcode: int, payload: bytes) -> bytes
seq
int
opcode
int
payload
bytes
build_packets_fragmented
Split payload across 0x51/0x52/0x53 frames per le_msg_tx_data_ext. max_payload: max bytes per fragment (native ctx+0x14 MTU chunk…
hardware/lepro/lib/lepro/protocol.py:207
Split payload across 0x51/0x52/0x53 frames per le_msg_tx_data_ext. max_payload: max bytes per fragment (native ctx+0x14 MTU chunk size).
build_packets_fragmented(seq: int, opcode: int, payload: bytes, max_payload: int = 128, encrypted: bool = False) -> list[bytes]
seq
int
opcode
int
payload
bytes
max_payload
int
= 128
encrypted
bool
= False
verify_packet
Verify the CRC of a captured packet.
hardware/lepro/lib/lepro/protocol.py:273
Verify the CRC of a captured packet.
verify_packet(raw: bytes) -> bool
raw
bytes
_load_capture_packets
No description documented yet.
hardware/lepro/lib/lepro/protocol.py:300
No description documented yet.
_load_capture_packets(path: str = 'captures.log') -> list[bytes]
path
str
= 'captures.log'
hardware/lepro/lib/lepro/provision.py
11 symbols
_prov_paths_file
No description documented yet.
hardware/lepro/lib/lepro/provision.py:49
No description documented yet.
_prov_paths_file(mac: str) -> Path
mac
str
resolve_cert_paths
Return root/cert paths to send in provision JSON. Verified against ZB1 v2.3.18 firmware (ota_state_machine_advance, state 0x2b):…
hardware/lepro/lib/lepro/provision.py:54
Return root/cert paths to send in provision JSON. Verified against ZB1 v2.3.18 firmware (ota_state_machine_advance, state 0x2b): for each of "root"/"cert" the bulb ARMS its per-resource CDN fetch flag (sentinel 0x5a5a5a5a) only when the NVS key is missing (first provision) OR the path we send is byte-identical to the path already stored in NVS. If the path DIFFERS, the firmware does nothing — it neither updates NVS nor arms a fetch. Resend the exact stored path to re-arm and re-download (e.g. after rotating the cert file at the same CDN URL). On **stock** firmware the HTTPS download still requires onboarding mode (prov_mode 2/3); see prepare_cert_refetch(). On **patched** firmware (`lepro-firmware patch`, default) the prov_mode gate is removed so re-provision with the same paths re-fetches certs on an already-provisioned bulb.
resolve_cert_paths(mac: str, root: str, cert: str, update_cert_paths: bool = False) -> tuple[str, str]
mac
str
root
str
cert
str
update_cert_paths
bool
= False
save_cert_paths
No description documented yet.
hardware/lepro/lib/lepro/provision.py:96
No description documented yet.
save_cert_paths(mac: str, root: str, cert: str) -> None
mac
str
root
str
cert
str
prepare_cert_refetch
Re-send requestBond magic before WiFi/MQTT provision. On **stock** ZB1 v2.3.18: requestBond runs ota_state_machine_advance(0x14),…
hardware/lepro/lib/lepro/provision.py:102
Re-send requestBond magic before WiFi/MQTT provision. On **stock** ZB1 v2.3.18: requestBond runs ota_state_machine_advance(0x14), which bumps prov_mode (ota_ctx+8) to 3 ONLY when it is already 2 or 3. The CDN cert fetch at WiFi-up (state 0x2d) is gated on prov_mode in {2, 3}. prov_mode is decided at boot and is 1 (NORMAL) on an already-provisioned bulb, so requestBond cannot enable cert re-download on stock firmware without a pairing/factory reset. On **patched** firmware (`lepro-firmware patch`) this call is harmless but not required for cert refresh — the prov_mode gate NOP makes state 0x2d always fetch.
prepare_cert_refetch(session: LeproSession) -> None
session
LeproSession
build_wifi_mqtt_json
No description documented yet.
hardware/lepro/lib/lepro/provision.py:130
No description documented yet.
build_wifi_mqtt_json(ssid: str, password: str, domain: str = DEFAULT_DOMAIN, root: str = DEFAULT_ROOT, cert: str = DEFAULT_CERT, host: str = DEFAULT_HOST, port: str = DEFAULT_PORT, uid: str | None = None) -> str
ssid
str
password
str
domain
str
= DEFAULT_DOMAIN
root
str
= DEFAULT_ROOT
cert
str
= DEFAULT_CERT
host
str
= DEFAULT_HOST
port
str
= DEFAULT_PORT
uid
str | None
= None
_connect
No description documented yet.
hardware/lepro/lib/lepro/provision.py:155
No description documented yet.
_connect(mac: str, debug_rx: bool = False) -> tuple[BleakTransport, BleakClient]
mac
str
debug_rx
bool
= False
send_wifi_mqtt
No description documented yet.
hardware/lepro/lib/lepro/provision.py:170
No description documented yet.
send_wifi_mqtt(session: LeproSession, ssid: str, password: str, domain: str, root: str, cert: str, host: str, port: str, uid: str | None, dry_run: bool = False) -> None
session
LeproSession
ssid
str
password
str
domain
str
root
str
cert
str
host
str
port
str
uid
str | None
dry_run
bool
= False
cmd_provision
No description documented yet.
hardware/lepro/lib/lepro/provision.py:227
No description documented yet.
cmd_provision(args: argparse.Namespace) -> None
args
argparse.Namespace
cmd_provision_with_creds
No description documented yet.
hardware/lepro/lib/lepro/provision.py:276
No description documented yet.
cmd_provision_with_creds(session: LeproSession, creds: BondCredentials, args: argparse.Namespace) -> None
session
LeproSession
creds
BondCredentials
args
argparse.Namespace
_resolved_cert_paths
No description documented yet.
hardware/lepro/lib/lepro/provision.py:310
No description documented yet.
_resolved_cert_paths(args: argparse.Namespace, mac: str) -> tuple[str, str]
args
argparse.Namespace
mac
str
_add_cert_refresh_flags
No description documented yet.
hardware/lepro/lib/lepro/provision.py:321
No description documented yet.
_add_cert_refresh_flags(p: argparse.ArgumentParser) -> None
p
argparse.ArgumentParser
hardware/lepro/lib/lepro/session.py
1 symbols
bond_device
No description documented yet.
hardware/lepro/lib/lepro/session.py:401
No description documented yet.
bond_device(session: LeproSession, mac: str, force: bool = False) -> BondCredentials
session
LeproSession
mac
str
force
bool
= False
hardware/lepro/lib/lepro/tools/debug_hijack.py
10 symbols
_log
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:45
No description documented yet.
_log(hypothesis_id: str, location: str, message: str, data: dict, run_id: str) -> None
hypothesis_id
str
location
str
message
str
data
dict
run_id
str
_pem_der
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:62
No description documented yet.
_pem_der(path: Path) -> bytes
path
Path
_bundle_record_at
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:69
No description documented yet.
_bundle_record_at(fw: bytes, firmware_path: Path | None = None) -> tuple[object, bytes]
fw
bytes
firmware_path
Path | None
= None
_fetch_peer_der
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:81
No description documented yet.
_fetch_peer_der(host: str, port: int, connect_host: str | None = None) -> bytes
host
str
port
int
connect_host
str | None
= None
check_firmware_pin
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:93
No description documented yet.
check_firmware_pin(stock: Path, patched: Path | None, cert: Path) -> dict
stock
Path
patched
Path | None
cert
Path
analyze_pcap
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:155
No description documented yet.
analyze_pcap(pcap: Path) -> dict
pcap
Path
check_dns
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:238
No description documented yet.
check_dns(host: str) -> dict
host
str
probe_cdn
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:248
No description documented yet.
probe_cdn() -> dict
probe_mqtt_tls
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:295
No description documented yet.
probe_mqtt_tls() -> dict
main
No description documented yet.
hardware/lepro/lib/lepro/tools/debug_hijack.py:315
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/tools/decrypt_capture.py
3 symbols
_format_plaintext
No description documented yet.
hardware/lepro/lib/lepro/tools/decrypt_capture.py:41
No description documented yet.
_format_plaintext(opcode: int, plain: bytes) -> str
opcode
int
plain
bytes
decrypt_log
No description documented yet.
hardware/lepro/lib/lepro/tools/decrypt_capture.py:58
No description documented yet.
decrypt_log(path: Path, mac: str, session_filter: str | None = None, opcode_filter: int | None = None) -> None
path
Path
mac
str
session_filter
str | None
= None
opcode_filter
int | None
= None
main
No description documented yet.
hardware/lepro/lib/lepro/tools/decrypt_capture.py:109
No description documented yet.
main() -> None
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py
6 symbols
_align4
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:72
No description documented yet.
_align4(n: int) -> int
n
int
parse_esp_image
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:76
No description documented yet.
parse_esp_image(data: bytes) -> tuple[int, list[Segment]]
data
bytes
_build_shstrtab
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:100
No description documented yet.
_build_shstrtab(segments: list[Segment]) -> bytes
segments
list[Segment]
build_elf
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:108
No description documented yet.
build_elf(entry: int, segments: list[Segment]) -> bytes
entry
int
segments
list[Segment]
convert
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:220
No description documented yet.
convert(src: Path, dst: Path) -> None
src
Path
dst
Path
main
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:237
No description documented yet.
main(argv: list[str] | None = None) -> int
argv
list[str] | None
= None
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py
7 symbols
_spki_fp
No description documented yet.
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:60
No description documented yet.
_spki_fp(cert: x509.Certificate) -> str
cert
x509.Certificate
_cert_fp
No description documented yet.
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:68
No description documented yet.
_cert_fp(cert: x509.Certificate) -> str
cert
x509.Certificate
_name
No description documented yet.
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:72
No description documented yet.
_name(n: x509.Name) -> str
n
x509.Name
fetch_cdn_body
HTTPS GET of the provisioned root path — the bytes the bulb stores verbatim.
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:76
HTTPS GET of the provisioned root path — the bytes the bulb stores verbatim.
fetch_cdn_body(host: str, ip: str, root: str) -> bytes
host
str
ip
str
root
str
_dechunk
No description documented yet.
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:99
No description documented yet.
_dechunk(body: bytes) -> bytes
body
bytes
fetch_broker_chain
Pull the FULL cert chain the broker presents (leaf first). Python's ssl only exposes the leaf when verification fails (which is e…
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:114
Pull the FULL cert chain the broker presents (leaf first). Python's ssl only exposes the leaf when verification fails (which is exactly our case), so shell out to `openssl s_client -showcerts` to capture every certificate the server sends, regardless of trust.
fetch_broker_chain(host: str, ip: str, port: int) -> list[x509.Certificate]
host
str
ip
str
port
int
main
No description documented yet.
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py:153
No description documented yet.
main() -> int
hardware/lepro/lib/lepro/tools/replay.py
1 symbols
run
No description documented yet.
hardware/lepro/lib/lepro/tools/replay.py:70
No description documented yet.
run(target_mac: str | None)
target_mac
str | None
hardware/lepro/lib/lepro/tools/validate_ota_parser.py
3 symbols
simulate_parse
Walk the FUN_42008eb0 branch logic symbolically; return failing PC label.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:165
Walk the FUN_42008eb0 branch logic symbolically; return failing PC label.
simulate_parse(obj: dict[str, Any], ctx0: int = 1, running_version: str = '2.3.18') -> str
obj
dict[str, Any]
ctx0
int
= 1
running_version
str
= '2.3.18'
validate
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:225
No description documented yet.
validate(elf_path: Path) -> int
elf_path
Path
main
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:287
No description documented yet.
main() -> None
hardware/lepro/setup.py
1 symbols
main
No description documented yet.
hardware/lepro/setup.py:284
No description documented yet.
main() -> None
hardware/web/app.py
3 symbols
home
No description documented yet.
hardware/web/app.py:182
No description documented yet.
home(request: Request)
request
Request
dashboard
No description documented yet.
hardware/web/app.py:192
No description documented yet.
dashboard(request: Request)
request
Request
chat
No description documented yet.
hardware/web/app.py:207
No description documented yet.
chat(data: dict)
data
dict
interfaces/web/app.py
3 symbols
home
No description documented yet.
interfaces/web/app.py:183
No description documented yet.
home(request: Request)
request
Request
dashboard
No description documented yet.
interfaces/web/app.py:194
No description documented yet.
dashboard(request: Request)
request
Request
chat
No description documented yet.
interfaces/web/app.py:210
No description documented yet.
chat(data: dict)
data
dict
main.py
1 symbols
main
No description documented yet.
main.py:24
No description documented yet.
main()
memory/memory.py
1 symbols
remember
No description documented yet.
memory/memory.py:61
No description documented yet.
remember(self, user_id, content, category = 'general', importance = 5)
self
user_id
content
category
= 'general'
importance
= 5
memory/sqlite.py
3 symbols
connect
No description documented yet.
memory/sqlite.py:28
No description documented yet.
connect(db_path = None)
db_path
= None
ensure_schema
No description documented yet.
memory/sqlite.py:112
No description documented yet.
ensure_schema(conn)
conn
save_conversation
No description documented yet.
memory/sqlite.py:326
No description documented yet.
save_conversation(conn, user_id, role, message)
conn
user_id
role
message
test_refactor.py
8 symbols
test_intent_detection
No description documented yet.
test_refactor.py:12
No description documented yet.
test_intent_detection()
test_position_query
No description documented yet.
test_refactor.py:24
No description documented yet.
test_position_query()
test_list_query
No description documented yet.
test_refactor.py:36
No description documented yet.
test_list_query()
test_search_query_building
No description documented yet.
test_refactor.py:46
No description documented yet.
test_search_query_building()
test_filtering
No description documented yet.
test_refactor.py:58
No description documented yet.
test_filtering()
test_ranking
No description documented yet.
test_refactor.py:76
No description documented yet.
test_ranking()
test_fursuit_query
No description documented yet.
test_refactor.py:98
No description documented yet.
test_fursuit_query()
test_backward_compatibility
No description documented yet.
test_refactor.py:110
No description documented yet.
test_backward_compatibility()
tests/auto_promt_test.py
5 symbols
load_cyn_personality
No description documented yet.
tests/auto_promt_test.py:62
No description documented yet.
load_cyn_personality(files)
files
loading_animation
No description documented yet.
tests/auto_promt_test.py:116
No description documented yet.
loading_animation(stop_event, start_time)
stop_event
start_time
ask_model
No description documented yet.
tests/auto_promt_test.py:159
No description documented yet.
ask_model(user_prompt, system_prompt)
user_prompt
system_prompt
generate_tests
No description documented yet.
tests/auto_promt_test.py:323
No description documented yet.
generate_tests()
run_tests
No description documented yet.
tests/auto_promt_test.py:416
No description documented yet.
run_tests()
tests/test_memory_system.py
1 symbols
test_memory_system
Test memory manager and extractor.
tests/test_memory_system.py:18
Test memory manager and extractor.
test_memory_system()
tests/test_prompt_builder.py
1 symbols
test_build_prompt_minimal
No description documented yet.
tests/test_prompt_builder.py:4
No description documented yet.
test_build_prompt_minimal()
tests/verify_refactoring.py
9 symbols
test_prompt_manager
Test PromptManager basic functionality.
tests/verify_refactoring.py:18
Test PromptManager basic functionality.
test_prompt_manager()
test_cyn_personality_preserved
Test that Cyn's core personality is preserved.
tests/verify_refactoring.py:69
Test that Cyn's core personality is preserved.
test_cyn_personality_preserved()
test_key_features_present
Test that all key Cyn features are preserved.
tests/verify_refactoring.py:96
Test that all key Cyn features are preserved.
test_key_features_present()
test_examples_quality
Test that examples are well-formed and diverse.
tests/verify_refactoring.py:127
Test that examples are well-formed and diverse.
test_examples_quality()
test_no_major_duplicates
Test that major duplicates have been removed.
tests/verify_refactoring.py:151
Test that major duplicates have been removed.
test_no_major_duplicates()
test_backwards_compatibility
Test that legacy code still works.
tests/verify_refactoring.py:179
Test that legacy code still works.
test_backwards_compatibility()
test_context_reduction
Test that context usage has been reduced.
tests/verify_refactoring.py:207
Test that context usage has been reduced.
test_context_reduction()
test_mode_independence
Test that modes don't interfere with each other.
tests/verify_refactoring.py:238
Test that modes don't interfere with each other.
test_mode_independence()
run_all_tests
Run all verification tests.
tests/verify_refactoring.py:261
Run all verification tests.
run_all_tests()
tools/SmokeCounterTool.py
13 symbols
get_connection
Open the smoke-counter SQLite database.
tools/SmokeCounterTool.py:47
Open the smoke-counter SQLite database.
get_connection() -> sqlite3.Connection
init_db
Create the smoke-session table if it does not already exist.
tools/SmokeCounterTool.py:54
Create the smoke-session table if it does not already exist.
init_db() -> None
_row_to_session
Convert a SQLite row into the session structure used by CYN.
tools/SmokeCounterTool.py:71
Convert a SQLite row into the session structure used by CYN.
_row_to_session(row: sqlite3.Row) -> Dict[str, Any]
row
sqlite3.Row
migrate_json_once
Migrate the legacy smoking_log.json into SQLite once. The JSON file is never used as the active source of truth after migration.
tools/SmokeCounterTool.py:85
Migrate the legacy smoking_log.json into SQLite once. The JSON file is never used as the active source of truth after migration.
migrate_json_once() -> None
log_smoke
Log a smoking session into SQLite. Cigarettes: 1 cigarette = 0.5 units Other types: amount = units directly
tools/SmokeCounterTool.py:173
Log a smoking session into SQLite. Cigarettes: 1 cigarette = 0.5 units Other types: amount = units directly
log_smoke(smoke_type: str, amount: float = 1) -> Dict[str, Any]
smoke_type
str
amount
float
= 1
normalize_smoke_type
Normalize common aliases to canonical smoke types.
tools/SmokeCounterTool.py:278
Normalize common aliases to canonical smoke types.
normalize_smoke_type(value: Optional[str]) -> Optional[str]
value
Optional[str]
get_stats
Return smoking statistics directly from SQLite.
tools/SmokeCounterTool.py:310
Return smoking statistics directly from SQLite.
get_stats(smoke_type: Optional[str] = None, scope: str = 'all') -> Dict[str, Any]
smoke_type
Optional[str]
= None
scope
str
= 'all'
get_recent
Return the most recent smoking sessions from SQLite.
tools/SmokeCounterTool.py:443
Return the most recent smoking sessions from SQLite.
get_recent(limit: int = 10) -> Dict[str, Any]
limit
int
= 10
get_last
Return the most recently logged session.
tools/SmokeCounterTool.py:488
Return the most recently logged session.
get_last() -> Dict[str, Any]
reset_stats
Completely reset the smoking tracker. This deletes all rows from the SQLite smoke-session table.
tools/SmokeCounterTool.py:525
Completely reset the smoking tracker. This deletes all rows from the SQLite smoke-session table.
reset_stats() -> Dict[str, Any]
repair_aggregates
Return current database-derived statistics. Kept for compatibility with the old API. SQLite is already the source of truth, so no…
tools/SmokeCounterTool.py:556
Return current database-derived statistics. Kept for compatibility with the old API. SQLite is already the source of truth, so no aggregate repair is necessary.
repair_aggregates() -> Dict[str, Any]
smoke_counter_call
Convenience function for CYN's tool registry.
tools/SmokeCounterTool.py:716
Convenience function for CYN's tool registry.
smoke_counter_call(action: str = 'stats', smoke_type: Optional[str] = None, amount: float = 1, limit: int = 10, scope: str = 'all') -> Dict[str, Any]
action
str
= 'stats'
smoke_type
Optional[str]
= None
amount
float
= 1
limit
int
= 10
scope
str
= 'all'
repair_aggregates
Force-recompute and persist aggregate fields from sessions without changing sessions. Returns the reconciled data dict.
tools/SmokeCounterTool.py:741
Force-recompute and persist aggregate fields from sessions without changing sessions. Returns the reconciled data dict.
repair_aggregates() -> Dict[str, Any]
tools/web_search.py
11 symbols
contains_any
No description documented yet.
tools/web_search.py:424
No description documented yet.
contains_any(text: str, words: Iterable[str]) -> bool
text
str
words
Iterable[str]
dedupe_terms
No description documented yet.
tools/web_search.py:435
No description documented yet.
dedupe_terms(*groups: Iterable[str]) -> list[str]
*groups
Iterable[str]
extract_query_tokens
No description documented yet.
tools/web_search.py:456
No description documented yet.
extract_query_tokens(query: str) -> tuple[str, ...]
query
str
normalize_domain
No description documented yet.
tools/web_search.py:473
No description documented yet.
normalize_domain(href: str) -> str
href
str
detect_research_intent
No description documented yet.
tools/web_search.py:504
No description documented yet.
detect_research_intent(query: str) -> bool
query
str
detect_output_type
No description documented yet.
tools/web_search.py:531
No description documented yet.
detect_output_type(query: str) -> OutputMode
query
str
build_intent
No description documented yet.
tools/web_search.py:553
No description documented yet.
build_intent(query: str) -> SearchIntent
query
str
build_search_query
No description documented yet.
tools/web_search.py:817
No description documented yet.
build_search_query(intent: SearchIntent) -> str
intent
SearchIntent
classify_source
No description documented yet.
tools/web_search.py:1149
No description documented yet.
classify_source(href: str) -> str
href
str
fetch_page_text
Fetch the actual webpage and extract readable text. This is intentionally lightweight. Search snippets remain the fallback when a…
tools/web_search.py:1184
Fetch the actual webpage and extract readable text. This is intentionally lightweight. Search snippets remain the fallback when a page cannot be retrieved.
fetch_page_text(href: str, max_chars: int = 8000) -> str
href
str
max_chars
int
= 8000
extract_relevant_evidence
Pulls passages that appear relevant to the query. This is deliberately conservative. It does not invent summaries; it returns sou…
tools/web_search.py:1314
Pulls passages that appear relevant to the query. This is deliberately conservative. It does not invent summaries; it returns source text surrounding matching terms.
extract_relevant_evidence(text: str, query: str, max_chars: int = 3500) -> str
text
str
query
str
max_chars
int
= 3500
ai/chat_engine.py · ChatEngine
6 symbols
__init__
No description documented yet.
ai/chat_engine.py:50
No description documented yet.
__init__(self, ollama_client, prompt_builder, memory_store, tool_router, mode_manager, memory_manager: Optional[MemoryManager] = None, memory_extractor: Optional[MemoryExtractor] = None, context_manager = None, logger_obj = None)
self
ollama_client
prompt_builder
memory_store
tool_router
mode_manager
memory_manager
Optional[MemoryManager]
= None
memory_extractor
Optional[MemoryExtractor]
= None
context_manager
= None
logger_obj
= None
trim_context
No description documented yet.
ai/chat_engine.py:98
No description documented yet.
trim_context(self, text: str, limit: int) -> str
self
text
str
limit
int
_estimate_message_tokens
Roughly estimate tokens in an Ollama message. This is intentionally conservative. Actual tokenization is model-dependent, so the…
ai/chat_engine.py:116
Roughly estimate tokens in an Ollama message. This is intentionally conservative. Actual tokenization is model-dependent, so the final context budget keeps headroom.
_estimate_message_tokens(self, message) -> int
self
message
_trim_ollama_messages
Prevent Ollama requests from exceeding the available context. Priority: 1. System prompt 2. Current user message 3. Tool results…
ai/chat_engine.py:149
Prevent Ollama requests from exceeding the available context. Priority: 1. System prompt 2. Current user message 3. Tool results required for the current response 4. Newest conversation history 5. Older conversation history The current user message is never intentionally removed.
_trim_ollama_messages(self, messages, max_tokens: int = OLLAMA_PROMPT_BUDGET)
self
messages
max_tokens
int
= OLLAMA_PROMPT_BUDGET
_ollama_tools
No description documented yet.
ai/chat_engine.py:471
No description documented yet.
_ollama_tools(self, user_text: str = '')
self
user_text
str
= ''
handle_user_message
Process a user message. Flow: 1. Retrieve relevant context 2. Build Cyn prompt 3. Detect tools 4. Execute tools 5. Generate respo…
ai/chat_engine.py:501
Process a user message. Flow: 1. Retrieve relevant context 2. Build Cyn prompt 3. Detect tools 4. Execute tools 5. Generate response 6. Extract memories 7. Save conversation info
handle_user_message(self, user_id: str, text: str, mode: str = 'normal', personality: str = 'normal', request_id: Optional[str] = None) -> str
self
user_id
str
text
str
mode
str
= 'normal'
personality
str
= 'normal'
request_id
Optional[str]
= None
ai/context_manager.py · ContextManager
2 symbols
__init__
No description documented yet.
ai/context_manager.py:9
No description documented yet.
__init__(self, memory_store, knowledge_store)
self
memory_store
knowledge_store
build_context
No description documented yet.
ai/context_manager.py:27
No description documented yet.
build_context(self, user_id, user_message)
self
user_id
user_message
ai/knowledge/store.py · KnowledgeStore
4 symbols
__init__
No description documented yet.
ai/knowledge/store.py:7
No description documented yet.
__init__(self, conn)
self
conn
add
No description documented yet.
ai/knowledge/store.py:20
No description documented yet.
add(self, content, title = '', category = 'general', importance = 5, tags = None)
self
content
title
= ''
category
= 'general'
importance
= 5
tags
= None
search
No description documented yet.
ai/knowledge/store.py:68
No description documented yet.
search(self, query, limit = 5)
self
query
limit
= 5
recent
No description documented yet.
ai/knowledge/store.py:156
No description documented yet.
recent(self, limit = 10)
self
limit
= 10
ai/memory_system/extractor.py · MemoryExtractor
10 symbols
__init__
No description documented yet.
ai/memory_system/extractor.py:30
No description documented yet.
__init__(self, memory_store)
self
memory_store
extract_and_save
No description documented yet.
ai/memory_system/extractor.py:49
No description documented yet.
extract_and_save(self, user_id: str, user_message: str, assistant_response: str = '') -> List[int]
self
user_id
str
user_message
str
assistant_response
str
= ''
extract_preferences
No description documented yet.
ai/memory_system/extractor.py:292
No description documented yet.
extract_preferences(self, text)
self
text
extract_goals
No description documented yet.
ai/memory_system/extractor.py:328
No description documented yet.
extract_goals(self, text)
self
text
extract_projects
No description documented yet.
ai/memory_system/extractor.py:365
No description documented yet.
extract_projects(self, text)
self
text
extract_names
No description documented yet.
ai/memory_system/extractor.py:402
No description documented yet.
extract_names(self, text)
self
text
extract_style
No description documented yet.
ai/memory_system/extractor.py:442
No description documented yet.
extract_style(self, text)
self
text
match_patterns
No description documented yet.
ai/memory_system/extractor.py:488
No description documented yet.
match_patterns(self, patterns, text, prefix)
self
patterns
text
prefix
meaningful
No description documented yet.
ai/memory_system/extractor.py:548
No description documented yet.
meaningful(self, text)
self
text
should_save
No description documented yet.
ai/memory_system/extractor.py:577
No description documented yet.
should_save(self, content)
self
content
ai/memory_system/manager.py · MemoryManager
9 symbols
__init__
No description documented yet.
ai/memory_system/manager.py:24
No description documented yet.
__init__(self, conn)
self
conn
remember
No description documented yet.
ai/memory_system/manager.py:62
No description documented yet.
remember(self, user_id, content, category = 'general', importance = 5)
self
user_id
content
category
= 'general'
importance
= 5
recall
No description documented yet.
ai/memory_system/manager.py:160
No description documented yet.
recall(self, user_id, limit = 5, min_importance = 1, categories = None)
self
user_id
limit
= 5
min_importance
= 1
categories
= None
search
No description documented yet.
ai/memory_system/manager.py:265
No description documented yet.
search(self, user_id, query, limit = 5)
self
user_id
query
limit
= 5
get_all_memories
No description documented yet.
ai/memory_system/manager.py:368
No description documented yet.
get_all_memories(self, user_id)
self
user_id
recent
No description documented yet.
ai/memory_system/manager.py:424
No description documented yet.
recent(self, limit = 10)
self
limit
= 10
delete_memory
No description documented yet.
ai/memory_system/manager.py:472
No description documented yet.
delete_memory(self, memory_id)
self
memory_id
update_memory
No description documented yet.
ai/memory_system/manager.py:522
No description documented yet.
update_memory(self, memory_id, importance = None, content = None)
self
memory_id
importance
= None
content
= None
format_for_prompt
No description documented yet.
ai/memory_system/manager.py:598
No description documented yet.
format_for_prompt(self, memories)
self
memories
ai/mode_manager.py · ModeSpec
1 symbols
__init__
No description documented yet.
ai/mode_manager.py:9
No description documented yet.
__init__(self, name: str, allowed_tools: List[str] = None, instruction_fragment: str = '')
self
name
str
allowed_tools
List[str]
= None
instruction_fragment
str
= ''
ai/mode_manager.py · ModeManager
4 symbols
__init__
No description documented yet.
ai/mode_manager.py:21
No description documented yet.
__init__(self)
self
_init_default_modes
No description documented yet.
ai/mode_manager.py:25
No description documented yet.
_init_default_modes(self)
self
get_mode
No description documented yet.
ai/mode_manager.py:100
No description documented yet.
get_mode(self, name: str) -> ModeSpec
self
name
str
allowed_tools_for
No description documented yet.
ai/mode_manager.py:106
No description documented yet.
allowed_tools_for(self, name: str)
self
name
str
ai/ollama_client.py · OllamaClient
4 symbols
__init__
No description documented yet.
ai/ollama_client.py:20
No description documented yet.
__init__(self, base_url: str = 'http://localhost:11434', model: str = 'cyn-x:latest', timeout: int = 600)
self
base_url
str
= 'http://localhost:11434'
model
str
= 'cyn-x:latest'
timeout
int
= 600
generate
No description documented yet.
ai/ollama_client.py:30
No description documented yet.
generate(self, prompt: str, max_tokens: int = 512, stream: bool = False, **kwargs) -> Dict[str, Any]
self
prompt
str
max_tokens
int
= 512
stream
bool
= False
**kwargs
chat
Call Ollama's chat endpoint with optional tools.
ai/ollama_client.py:102
Call Ollama's chat endpoint with optional tools.
chat(self, messages: List[Dict[str, Any]], tools: Optional[List[Dict[str, Any]]] = None, stream: bool = False, **kwargs) -> Dict[str, Any]
self
messages
List[Dict[str, Any]]
tools
Optional[List[Dict[str, Any]]]
= None
stream
bool
= False
**kwargs
generate_stream
No description documented yet.
ai/ollama_client.py:304
No description documented yet.
generate_stream(self, prompt: str, max_tokens: int = 512, **kwargs) -> Generator[str, None, None]
self
prompt
str
max_tokens
int
= 512
**kwargs
ai/prompt_builder.py · PromptBuilder
12 symbols
__init__
No description documented yet.
ai/prompt_builder.py:226
No description documented yet.
__init__(self, templates_dir: Optional[str] = None)
self
templates_dir
Optional[str]
= None
normalize_prompt_layers
No description documented yet.
ai/prompt_builder.py:244
No description documented yet.
normalize_prompt_layers(self, prompt_layers: Optional[Dict[str, bool]] = None) -> Dict[str, bool]
self
prompt_layers
Optional[Dict[str, bool]]
= None
set_prompt_layers
No description documented yet.
ai/prompt_builder.py:266
No description documented yet.
set_prompt_layers(self, prompt_layers: Optional[Dict[str, bool]] = None) -> Dict[str, bool]
self
prompt_layers
Optional[Dict[str, bool]]
= None
get_prompt_layers
No description documented yet.
ai/prompt_builder.py:282
No description documented yet.
get_prompt_layers(self) -> Dict[str, bool]
self
apply_prompt_preset
No description documented yet.
ai/prompt_builder.py:291
No description documented yet.
apply_prompt_preset(self, preset: str) -> Dict[str, bool]
self
preset
str
trim_context
No description documented yet.
ai/prompt_builder.py:311
No description documented yet.
trim_context(self, text: str, limit: int) -> str
self
text
str
limit
int
should_include_context
No description documented yet.
ai/prompt_builder.py:339
No description documented yet.
should_include_context(self, text: str) -> bool
self
text
str
score_context
No description documented yet.
ai/prompt_builder.py:360
No description documented yet.
score_context(self, chunk: str, query: str) -> int
self
chunk
str
query
str
select_context
No description documented yet.
ai/prompt_builder.py:397
No description documented yet.
select_context(self, chunks: List[str], query: str, limit: int) -> str
self
chunks
List[str]
query
str
limit
int
build_system_prompt
No description documented yet.
ai/prompt_builder.py:472
No description documented yet.
build_system_prompt(self, modes: Optional[List[str]] = None, memory: str = '', context: str = '', prompt_layers: Optional[Dict[str, bool]] = None) -> str
self
modes
Optional[List[str]]
= None
memory
str
= ''
context
str
= ''
prompt_layers
Optional[Dict[str, bool]]
= None
budget_context
No description documented yet.
ai/prompt_builder.py:551
No description documented yet.
budget_context(self, sections: List[Dict[str, Any]]) -> List[str]
self
sections
List[Dict[str, Any]]
build_prompt
No description documented yet.
ai/prompt_builder.py:688
No description documented yet.
build_prompt(self, user_input: str, mode_fragment: str = '', personality_fragment: str = '', history: Optional[List[dict]] = None, memory_summary: str = '', knowledge_context: str = '', tools_spec: str = '', intent: str = '', conversation_summary: str = '', prompt_layers: Optional[Dict[str, bool]] = None) -> str
self
user_input
str
mode_fragment
str
= ''
personality_fragment
str
= ''
history
Optional[List[dict]]
= None
memory_summary
str
= ''
knowledge_context
str
= ''
tools_spec
str
= ''
intent
str
= ''
conversation_summary
str
= ''
prompt_layers
Optional[Dict[str, bool]]
= None
ai/prompt_manager.py · PromptManager
10 symbols
__init__
No description documented yet.
ai/prompt_manager.py:97
No description documented yet.
__init__(self, prompts_dir: Optional[str] = None)
self
prompts_dir
Optional[str]
= None
normalize_prompt_layers
No description documented yet.
ai/prompt_manager.py:151
No description documented yet.
normalize_prompt_layers(self, enabled_layers = None)
self
enabled_layers
= None
_load_file
No description documented yet.
ai/prompt_manager.py:182
No description documented yet.
_load_file(self, path: Path)
self
path
Path
trim_text
No description documented yet.
ai/prompt_manager.py:220
No description documented yet.
trim_text(self, text, limit)
self
text
limit
load_core_prompts
No description documented yet.
ai/prompt_manager.py:254
No description documented yet.
load_core_prompts(self)
self
load_personality_matrix
No description documented yet.
ai/prompt_manager.py:364
No description documented yet.
load_personality_matrix(self)
self
load_optional
No description documented yet.
ai/prompt_manager.py:408
No description documented yet.
load_optional(self, name)
self
name
load_option
No description documented yet.
ai/prompt_manager.py:441
No description documented yet.
load_option(self, name)
self
name
load_mode
No description documented yet.
ai/prompt_manager.py:474
No description documented yet.
load_mode(self, mode_name)
self
mode_name
build_system_prompt
No description documented yet.
ai/prompt_manager.py:519
No description documented yet.
build_system_prompt(self, active_modes = None, active_options = None, memory_summary = '', additional_context = '', include_safety = True, enabled_layers = None)
self
active_modes
= None
active_options
= None
memory_summary
= ''
additional_context
= ''
include_safety
= True
enabled_layers
= None
ai/terminal_ui/renderer.py · CYNXTerminal
22 symbols
__init__
No description documented yet.
ai/terminal_ui/renderer.py:31
No description documented yet.
__init__(self)
self
_print_label
No description documented yet.
ai/terminal_ui/renderer.py:40
No description documented yet.
_print_label(self, label, value = None, style, value_style = 'white')
self
label
value
= None
style
value_style
= 'white'
section
No description documented yet.
ai/terminal_ui/renderer.py:48
No description documented yet.
section(self, title)
self
title
info
No description documented yet.
ai/terminal_ui/renderer.py:51
No description documented yet.
info(self, message)
self
message
memory
No description documented yet.
ai/terminal_ui/renderer.py:54
No description documented yet.
memory(self, message)
self
message
warning
No description documented yet.
ai/terminal_ui/renderer.py:57
No description documented yet.
warning(self, message)
self
message
error
No description documented yet.
ai/terminal_ui/renderer.py:60
No description documented yet.
error(self, message)
self
message
dim
No description documented yet.
ai/terminal_ui/renderer.py:63
No description documented yet.
dim(self, message)
self
message
user
No description documented yet.
ai/terminal_ui/renderer.py:66
No description documented yet.
user(self, message)
self
message
ollama
No description documented yet.
ai/terminal_ui/renderer.py:69
No description documented yet.
ollama(self, label = 'OLLAMA CALL', value = None)
self
label
= 'OLLAMA CALL'
value
= None
model
No description documented yet.
ai/terminal_ui/renderer.py:72
No description documented yet.
model(self, label = 'MODEL RESPONSE', value = None)
self
label
= 'MODEL RESPONSE'
value
= None
tool
No description documented yet.
ai/terminal_ui/renderer.py:75
No description documented yet.
tool(self, label = 'TOOL CALL', value = None)
self
label
= 'TOOL CALL'
value
= None
tool_args
No description documented yet.
ai/terminal_ui/renderer.py:78
No description documented yet.
tool_args(self, label = 'TOOL ARGUMENTS', value = None)
self
label
= 'TOOL ARGUMENTS'
value
= None
execute
No description documented yet.
ai/terminal_ui/renderer.py:81
No description documented yet.
execute(self, label = 'EXECUTING TOOL', value = None)
self
label
= 'EXECUTING TOOL'
value
= None
result
No description documented yet.
ai/terminal_ui/renderer.py:84
No description documented yet.
result(self, label = 'TOOL RESULT', value = None)
self
label
= 'TOOL RESULT'
value
= None
prompt
No description documented yet.
ai/terminal_ui/renderer.py:87
No description documented yet.
prompt(self, label = 'PROMPT SECTION', value = None)
self
label
= 'PROMPT SECTION'
value
= None
final_prompt
No description documented yet.
ai/terminal_ui/renderer.py:90
No description documented yet.
final_prompt(self, label = 'FINAL SYSTEM PROMPT', value = None)
self
label
= 'FINAL SYSTEM PROMPT'
value
= None
available_tools
No description documented yet.
ai/terminal_ui/renderer.py:93
No description documented yet.
available_tools(self, tools)
self
tools
json
No description documented yet.
ai/terminal_ui/renderer.py:96
No description documented yet.
json(self, payload)
self
payload
timing
No description documented yet.
ai/terminal_ui/renderer.py:102
No description documented yet.
timing(self, message)
self
message
memory_error
No description documented yet.
ai/terminal_ui/renderer.py:105
No description documented yet.
memory_error(self, message)
self
message
blank
No description documented yet.
ai/terminal_ui/renderer.py:108
No description documented yet.
blank(self)
self
barkly_docs.py · FunctionInfo
2 symbols
qualified_name
No description documented yet.
barkly_docs.py:146
No description documented yet.
qualified_name(self) -> str
self
signature
No description documented yet.
barkly_docs.py:152
No description documented yet.
signature(self) -> str
self
barkly_docs.py · EndpointInfo
1 symbols
method_text
No description documented yet.
barkly_docs.py:202
No description documented yet.
method_text(self) -> str
self
barkly_docs.py · PythonScanner
7 symbols
__init__
No description documented yet.
barkly_docs.py:592
No description documented yet.
__init__(self, root: Path)
self
root
Path
scan
No description documented yet.
barkly_docs.py:600
No description documented yet.
scan(self) -> None
self
scan_file
No description documented yet.
barkly_docs.py:607
No description documented yet.
scan_file(self, path: Path) -> None
self
path
Path
function_node_for_class_method
No description documented yet.
barkly_docs.py:665
No description documented yet.
function_node_for_class_method(self, class_node: ast.ClassDef, method_name: str) -> Optional[ast.FunctionDef | ast.AsyncFunctionDef]
self
class_node
ast.ClassDef
method_name
str
make_function
No description documented yet.
barkly_docs.py:680
No description documented yet.
make_function(self, node: ast.FunctionDef | ast.AsyncFunctionDef, file: str, class_name: str = '') -> FunctionInfo
self
node
ast.FunctionDef | ast.AsyncFunctionDef
file
str
class_name
str
= ''
make_class
No description documented yet.
barkly_docs.py:699
No description documented yet.
make_class(self, node: ast.ClassDef, file: str) -> ClassInfo
self
node
ast.ClassDef
file
str
find_endpoints
No description documented yet.
barkly_docs.py:729
No description documented yet.
find_endpoints(self, node: Optional[ast.FunctionDef | ast.AsyncFunctionDef], file: str) -> None
self
node
Optional[ast.FunctionDef | ast.AsyncFunctionDef]
file
str
benchmark/cleaner.py · BenchmarkCleaner
8 symbols
__init__
No description documented yet.
benchmark/cleaner.py:99
No description documented yet.
__init__(self, execute: bool = False, remove_temp: bool = False)
self
execute
bool
= False
remove_temp
bool
= False
show_delete
No description documented yet.
benchmark/cleaner.py:116
No description documented yet.
show_delete(self, path: Path)
self
path
Path
is_protected
No description documented yet.
benchmark/cleaner.py:150
No description documented yet.
is_protected(self, path: Path) -> bool
self
path
Path
clean_results
No description documented yet.
benchmark/cleaner.py:210
No description documented yet.
clean_results(self)
self
clean_temp_files
No description documented yet.
benchmark/cleaner.py:255
No description documented yet.
clean_temp_files(self)
self
clean_empty_directories
No description documented yet.
benchmark/cleaner.py:304
No description documented yet.
clean_empty_directories(self)
self
print_protected_info
No description documented yet.
benchmark/cleaner.py:361
No description documented yet.
print_protected_info(self)
self
summary
No description documented yet.
benchmark/cleaner.py:393
No description documented yet.
summary(self)
self
benchmark/runner.py · BenchmarkStorage
5 symbols
__init__
No description documented yet.
benchmark/runner.py:754
No description documented yet.
__init__(self)
self
save_test
No description documented yet.
benchmark/runner.py:775
No description documented yet.
save_test(self, result)
self
result
add
No description documented yet.
benchmark/runner.py:950
No description documented yet.
add(self, result)
self
result
save_raw
No description documented yet.
benchmark/runner.py:967
No description documented yet.
save_raw(self)
self
save_summary
No description documented yet.
benchmark/runner.py:1034
No description documented yet.
save_summary(self)
self
hardware/lepro/config.py · LeproConfig
6 symbols
__init__
No description documented yet.
hardware/lepro/config.py:11
No description documented yet.
__init__(self, path: Path) -> None
self
path
Path
load
No description documented yet.
hardware/lepro/config.py:14
No description documented yet.
load(self) -> dict[str, Any]
self
save
No description documented yet.
hardware/lepro/config.py:31
No description documented yet.
save(self, data: dict[str, Any]) -> None
self
data
dict[str, Any]
add_device
No description documented yet.
hardware/lepro/config.py:42
No description documented yet.
add_device(self, name: str, mac: str, device_type: str = 'lepro', discovered_name: str | None = None) -> dict[str, Any]
self
name
str
mac
str
device_type
str
= 'lepro'
discovered_name
str | None
= None
get_device
No description documented yet.
hardware/lepro/config.py:68
No description documented yet.
get_device(self, name: str) -> dict[str, Any] | None
self
name
str
list_devices
No description documented yet.
hardware/lepro/config.py:75
No description documented yet.
list_devices(self) -> list[dict[str, Any]]
self
hardware/lepro/devices.py · LeproDevice
11 symbols
__init__
No description documented yet.
hardware/lepro/devices.py:29
No description documented yet.
__init__(self, name: str, mac: str)
self
name
str
mac
str
has_credentials
Return True if this device has been bonded.
hardware/lepro/devices.py:37
Return True if this device has been bonded.
has_credentials(self) -> bool
self
credential_path
Return the path where Lepro stores this device's credentials.
hardware/lepro/devices.py:41
Return the path where Lepro stores this device's credentials.
credential_path(self)
self
connect
Connect to the physical Lepro device.
hardware/lepro/devices.py:49
Connect to the physical Lepro device.
connect(self)
self
bond
Bond this device with CYN-X.
hardware/lepro/devices.py:57
Bond this device with CYN-X.
bond(self, force: bool = False) -> Any
self
force
bool
= False
_run_control
Send a datapoint control payload to the device.
hardware/lepro/devices.py:80
Send a datapoint control payload to the device.
_run_control(self, payload: dict[str, Any] | list[str]) -> Any
self
payload
dict[str, Any] | list[str]
turn_on
Turn the light on.
hardware/lepro/devices.py:114
Turn the light on.
turn_on(self, brightness: int = 1000) -> Any
self
brightness
int
= 1000
turn_off
Turn the light off.
hardware/lepro/devices.py:126
Turn the light off.
turn_off(self) -> Any
self
set_color_rgb
Set the light color using RGB values.
hardware/lepro/devices.py:137
Set the light color using RGB values.
set_color_rgb(self, red: int, green: int, blue: int, brightness: int = 1000) -> Any
self
red
int
green
int
blue
int
brightness
int
= 1000
set_color_hsv
Set the light color using HSV values.
hardware/lepro/devices.py:155
Set the light color using HSV values.
set_color_hsv(self, hue: float, saturation: int = 1000, value: int = 1000, brightness: int = 1000) -> Any
self
hue
float
saturation
int
= 1000
value
int
= 1000
brightness
int
= 1000
get_status
Query the current datapoint state of the light. This uses the upstream Lepro protocol directly without modifying the upstream lib…
hardware/lepro/devices.py:177
Query the current datapoint state of the light. This uses the upstream Lepro protocol directly without modifying the upstream library.
get_status(self) -> dict[str, Any]
self
hardware/lepro/discovery.py · LeproDiscovery
2 symbols
__init__
No description documented yet.
hardware/lepro/discovery.py:12
No description documented yet.
__init__(self, timeout: float = 15.0)
self
timeout
float
= 15.0
scan
No description documented yet.
hardware/lepro/discovery.py:18
No description documented yet.
scan(self) -> list[dict[str, Any]]
self
hardware/lepro/lib/lepro/bond.py · BondTokens
3 symbols
validate
No description documented yet.
hardware/lepro/lib/lepro/bond.py:50
No description documented yet.
validate(self) -> None
self
to_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:57
No description documented yet.
to_dict(self) -> dict[str, str]
self
from_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:61
No description documented yet.
from_dict(cls, d: dict[str, str]) -> BondTokens
cls
d
dict[str, str]
hardware/lepro/lib/lepro/bond.py · BondCredentials
3 symbols
__post_init__
No description documented yet.
hardware/lepro/lib/lepro/bond.py:78
No description documented yet.
__post_init__(self) -> None
self
to_json_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:83
No description documented yet.
to_json_dict(self) -> dict
self
from_json_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:92
No description documented yet.
from_json_dict(cls, d: dict) -> BondCredentials
cls
d
dict
hardware/lepro/lib/lepro/firmware_profile.py · PatchProfiles
1 symbols
by_id
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:53
No description documented yet.
by_id(self, profile_id: str) -> FirmwareProfile
self
profile_id
str
hardware/lepro/lib/lepro/frame.py · RxAssembler
8 symbols
__init__
No description documented yet.
hardware/lepro/lib/lepro/frame.py:76
No description documented yet.
__init__(self, mac: str, session_rand: int | None = None) -> None
self
mac
str
session_rand
int | None
= None
set_session_rand
Update key after 0x1000 hello reveals bleInit rand() in ctx1.
hardware/lepro/lib/lepro/frame.py:90
Update key after 0x1000 hello reveals bleInit rand() in ctx1.
set_session_rand(self, session_rand: int) -> None
self
session_rand
int
feed
No description documented yet.
hardware/lepro/lib/lepro/frame.py:95
No description documented yet.
feed(self, raw: bytes) -> list[DecryptedFrame]
self
raw
bytes
_reset_fragment
No description documented yet.
hardware/lepro/lib/lepro/frame.py:111
No description documented yet.
_reset_fragment(self) -> None
self
_feed_fragment
No description documented yet.
hardware/lepro/lib/lepro/frame.py:116
No description documented yet.
_feed_fragment(self, raw: bytes, magic2: int) -> list[DecryptedFrame]
self
raw
bytes
magic2
int
_dispatch_single
No description documented yet.
hardware/lepro/lib/lepro/frame.py:176
No description documented yet.
_dispatch_single(self, raw: bytes) -> list[DecryptedFrame]
self
raw
bytes
_maybe_decrypt
No description documented yet.
hardware/lepro/lib/lepro/frame.py:188
No description documented yet.
_maybe_decrypt(self, frame: DecryptedFrame) -> DecryptedFrame
self
frame
DecryptedFrame
_synthetic_body
No description documented yet.
hardware/lepro/lib/lepro/frame.py:206
No description documented yet.
_synthetic_body(seq: int, magic2: int, ptype: int, subtype: int, payload: bytes) -> bytes
seq
int
magic2
int
ptype
int
subtype
int
payload
bytes
hardware/lepro/lib/lepro/ota.py · OtaTransferResult
2 symbols
finalize_code
No description documented yet.
hardware/lepro/lib/lepro/ota.py:113
No description documented yet.
finalize_code(self) -> int | None
self
transfer_complete
No description documented yet.
hardware/lepro/lib/lepro/ota.py:117
No description documented yet.
transfer_complete(self) -> bool
self
hardware/lepro/lib/lepro/ota.py · OtaLog
3 symbols
info
No description documented yet.
hardware/lepro/lib/lepro/ota.py:138
No description documented yet.
info(self, msg: str) -> None
self
msg
str
phase
No description documented yet.
hardware/lepro/lib/lepro/ota.py:144
No description documented yet.
phase(self, name: str) -> None
self
name
str
wait
No description documented yet.
hardware/lepro/lib/lepro/ota.py:147
No description documented yet.
wait(self, msg: str, timeout: float) -> None
self
msg
str
timeout
float
hardware/lepro/lib/lepro/ota.py · OtaTransport
2 symbols
on_notify
No description documented yet.
hardware/lepro/lib/lepro/ota.py:159
No description documented yet.
on_notify(self, _sender: object, data: bytearray) -> None
self
_sender
object
data
bytearray
send
No description documented yet.
hardware/lepro/lib/lepro/ota.py:165
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
hardware/lepro/lib/lepro/ota.py · BleOtaSession
2 symbols
__init__
No description documented yet.
hardware/lepro/lib/lepro/ota.py:954
No description documented yet.
__init__(self, session: LeproSession, firmware: Path, image: bytes, log: OtaLog) -> None
self
session
LeproSession
firmware
Path
image
bytes
log
OtaLog
run
No description documented yet.
hardware/lepro/lib/lepro/ota.py:966
No description documented yet.
run(self, json_bytes: bytes, chunk_size: int = 4096, max_retries: int = 3, dry_run: bool = False) -> OtaTransferResult
self
json_bytes
bytes
chunk_size
int
= 4096
max_retries
int
= 3
dry_run
bool
= False
hardware/lepro/lib/lepro/patch_cdn.py · BundleLayout
1 symbols
record_len
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:78
No description documented yet.
record_len(self) -> int
self
hardware/lepro/lib/lepro/session.py · DeviceInfo
3 symbols
prov_state
OTA/provisioning state-machine value (device-info byte[1] = ota_ctx+0x10).
hardware/lepro/lib/lepro/session.py:71
OTA/provisioning state-machine value (device-info byte[1] = ota_ctx+0x10).
prov_state(self) -> int | None
self
prov_slot
Retained provisioning flag (device-info byte[2], from ota_ctx slot 0x42000b3c). Verified in ZB1 v2.3.18 build_device_info_reply:…
hardware/lepro/lib/lepro/session.py:76
Retained provisioning flag (device-info byte[2], from ota_ctx slot 0x42000b3c). Verified in ZB1 v2.3.18 build_device_info_reply: 6 = addable/onboarding (slot unset or factory), 7 = provisioned. NOTE: a power-cycle reset re-enters onboarding via the reboot counter WITHOUT clearing this slot, so a 7 here does NOT prove the CDN cert fetch is disabled — it is only conclusive when 6.
prov_slot(self) -> int | None
self
provisioning_summary
One-line human-readable provisioning/cert-fetch status for CLI output.
hardware/lepro/lib/lepro/session.py:87
One-line human-readable provisioning/cert-fetch status for CLI output.
provisioning_summary(self) -> str
self
hardware/lepro/lib/lepro/session.py · Transport
3 symbols
send
No description documented yet.
hardware/lepro/lib/lepro/session.py:105
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
recv
No description documented yet.
hardware/lepro/lib/lepro/session.py:106
No description documented yet.
recv(self, timeout: float) -> bytes | None
self
timeout
float
drain
No description documented yet.
hardware/lepro/lib/lepro/session.py:107
No description documented yet.
drain(self, timeout: float) -> list[bytes]
self
timeout
float
hardware/lepro/lib/lepro/session.py · DryRunTransport
3 symbols
send
No description documented yet.
hardware/lepro/lib/lepro/session.py:116
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
recv
No description documented yet.
hardware/lepro/lib/lepro/session.py:119
No description documented yet.
recv(self, timeout: float) -> bytes | None
self
timeout
float
drain
No description documented yet.
hardware/lepro/lib/lepro/session.py:122
No description documented yet.
drain(self, timeout: float) -> list[bytes]
self
timeout
float
hardware/lepro/lib/lepro/session.py · BleakTransport
4 symbols
on_notify
No description documented yet.
hardware/lepro/lib/lepro/session.py:134
No description documented yet.
on_notify(self, _sender: object, data: bytearray) -> None
self
_sender
object
data
bytearray
send
No description documented yet.
hardware/lepro/lib/lepro/session.py:140
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
recv
No description documented yet.
hardware/lepro/lib/lepro/session.py:145
No description documented yet.
recv(self, timeout: float) -> bytes | None
self
timeout
float
drain
No description documented yet.
hardware/lepro/lib/lepro/session.py:151
No description documented yet.
drain(self, timeout: float) -> list[bytes]
self
timeout
float
hardware/lepro/lib/lepro/session.py · LeproSession
18 symbols
__init__
No description documented yet.
hardware/lepro/lib/lepro/session.py:167
No description documented yet.
__init__(self, mac: str, transport: Transport, config: SessionConfig | None = None) -> None
self
mac
str
transport
Transport
config
SessionConfig | None
= None
_require_session_rand
No description documented yet.
hardware/lepro/lib/lepro/session.py:183
No description documented yet.
_require_session_rand(self) -> int
self
_send
No description documented yet.
hardware/lepro/lib/lepro/session.py:188
No description documented yet.
_send(self, pkt: bytes, label: str = '') -> None
self
pkt
bytes
label
str
= ''
_next_seq
No description documented yet.
hardware/lepro/lib/lepro/session.py:192
No description documented yet.
_next_seq(self) -> int
self
_ingest_rx
No description documented yet.
hardware/lepro/lib/lepro/session.py:197
No description documented yet.
_ingest_rx(self, raw: bytes) -> list[DecryptedFrame]
self
raw
bytes
_wait_opcode
No description documented yet.
hardware/lepro/lib/lepro/session.py:203
No description documented yet.
_wait_opcode(self, opcode: int, timeout: float | None = None) -> DecryptedFrame
self
opcode
int
timeout
float | None
= None
_wait_any
No description documented yet.
hardware/lepro/lib/lepro/session.py:217
No description documented yet.
_wait_any(self, opcodes: set[int], timeout: float) -> DecryptedFrame
self
opcodes
set[int]
timeout
float
run_phase_discovery
No description documented yet.
hardware/lepro/lib/lepro/session.py:231
No description documented yet.
run_phase_discovery(self) -> DeviceInfo
self
_wait_new_auth_resp
No description documented yet.
hardware/lepro/lib/lepro/session.py:269
No description documented yet.
_wait_new_auth_resp(self, after_count: int, timeout: float) -> DecryptedFrame
self
after_count
int
timeout
float
_request_bond
No description documented yet.
hardware/lepro/lib/lepro/session.py:285
No description documented yet.
_request_bond(self, payload: bytes, label: str) -> DecryptedFrame
self
payload
bytes
label
str
run_phase_bond
No description documented yet.
hardware/lepro/lib/lepro/session.py:290
No description documented yet.
run_phase_bond(self, fallback_hs: bytes | None = None) -> BondTokens
self
fallback_hs
bytes | None
= None
_wait_auth_resp
No description documented yet.
hardware/lepro/lib/lepro/session.py:321
No description documented yet.
_wait_auth_resp(self, timeout: float | None = None) -> DecryptedFrame
self
timeout
float | None
= None
run_phase_auth
No description documented yet.
hardware/lepro/lib/lepro/session.py:324
No description documented yet.
run_phase_auth(self, creds: BondCredentials) -> None
self
creds
BondCredentials
send_dp_ciphertext
No description documented yet.
hardware/lepro/lib/lepro/session.py:339
No description documented yet.
send_dp_ciphertext(self, ciphertext: bytes) -> None
self
ciphertext
bytes
send_dp_payload
No description documented yet.
hardware/lepro/lib/lepro/session.py:345
No description documented yet.
send_dp_payload(self, payload: DpPayload) -> None
self
payload
DpPayload
send_get_dp_state
No description documented yet.
hardware/lepro/lib/lepro/session.py:353
No description documented yet.
send_get_dp_state(self, payload: DpPayload) -> DecryptedFrame
self
payload
DpPayload
commit_control
No description documented yet.
hardware/lepro/lib/lepro/session.py:360
No description documented yet.
commit_control(self, creds: BondCredentials) -> None
self
creds
BondCredentials
run_control
Full control session. pre_bulk_pages is only for large scene uploads (capture 11:17 colour).
hardware/lepro/lib/lepro/session.py:379
Full control session. pre_bulk_pages is only for large scene uploads (capture 11:17 colour).
run_control(self, creds: BondCredentials, dp_payload: DpPayload, pre_bulk_pages: list[bytes] | None = None) -> None
self
creds
BondCredentials
dp_payload
DpPayload
pre_bulk_pages
list[bytes] | None
= None
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py · Segment
2 symbols
p_flags
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:48
No description documented yet.
p_flags(self) -> int
self
sh_flags
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:63
No description documented yet.
sh_flags(self) -> int
self
hardware/lepro/lib/lepro/tools/validate_ota_parser.py · Elf32
5 symbols
__init__
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:123
No description documented yet.
__init__(self, data: bytes) -> None
self
data
bytes
u32
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:131
No description documented yet.
u32(self, off: int) -> int
self
off
int
vma_to_offset
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:134
No description documented yet.
vma_to_offset(self, vma: int) -> int | None
self
vma
int
read_cstr
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:146
No description documented yet.
read_cstr(self, vma: int) -> str | None
self
vma
int
pool_strings
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:153
No description documented yet.
pool_strings(self, pool_vma: int, count: int) -> list[tuple[int, int, str | None]]
self
pool_vma
int
count
int
hardware/lepro/setup.py · LeproSetup
3 symbols
__init__
No description documented yet.
hardware/lepro/setup.py:15
No description documented yet.
__init__(self, base_dir: Path | None = None)
self
base_dir
Path | None
= None
run
No description documented yet.
hardware/lepro/setup.py:28
No description documented yet.
run(self) -> dict[str, Any]
self
fail
No description documented yet.
hardware/lepro/setup.py:254
No description documented yet.
fail(stage: str, message: str) -> dict[str, Any]
stage
str
message
str
interfaces/discord_bot.py · DiscordAdapter
2 symbols
__init__
No description documented yet.
interfaces/discord_bot.py:9
No description documented yet.
__init__(self, chat_engine, logger = None)
self
chat_engine
logger
= None
start
No description documented yet.
interfaces/discord_bot.py:13
No description documented yet.
start(self)
self
interfaces/terminal.py · TerminalAdapter
2 symbols
__init__
No description documented yet.
interfaces/terminal.py:9
No description documented yet.
__init__(self, chat_engine, logger = None)
self
chat_engine
logger
= None
run
No description documented yet.
interfaces/terminal.py:13
No description documented yet.
run(self)
self
interfaces/web_ui.py · WebUIAdapter
2 symbols
__init__
No description documented yet.
interfaces/web_ui.py:6
No description documented yet.
__init__(self, chat_engine, logger = None)
self
chat_engine
logger
= None
start
No description documented yet.
interfaces/web_ui.py:10
No description documented yet.
start(self, host = '127.0.0.1', port = 8000)
self
host
= '127.0.0.1'
port
= 8000
memory/embeddings.py · EmbeddingsProvider
4 symbols
__init__
No description documented yet.
memory/embeddings.py:9
No description documented yet.
__init__(self)
self
embed
No description documented yet.
memory/embeddings.py:12
No description documented yet.
embed(self, texts: List[str]) -> List[List[float]]
self
texts
List[str]
store_embeddings
No description documented yet.
memory/embeddings.py:15
No description documented yet.
store_embeddings(self, ids: List[int], vectors: List[List[float]])
self
ids
List[int]
vectors
List[List[float]]
query
No description documented yet.
memory/embeddings.py:18
No description documented yet.
query(self, vector: List[float], top_k: int = 5)
self
vector
List[float]
top_k
int
= 5
memory/memory.py · MemoryManager
1 symbols
__init__
No description documented yet.
memory/memory.py:23
No description documented yet.
__init__(self, conn)
self
conn
tools/base.py · BaseTool
1 symbols
call
No description documented yet.
tools/base.py:19
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
tools/calculator.py · CalculatorTool
2 symbols
_safe_eval
No description documented yet.
tools/calculator.py:13
No description documented yet.
_safe_eval(self, expr: str) -> float
self
expr
str
call
No description documented yet.
tools/calculator.py:23
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
tools/chart_tool.py · ChartTool
18 symbols
call
Main BaseTool entry point. ToolRouter calls: tool.call(args) and expects a ToolResult.
tools/chart_tool.py:68
Main BaseTool entry point. ToolRouter calls: tool.call(args) and expects a ToolResult.
call(self, args: Dict[str, Any]) -> ToolResult
self
args
Dict[str, Any]
create_chart
Create one complete chart specification.
tools/chart_tool.py:140
Create one complete chart specification.
create_chart(self, chart_type: str, title: str, data: List[Dict[str, Any]], x_key: str | None = None, series: List[Dict[str, Any]] | None = None, description: str | None = None, footer: str | None = None, x_axis_label: str | None = None, x_axis_scale: str | None = None, y_axis_min: float | None = None, y_axis_max: float | None = None, layout: str | None = None, name_key: str | None = None, value_key: str | None = None) -> Dict[str, Any]
self
chart_type
str
title
str
data
List[Dict[str, Any]]
x_key
str | None
= None
series
List[Dict[str, Any]] | None
= None
description
str | None
= None
footer
str | None
= None
x_axis_label
str | None
= None
x_axis_scale
str | None
= None
y_axis_min
float | None
= None
y_axis_max
float | None
= None
layout
str | None
= None
name_key
str | None
= None
value_key
str | None
= None
bar
No description documented yet.
tools/chart_tool.py:291
No description documented yet.
bar(self, title: str, data: List[Dict[str, Any]], x_key: str, series: List[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
x_key
str
series
List[Dict[str, Any]]
**kwargs
Any
line
No description documented yet.
tools/chart_tool.py:309
No description documented yet.
line(self, title: str, data: List[Dict[str, Any]], x_key: str, series: List[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
x_key
str
series
List[Dict[str, Any]]
**kwargs
Any
pie
No description documented yet.
tools/chart_tool.py:327
No description documented yet.
pie(self, title: str, data: List[Dict[str, Any]], name_key: str, value_key: str, series: List[Dict[str, Any]] | None = None, **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
name_key
str
value_key
str
series
List[Dict[str, Any]] | None
= None
**kwargs
Any
scatter
No description documented yet.
tools/chart_tool.py:347
No description documented yet.
scatter(self, title: str, data: List[Dict[str, Any]], x_key: str, series: List[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
x_key
str
series
List[Dict[str, Any]]
**kwargs
Any
make_series
Build a series definition. Example: ChartTool.make_series( data_key="cigarettes", label="Cigarettes", axis_label="Cigarettes", va…
tools/chart_tool.py:370
Build a series definition. Example: ChartTool.make_series( data_key="cigarettes", label="Cigarettes", axis_label="Cigarettes", value_format="integer", )
make_series(data_key: str, label: str | None = None, axis_label: str | None = None, value_format: str | None = None, value_prefix: str | None = None, value_suffix: str | None = None, stack: str | None = None) -> Dict[str, Any]
data_key
str
label
str | None
= None
axis_label
str | None
= None
value_format
str | None
= None
value_prefix
str | None
= None
value_suffix
str | None
= None
stack
str | None
= None
_normalize_chart_type
No description documented yet.
tools/chart_tool.py:447
No description documented yet.
_normalize_chart_type(chart_type: str) -> str
chart_type
str
_normalize_series
No description documented yet.
tools/chart_tool.py:459
No description documented yet.
_normalize_series(cls, series: List[Dict[str, Any]]) -> List[Dict[str, Any]]
cls
series
List[Dict[str, Any]]
_validate_chart_type
No description documented yet.
tools/chart_tool.py:554
No description documented yet.
_validate_chart_type(self, chart_type: str) -> None
self
chart_type
str
_validate_title
No description documented yet.
tools/chart_tool.py:570
No description documented yet.
_validate_title(title: str) -> None
title
str
_validate_data
No description documented yet.
tools/chart_tool.py:585
No description documented yet.
_validate_data(data: List[Dict[str, Any]]) -> None
data
List[Dict[str, Any]]
_validate_cartesian_chart
No description documented yet.
tools/chart_tool.py:607
No description documented yet.
_validate_cartesian_chart(chart_type: str, data: List[Dict[str, Any]], x_key: str | None, series: List[Dict[str, Any]]) -> None
chart_type
str
data
List[Dict[str, Any]]
x_key
str | None
series
List[Dict[str, Any]]
_validate_pie_chart
No description documented yet.
tools/chart_tool.py:648
No description documented yet.
_validate_pie_chart(data: List[Dict[str, Any]], name_key: str | None, value_key: str | None) -> None
data
List[Dict[str, Any]]
name_key
str | None
value_key
str | None
_validate_x_axis_scale
No description documented yet.
tools/chart_tool.py:705
No description documented yet.
_validate_x_axis_scale(chart_type: str, x_axis_scale: str, data: List[Dict[str, Any]], x_key: str | None) -> None
chart_type
str
x_axis_scale
str
data
List[Dict[str, Any]]
x_key
str | None
_validate_layout
No description documented yet.
tools/chart_tool.py:742
No description documented yet.
_validate_layout(layout: str) -> None
layout
str
_validate_y_axis
No description documented yet.
tools/chart_tool.py:752
No description documented yet.
_validate_y_axis(y_axis_min: float | None, y_axis_max: float | None) -> None
y_axis_min
float | None
y_axis_max
float | None
_format_output
Serialize the chart specification for ToolResult.output. ChatEngine can then parse/recognize the structured chart object rather t…
tools/chart_tool.py:792
Serialize the chart specification for ToolResult.output. ChatEngine can then parse/recognize the structured chart object rather than treating it as ordinary prose.
_format_output(chart: Dict[str, Any]) -> str
chart
Dict[str, Any]
tools/ChartTool.py · ChartTool
3 symbols
_ensure_db
No description documented yet.
tools/ChartTool.py:22
No description documented yet.
_ensure_db(self)
self
_smoke_data
No description documented yet.
tools/ChartTool.py:35
No description documented yet.
_smoke_data(self, scope: str = '7d', smoke_type: str | None = None)
self
scope
str
= '7d'
smoke_type
str | None
= None
call
No description documented yet.
tools/ChartTool.py:93
No description documented yet.
call(self, args: Dict[str, Any]) -> ToolResult
self
args
Dict[str, Any]
tools/filesystem.py · FilesystemTool
1 symbols
call
No description documented yet.
tools/filesystem.py:15
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
tools/lepro_lights.py · LeproLightsTool
3 symbols
__init__
No description documented yet.
tools/lepro_lights.py:20
No description documented yet.
__init__(self, device_name: str, mac: str)
self
device_name
str
mac
str
schema
Return the tool schema exposed to CYN.
tools/lepro_lights.py:30
Return the tool schema exposed to CYN.
schema(self) -> dict[str, Any]
self
execute
Execute a light-control request.
tools/lepro_lights.py:86
Execute a light-control request.
execute(self, arguments: dict[str, Any]) -> ToolResult
self
arguments
dict[str, Any]
tools/LeproLightsTool.py · LeproLightsTool
3 symbols
__init__
No description documented yet.
tools/LeproLightsTool.py:20
No description documented yet.
__init__(self, device_name: str, mac: str)
self
device_name
str
mac
str
schema
Return the tool schema exposed to CYN.
tools/LeproLightsTool.py:30
Return the tool schema exposed to CYN.
schema(self) -> dict[str, Any]
self
execute
Execute a light-control request.
tools/LeproLightsTool.py:86
Execute a light-control request.
execute(self, arguments: dict[str, Any]) -> ToolResult
self
arguments
dict[str, Any]
tools/SmokeCounterTool.py · SmokeCounterTool
1 symbols
call
Flexible call interface: - If args is a dict (tool_router), use it. - Otherwise accept keyword args for backward compatibility. R…
tools/SmokeCounterTool.py:611
Flexible call interface: - If args is a dict (tool_router), use it. - Otherwise accept keyword args for backward compatibility. Returns a ToolResult with a human-readable output and metadata containing the raw result dict.
call(self, args = None, action: str = 'stats', smoke_type: Optional[str] = None, amount: float = 1, limit: int = 10, scope: str = 'all') -> ToolResult
self
args
= None
action
str
= 'stats'
smoke_type
Optional[str]
= None
amount
float
= 1
limit
int
= 10
scope
str
= 'all'
tools/tool_router.py · ToolRouter
9 symbols
__init__
No description documented yet.
tools/tool_router.py:16
No description documented yet.
__init__(self)
self
register_tool
No description documented yet.
tools/tool_router.py:20
No description documented yet.
register_tool(self, tool: BaseTool)
self
tool
BaseTool
list_tools
No description documented yet.
tools/tool_router.py:24
No description documented yet.
list_tools(self)
self
describe_tools
Gives the AI a list of available tools.
tools/tool_router.py:28
Gives the AI a list of available tools.
describe_tools(self)
self
as_ollama_tools
Convert the registered tools into Ollama function-calling schemas.
tools/tool_router.py:41
Convert the registered tools into Ollama function-calling schemas.
as_ollama_tools(self)
self
call_tool
No description documented yet.
tools/tool_router.py:180
No description documented yet.
call_tool(self, name: str, args: Dict[str, Any]) -> ToolResult
self
name
str
args
Dict[str, Any]
normalize_smoke_type
Normalize a freeform smoke_type string into a canonical type (pen, vape, cigarette, bong, weed, joint, unknown).
tools/tool_router.py:215
Normalize a freeform smoke_type string into a canonical type (pen, vape, cigarette, bong, weed, joint, unknown).
normalize_smoke_type(self, text: str)
self
text
str
is_read_only_smoke_query
Return True when the request is asking for counts/stats/history instead of logging.
tools/tool_router.py:244
Return True when the request is asking for counts/stats/history instead of logging.
is_read_only_smoke_query(self, text: str) -> bool
self
text
str
detect
Detect whether a message requires a tool.
tools/tool_router.py:285
Detect whether a message requires a tool.
detect(self, text: str)
self
text
str
tools/weather.py · WeatherTool
1 symbols
call
No description documented yet.
tools/weather.py:12
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
tools/web_search.py · ResultFilter
2 symbols
__init__
No description documented yet.
tools/web_search.py:837
No description documented yet.
__init__(self)
self
is_bad_result
No description documented yet.
tools/web_search.py:841
No description documented yet.
is_bad_result(self, title: str, body: str, href: str) -> bool
self
title
str
body
str
href
str
tools/web_search.py · ResultRanker
8 symbols
__init__
No description documented yet.
tools/web_search.py:897
No description documented yet.
__init__(self, intent: SearchIntent)
self
intent
SearchIntent
rank
No description documented yet.
tools/web_search.py:905
No description documented yet.
rank(self, title: str, body: str, href: str) -> int
self
title
str
body
str
href
str
score_keywords
No description documented yet.
tools/web_search.py:980
No description documented yet.
score_keywords(title: str, combined: str, keywords: tuple[str, ...], title_weight: int, body_weight: int) -> int
title
str
combined
str
keywords
tuple[str, ...]
title_weight
int
body_weight
int
score_negative
No description documented yet.
tools/web_search.py:1002
No description documented yet.
score_negative(self, title: str, combined: str) -> int
self
title
str
combined
str
output_bonus
No description documented yet.
tools/web_search.py:1022
No description documented yet.
output_bonus(self, title: str) -> int
self
title
str
store_bonus
No description documented yet.
tools/web_search.py:1065
No description documented yet.
store_bonus(self, href: str) -> int
self
href
str
domain_bonus
No description documented yet.
tools/web_search.py:1080
No description documented yet.
domain_bonus(href: str) -> int
href
str
research_source_bonus
No description documented yet.
tools/web_search.py:1110
No description documented yet.
research_source_bonus(href: str) -> int
href
str
tools/web_search.py · WebSearchTool
2 symbols
call
No description documented yet.
tools/web_search.py:1547
No description documented yet.
call(self, args)
self
args
format_result
No description documented yet.
tools/web_search.py:1913
No description documented yet.
format_result(title: str, body: str, href: str, score: int = 0, source_type: str = 'unknown') -> str
title
str
body
str
href
str
score
int
= 0
source_type
str
= 'unknown'
voice/audio_player.py · AudioPlayer
4 symbols
play
Play a WAV audio file. Args: filepath (str): Path to the WAV file to play Raises: FileNotFoundError: If the audio file doesn't ex…
voice/audio_player.py:18
Play a WAV audio file. Args: filepath (str): Path to the WAV file to play Raises: FileNotFoundError: If the audio file doesn't exist RuntimeError: If playback fails
play(self, filepath)
self
filepath
_play_windows
Play audio on Windows using PowerShell.
voice/audio_player.py:42
Play audio on Windows using PowerShell.
_play_windows(self, filepath)
self
filepath
_play_macos
Play audio on macOS using afplay.
voice/audio_player.py:57
Play audio on macOS using afplay.
_play_macos(self, filepath)
self
filepath
_play_linux
Play audio on Linux using available tools.
voice/audio_player.py:66
Play audio on Linux using available tools.
_play_linux(self, filepath)
self
filepath
voice/piper_engine.py · PiperTTS
2 symbols
__init__
Initialize PiperTTS with a specific model. Args: model_path (str): Path to the .onnx model file e.g., "models/voices/cyn_normal.o…
voice/piper_engine.py:33
Initialize PiperTTS with a specific model. Args: model_path (str): Path to the .onnx model file e.g., "models/voices/cyn_normal.onnx" Raises: FileNotFoundError: If the model file doesn't exist
__init__(self, model_path)
self
model_path
generate
Generate speech from text using Piper TTS. Args: text (str): The text to convert to speech output_file (str): Path where the WAV…
voice/piper_engine.py:53
Generate speech from text using Piper TTS. Args: text (str): The text to convert to speech output_file (str): Path where the WAV file will be saved Returns: str: Path to the generated WAV file Raises: RuntimeError: If Piper subprocess fails or is not installed
generate(self, text, output_file = 'cyn_output.wav')
self
text
output_file
= 'cyn_output.wav'
voice/tts_engine.py · TTSEngine
2 symbols
__init__
No description documented yet.
voice/tts_engine.py:6
No description documented yet.
__init__(self)
self
generate
No description documented yet.
voice/tts_engine.py:13
No description documented yet.
generate(self, text, output = 'cyn_output.wav')
self
text
output
= 'cyn_output.wav'
voice/voice_manager.py · VoiceManager
2 symbols
__init__
Initialize VoiceManager with TTS and playback engines. Args: tts: TTS engine (e.g., PiperTTS) with generate(text) method player:…
voice/voice_manager.py:26
Initialize VoiceManager with TTS and playback engines. Args: tts: TTS engine (e.g., PiperTTS) with generate(text) method player: Audio player (e.g., AudioPlayer) with play(filepath) method
__init__(self, tts, player)
self
tts
player
speak
Generate speech from text and play it immediately. Args: text (str): The text to speak Raises: Exception: Propagates errors from…
voice/voice_manager.py:37
Generate speech from text and play it immediately. Args: text (str): The text to speak Raises: Exception: Propagates errors from TTS or playback
speak(self, text)
self
text
Classes
Classes stay collapsed so large projects remain readable.
ChatEngine
No description documented yet.
6 methods
__init__
No description documented yet.
ai/chat_engine.py:50
No description documented yet.
__init__(self, ollama_client, prompt_builder, memory_store, tool_router, mode_manager, memory_manager: Optional[MemoryManager] = None, memory_extractor: Optional[MemoryExtractor] = None, context_manager = None, logger_obj = None)
self
ollama_client
prompt_builder
memory_store
tool_router
mode_manager
memory_manager
Optional[MemoryManager]
= None
memory_extractor
Optional[MemoryExtractor]
= None
context_manager
= None
logger_obj
= None
trim_context
No description documented yet.
ai/chat_engine.py:98
No description documented yet.
trim_context(self, text: str, limit: int) -> str
self
text
str
limit
int
_estimate_message_tokens
Roughly estimate tokens in an Ollama message. This is intentionally conservative. Actual tokenization is model-dependent, so the…
ai/chat_engine.py:116
Roughly estimate tokens in an Ollama message. This is intentionally conservative. Actual tokenization is model-dependent, so the final context budget keeps headroom.
_estimate_message_tokens(self, message) -> int
self
message
_trim_ollama_messages
Prevent Ollama requests from exceeding the available context. Priority: 1. System prompt 2. Current user message 3. Tool results…
ai/chat_engine.py:149
Prevent Ollama requests from exceeding the available context. Priority: 1. System prompt 2. Current user message 3. Tool results required for the current response 4. Newest conversation history 5. Older conversation history The current user message is never intentionally removed.
_trim_ollama_messages(self, messages, max_tokens: int = OLLAMA_PROMPT_BUDGET)
self
messages
max_tokens
int
= OLLAMA_PROMPT_BUDGET
_ollama_tools
No description documented yet.
ai/chat_engine.py:471
No description documented yet.
_ollama_tools(self, user_text: str = '')
self
user_text
str
= ''
handle_user_message
Process a user message. Flow: 1. Retrieve relevant context 2. Build Cyn prompt 3. Detect tools 4. Execute tools 5. Generate respo…
ai/chat_engine.py:501
Process a user message. Flow: 1. Retrieve relevant context 2. Build Cyn prompt 3. Detect tools 4. Execute tools 5. Generate response 6. Extract memories 7. Save conversation info
handle_user_message(self, user_id: str, text: str, mode: str = 'normal', personality: str = 'normal', request_id: Optional[str] = None) -> str
self
user_id
str
text
str
mode
str
= 'normal'
personality
str
= 'normal'
request_id
Optional[str]
= None
ContextManager
No description documented yet.
2 methods
__init__
No description documented yet.
ai/context_manager.py:9
No description documented yet.
__init__(self, memory_store, knowledge_store)
self
memory_store
knowledge_store
build_context
No description documented yet.
ai/context_manager.py:27
No description documented yet.
build_context(self, user_id, user_message)
self
user_id
user_message
KnowledgeStore
No description documented yet.
4 methods
__init__
No description documented yet.
ai/knowledge/store.py:7
No description documented yet.
__init__(self, conn)
self
conn
add
No description documented yet.
ai/knowledge/store.py:20
No description documented yet.
add(self, content, title = '', category = 'general', importance = 5, tags = None)
self
content
title
= ''
category
= 'general'
importance
= 5
tags
= None
search
No description documented yet.
ai/knowledge/store.py:68
No description documented yet.
search(self, query, limit = 5)
self
query
limit
= 5
recent
No description documented yet.
ai/knowledge/store.py:156
No description documented yet.
recent(self, limit = 10)
self
limit
= 10
MemoryExtractor
No description documented yet.
10 methods
__init__
No description documented yet.
ai/memory_system/extractor.py:30
No description documented yet.
__init__(self, memory_store)
self
memory_store
extract_and_save
No description documented yet.
ai/memory_system/extractor.py:49
No description documented yet.
extract_and_save(self, user_id: str, user_message: str, assistant_response: str = '') -> List[int]
self
user_id
str
user_message
str
assistant_response
str
= ''
extract_preferences
No description documented yet.
ai/memory_system/extractor.py:292
No description documented yet.
extract_preferences(self, text)
self
text
extract_goals
No description documented yet.
ai/memory_system/extractor.py:328
No description documented yet.
extract_goals(self, text)
self
text
extract_projects
No description documented yet.
ai/memory_system/extractor.py:365
No description documented yet.
extract_projects(self, text)
self
text
extract_names
No description documented yet.
ai/memory_system/extractor.py:402
No description documented yet.
extract_names(self, text)
self
text
extract_style
No description documented yet.
ai/memory_system/extractor.py:442
No description documented yet.
extract_style(self, text)
self
text
match_patterns
No description documented yet.
ai/memory_system/extractor.py:488
No description documented yet.
match_patterns(self, patterns, text, prefix)
self
patterns
text
prefix
meaningful
No description documented yet.
ai/memory_system/extractor.py:548
No description documented yet.
meaningful(self, text)
self
text
should_save
No description documented yet.
ai/memory_system/extractor.py:577
No description documented yet.
should_save(self, content)
self
content
MemoryManager
No description documented yet.
9 methods
__init__
No description documented yet.
ai/memory_system/manager.py:24
No description documented yet.
__init__(self, conn)
self
conn
remember
No description documented yet.
ai/memory_system/manager.py:62
No description documented yet.
remember(self, user_id, content, category = 'general', importance = 5)
self
user_id
content
category
= 'general'
importance
= 5
recall
No description documented yet.
ai/memory_system/manager.py:160
No description documented yet.
recall(self, user_id, limit = 5, min_importance = 1, categories = None)
self
user_id
limit
= 5
min_importance
= 1
categories
= None
search
No description documented yet.
ai/memory_system/manager.py:265
No description documented yet.
search(self, user_id, query, limit = 5)
self
user_id
query
limit
= 5
get_all_memories
No description documented yet.
ai/memory_system/manager.py:368
No description documented yet.
get_all_memories(self, user_id)
self
user_id
recent
No description documented yet.
ai/memory_system/manager.py:424
No description documented yet.
recent(self, limit = 10)
self
limit
= 10
delete_memory
No description documented yet.
ai/memory_system/manager.py:472
No description documented yet.
delete_memory(self, memory_id)
self
memory_id
update_memory
No description documented yet.
ai/memory_system/manager.py:522
No description documented yet.
update_memory(self, memory_id, importance = None, content = None)
self
memory_id
importance
= None
content
= None
format_for_prompt
No description documented yet.
ai/memory_system/manager.py:598
No description documented yet.
format_for_prompt(self, memories)
self
memories
ModeSpec
No description documented yet.
1 methods
__init__
No description documented yet.
ai/mode_manager.py:9
No description documented yet.
__init__(self, name: str, allowed_tools: List[str] = None, instruction_fragment: str = '')
self
name
str
allowed_tools
List[str]
= None
instruction_fragment
str
= ''
ModeManager
No description documented yet.
4 methods
__init__
No description documented yet.
ai/mode_manager.py:21
No description documented yet.
__init__(self)
self
_init_default_modes
No description documented yet.
ai/mode_manager.py:25
No description documented yet.
_init_default_modes(self)
self
get_mode
No description documented yet.
ai/mode_manager.py:100
No description documented yet.
get_mode(self, name: str) -> ModeSpec
self
name
str
allowed_tools_for
No description documented yet.
ai/mode_manager.py:106
No description documented yet.
allowed_tools_for(self, name: str)
self
name
str
OllamaClient
No description documented yet.
4 methods
__init__
No description documented yet.
ai/ollama_client.py:20
No description documented yet.
__init__(self, base_url: str = 'http://localhost:11434', model: str = 'cyn-x:latest', timeout: int = 600)
self
base_url
str
= 'http://localhost:11434'
model
str
= 'cyn-x:latest'
timeout
int
= 600
generate
No description documented yet.
ai/ollama_client.py:30
No description documented yet.
generate(self, prompt: str, max_tokens: int = 512, stream: bool = False, **kwargs) -> Dict[str, Any]
self
prompt
str
max_tokens
int
= 512
stream
bool
= False
**kwargs
chat
Call Ollama's chat endpoint with optional tools.
ai/ollama_client.py:102
Call Ollama's chat endpoint with optional tools.
chat(self, messages: List[Dict[str, Any]], tools: Optional[List[Dict[str, Any]]] = None, stream: bool = False, **kwargs) -> Dict[str, Any]
self
messages
List[Dict[str, Any]]
tools
Optional[List[Dict[str, Any]]]
= None
stream
bool
= False
**kwargs
generate_stream
No description documented yet.
ai/ollama_client.py:304
No description documented yet.
generate_stream(self, prompt: str, max_tokens: int = 512, **kwargs) -> Generator[str, None, None]
self
prompt
str
max_tokens
int
= 512
**kwargs
PromptBuilder
No description documented yet.
12 methods
__init__
No description documented yet.
ai/prompt_builder.py:226
No description documented yet.
__init__(self, templates_dir: Optional[str] = None)
self
templates_dir
Optional[str]
= None
normalize_prompt_layers
No description documented yet.
ai/prompt_builder.py:244
No description documented yet.
normalize_prompt_layers(self, prompt_layers: Optional[Dict[str, bool]] = None) -> Dict[str, bool]
self
prompt_layers
Optional[Dict[str, bool]]
= None
set_prompt_layers
No description documented yet.
ai/prompt_builder.py:266
No description documented yet.
set_prompt_layers(self, prompt_layers: Optional[Dict[str, bool]] = None) -> Dict[str, bool]
self
prompt_layers
Optional[Dict[str, bool]]
= None
get_prompt_layers
No description documented yet.
ai/prompt_builder.py:282
No description documented yet.
get_prompt_layers(self) -> Dict[str, bool]
self
apply_prompt_preset
No description documented yet.
ai/prompt_builder.py:291
No description documented yet.
apply_prompt_preset(self, preset: str) -> Dict[str, bool]
self
preset
str
trim_context
No description documented yet.
ai/prompt_builder.py:311
No description documented yet.
trim_context(self, text: str, limit: int) -> str
self
text
str
limit
int
should_include_context
No description documented yet.
ai/prompt_builder.py:339
No description documented yet.
should_include_context(self, text: str) -> bool
self
text
str
score_context
No description documented yet.
ai/prompt_builder.py:360
No description documented yet.
score_context(self, chunk: str, query: str) -> int
self
chunk
str
query
str
select_context
No description documented yet.
ai/prompt_builder.py:397
No description documented yet.
select_context(self, chunks: List[str], query: str, limit: int) -> str
self
chunks
List[str]
query
str
limit
int
build_system_prompt
No description documented yet.
ai/prompt_builder.py:472
No description documented yet.
build_system_prompt(self, modes: Optional[List[str]] = None, memory: str = '', context: str = '', prompt_layers: Optional[Dict[str, bool]] = None) -> str
self
modes
Optional[List[str]]
= None
memory
str
= ''
context
str
= ''
prompt_layers
Optional[Dict[str, bool]]
= None
budget_context
No description documented yet.
ai/prompt_builder.py:551
No description documented yet.
budget_context(self, sections: List[Dict[str, Any]]) -> List[str]
self
sections
List[Dict[str, Any]]
build_prompt
No description documented yet.
ai/prompt_builder.py:688
No description documented yet.
build_prompt(self, user_input: str, mode_fragment: str = '', personality_fragment: str = '', history: Optional[List[dict]] = None, memory_summary: str = '', knowledge_context: str = '', tools_spec: str = '', intent: str = '', conversation_summary: str = '', prompt_layers: Optional[Dict[str, bool]] = None) -> str
self
user_input
str
mode_fragment
str
= ''
personality_fragment
str
= ''
history
Optional[List[dict]]
= None
memory_summary
str
= ''
knowledge_context
str
= ''
tools_spec
str
= ''
intent
str
= ''
conversation_summary
str
= ''
prompt_layers
Optional[Dict[str, bool]]
= None
PromptManager
No description documented yet.
10 methods
__init__
No description documented yet.
ai/prompt_manager.py:97
No description documented yet.
__init__(self, prompts_dir: Optional[str] = None)
self
prompts_dir
Optional[str]
= None
normalize_prompt_layers
No description documented yet.
ai/prompt_manager.py:151
No description documented yet.
normalize_prompt_layers(self, enabled_layers = None)
self
enabled_layers
= None
_load_file
No description documented yet.
ai/prompt_manager.py:182
No description documented yet.
_load_file(self, path: Path)
self
path
Path
trim_text
No description documented yet.
ai/prompt_manager.py:220
No description documented yet.
trim_text(self, text, limit)
self
text
limit
load_core_prompts
No description documented yet.
ai/prompt_manager.py:254
No description documented yet.
load_core_prompts(self)
self
load_personality_matrix
No description documented yet.
ai/prompt_manager.py:364
No description documented yet.
load_personality_matrix(self)
self
load_optional
No description documented yet.
ai/prompt_manager.py:408
No description documented yet.
load_optional(self, name)
self
name
load_option
No description documented yet.
ai/prompt_manager.py:441
No description documented yet.
load_option(self, name)
self
name
load_mode
No description documented yet.
ai/prompt_manager.py:474
No description documented yet.
load_mode(self, mode_name)
self
mode_name
build_system_prompt
No description documented yet.
ai/prompt_manager.py:519
No description documented yet.
build_system_prompt(self, active_modes = None, active_options = None, memory_summary = '', additional_context = '', include_safety = True, enabled_layers = None)
self
active_modes
= None
active_options
= None
memory_summary
= ''
additional_context
= ''
include_safety
= True
enabled_layers
= None
CYNXTerminal
No description documented yet.
22 methods
__init__
No description documented yet.
ai/terminal_ui/renderer.py:31
No description documented yet.
__init__(self)
self
_print_label
No description documented yet.
ai/terminal_ui/renderer.py:40
No description documented yet.
_print_label(self, label, value = None, style, value_style = 'white')
self
label
value
= None
style
value_style
= 'white'
section
No description documented yet.
ai/terminal_ui/renderer.py:48
No description documented yet.
section(self, title)
self
title
info
No description documented yet.
ai/terminal_ui/renderer.py:51
No description documented yet.
info(self, message)
self
message
memory
No description documented yet.
ai/terminal_ui/renderer.py:54
No description documented yet.
memory(self, message)
self
message
warning
No description documented yet.
ai/terminal_ui/renderer.py:57
No description documented yet.
warning(self, message)
self
message
error
No description documented yet.
ai/terminal_ui/renderer.py:60
No description documented yet.
error(self, message)
self
message
dim
No description documented yet.
ai/terminal_ui/renderer.py:63
No description documented yet.
dim(self, message)
self
message
user
No description documented yet.
ai/terminal_ui/renderer.py:66
No description documented yet.
user(self, message)
self
message
ollama
No description documented yet.
ai/terminal_ui/renderer.py:69
No description documented yet.
ollama(self, label = 'OLLAMA CALL', value = None)
self
label
= 'OLLAMA CALL'
value
= None
model
No description documented yet.
ai/terminal_ui/renderer.py:72
No description documented yet.
model(self, label = 'MODEL RESPONSE', value = None)
self
label
= 'MODEL RESPONSE'
value
= None
tool
No description documented yet.
ai/terminal_ui/renderer.py:75
No description documented yet.
tool(self, label = 'TOOL CALL', value = None)
self
label
= 'TOOL CALL'
value
= None
tool_args
No description documented yet.
ai/terminal_ui/renderer.py:78
No description documented yet.
tool_args(self, label = 'TOOL ARGUMENTS', value = None)
self
label
= 'TOOL ARGUMENTS'
value
= None
execute
No description documented yet.
ai/terminal_ui/renderer.py:81
No description documented yet.
execute(self, label = 'EXECUTING TOOL', value = None)
self
label
= 'EXECUTING TOOL'
value
= None
result
No description documented yet.
ai/terminal_ui/renderer.py:84
No description documented yet.
result(self, label = 'TOOL RESULT', value = None)
self
label
= 'TOOL RESULT'
value
= None
prompt
No description documented yet.
ai/terminal_ui/renderer.py:87
No description documented yet.
prompt(self, label = 'PROMPT SECTION', value = None)
self
label
= 'PROMPT SECTION'
value
= None
final_prompt
No description documented yet.
ai/terminal_ui/renderer.py:90
No description documented yet.
final_prompt(self, label = 'FINAL SYSTEM PROMPT', value = None)
self
label
= 'FINAL SYSTEM PROMPT'
value
= None
available_tools
No description documented yet.
ai/terminal_ui/renderer.py:93
No description documented yet.
available_tools(self, tools)
self
tools
json
No description documented yet.
ai/terminal_ui/renderer.py:96
No description documented yet.
json(self, payload)
self
payload
timing
No description documented yet.
ai/terminal_ui/renderer.py:102
No description documented yet.
timing(self, message)
self
message
memory_error
No description documented yet.
ai/terminal_ui/renderer.py:105
No description documented yet.
memory_error(self, message)
self
message
blank
No description documented yet.
ai/terminal_ui/renderer.py:108
No description documented yet.
blank(self)
self
Parameter
No description documented yet.
0 methods
FunctionInfo
No description documented yet.
2 methods
qualified_name
No description documented yet.
barkly_docs.py:146
No description documented yet.
qualified_name(self) -> str
self
signature
No description documented yet.
barkly_docs.py:152
No description documented yet.
signature(self) -> str
self
ClassInfo
No description documented yet.
0 methods
EndpointInfo
No description documented yet.
1 methods
method_text
No description documented yet.
barkly_docs.py:202
No description documented yet.
method_text(self) -> str
self
ModuleInfo
No description documented yet.
0 methods
PythonScanner
No description documented yet.
7 methods
__init__
No description documented yet.
barkly_docs.py:592
No description documented yet.
__init__(self, root: Path)
self
root
Path
scan
No description documented yet.
barkly_docs.py:600
No description documented yet.
scan(self) -> None
self
scan_file
No description documented yet.
barkly_docs.py:607
No description documented yet.
scan_file(self, path: Path) -> None
self
path
Path
function_node_for_class_method
No description documented yet.
barkly_docs.py:665
No description documented yet.
function_node_for_class_method(self, class_node: ast.ClassDef, method_name: str) -> Optional[ast.FunctionDef | ast.AsyncFunctionDef]
self
class_node
ast.ClassDef
method_name
str
make_function
No description documented yet.
barkly_docs.py:680
No description documented yet.
make_function(self, node: ast.FunctionDef | ast.AsyncFunctionDef, file: str, class_name: str = '') -> FunctionInfo
self
node
ast.FunctionDef | ast.AsyncFunctionDef
file
str
class_name
str
= ''
make_class
No description documented yet.
barkly_docs.py:699
No description documented yet.
make_class(self, node: ast.ClassDef, file: str) -> ClassInfo
self
node
ast.ClassDef
file
str
find_endpoints
No description documented yet.
barkly_docs.py:729
No description documented yet.
find_endpoints(self, node: Optional[ast.FunctionDef | ast.AsyncFunctionDef], file: str) -> None
self
node
Optional[ast.FunctionDef | ast.AsyncFunctionDef]
file
str
BenchmarkCleaner
No description documented yet.
8 methods
__init__
No description documented yet.
benchmark/cleaner.py:99
No description documented yet.
__init__(self, execute: bool = False, remove_temp: bool = False)
self
execute
bool
= False
remove_temp
bool
= False
show_delete
No description documented yet.
benchmark/cleaner.py:116
No description documented yet.
show_delete(self, path: Path)
self
path
Path
is_protected
No description documented yet.
benchmark/cleaner.py:150
No description documented yet.
is_protected(self, path: Path) -> bool
self
path
Path
clean_results
No description documented yet.
benchmark/cleaner.py:210
No description documented yet.
clean_results(self)
self
clean_temp_files
No description documented yet.
benchmark/cleaner.py:255
No description documented yet.
clean_temp_files(self)
self
clean_empty_directories
No description documented yet.
benchmark/cleaner.py:304
No description documented yet.
clean_empty_directories(self)
self
print_protected_info
No description documented yet.
benchmark/cleaner.py:361
No description documented yet.
print_protected_info(self)
self
summary
No description documented yet.
benchmark/cleaner.py:393
No description documented yet.
summary(self)
self
BenchmarkStorage
No description documented yet.
5 methods
__init__
No description documented yet.
benchmark/runner.py:754
No description documented yet.
__init__(self)
self
save_test
No description documented yet.
benchmark/runner.py:775
No description documented yet.
save_test(self, result)
self
result
add
No description documented yet.
benchmark/runner.py:950
No description documented yet.
add(self, result)
self
result
save_raw
No description documented yet.
benchmark/runner.py:967
No description documented yet.
save_raw(self)
self
save_summary
No description documented yet.
benchmark/runner.py:1034
No description documented yet.
save_summary(self)
self
Config
No description documented yet.
0 methods
LeproConfig
Stores Lepro devices configured for CYN-X.
6 methods
__init__
No description documented yet.
hardware/lepro/config.py:11
No description documented yet.
__init__(self, path: Path) -> None
self
path
Path
load
No description documented yet.
hardware/lepro/config.py:14
No description documented yet.
load(self) -> dict[str, Any]
self
save
No description documented yet.
hardware/lepro/config.py:31
No description documented yet.
save(self, data: dict[str, Any]) -> None
self
data
dict[str, Any]
add_device
No description documented yet.
hardware/lepro/config.py:42
No description documented yet.
add_device(self, name: str, mac: str, device_type: str = 'lepro', discovered_name: str | None = None) -> dict[str, Any]
self
name
str
mac
str
device_type
str
= 'lepro'
discovered_name
str | None
= None
get_device
No description documented yet.
hardware/lepro/config.py:68
No description documented yet.
get_device(self, name: str) -> dict[str, Any] | None
self
name
str
list_devices
No description documented yet.
hardware/lepro/config.py:75
No description documented yet.
list_devices(self) -> list[dict[str, Any]]
self
LeproDevice
CYN-X interface for a physical Lepro Bluetooth device.
11 methods
__init__
No description documented yet.
hardware/lepro/devices.py:29
No description documented yet.
__init__(self, name: str, mac: str)
self
name
str
mac
str
has_credentials
Return True if this device has been bonded.
hardware/lepro/devices.py:37
Return True if this device has been bonded.
has_credentials(self) -> bool
self
credential_path
Return the path where Lepro stores this device's credentials.
hardware/lepro/devices.py:41
Return the path where Lepro stores this device's credentials.
credential_path(self)
self
connect
Connect to the physical Lepro device.
hardware/lepro/devices.py:49
Connect to the physical Lepro device.
connect(self)
self
bond
Bond this device with CYN-X.
hardware/lepro/devices.py:57
Bond this device with CYN-X.
bond(self, force: bool = False) -> Any
self
force
bool
= False
_run_control
Send a datapoint control payload to the device.
hardware/lepro/devices.py:80
Send a datapoint control payload to the device.
_run_control(self, payload: dict[str, Any] | list[str]) -> Any
self
payload
dict[str, Any] | list[str]
turn_on
Turn the light on.
hardware/lepro/devices.py:114
Turn the light on.
turn_on(self, brightness: int = 1000) -> Any
self
brightness
int
= 1000
turn_off
Turn the light off.
hardware/lepro/devices.py:126
Turn the light off.
turn_off(self) -> Any
self
set_color_rgb
Set the light color using RGB values.
hardware/lepro/devices.py:137
Set the light color using RGB values.
set_color_rgb(self, red: int, green: int, blue: int, brightness: int = 1000) -> Any
self
red
int
green
int
blue
int
brightness
int
= 1000
set_color_hsv
Set the light color using HSV values.
hardware/lepro/devices.py:155
Set the light color using HSV values.
set_color_hsv(self, hue: float, saturation: int = 1000, value: int = 1000, brightness: int = 1000) -> Any
self
hue
float
saturation
int
= 1000
value
int
= 1000
brightness
int
= 1000
get_status
Query the current datapoint state of the light. This uses the upstream Lepro protocol directly without modifying the upstream lib…
hardware/lepro/devices.py:177
Query the current datapoint state of the light. This uses the upstream Lepro protocol directly without modifying the upstream library.
get_status(self) -> dict[str, Any]
self
LeproDiscovery
Find nearby Lepro Bluetooth devices.
2 methods
__init__
No description documented yet.
hardware/lepro/discovery.py:12
No description documented yet.
__init__(self, timeout: float = 15.0)
self
timeout
float
= 15.0
scan
No description documented yet.
hardware/lepro/discovery.py:18
No description documented yet.
scan(self) -> list[dict[str, Any]]
self
BondTokens
No description documented yet.
3 methods
validate
No description documented yet.
hardware/lepro/lib/lepro/bond.py:50
No description documented yet.
validate(self) -> None
self
to_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:57
No description documented yet.
to_dict(self) -> dict[str, str]
self
from_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:61
No description documented yet.
from_dict(cls, d: dict[str, str]) -> BondTokens
cls
d
dict[str, str]
BondCredentials
No description documented yet.
3 methods
__post_init__
No description documented yet.
hardware/lepro/lib/lepro/bond.py:78
No description documented yet.
__post_init__(self) -> None
self
to_json_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:83
No description documented yet.
to_json_dict(self) -> dict
self
from_json_dict
No description documented yet.
hardware/lepro/lib/lepro/bond.py:92
No description documented yet.
from_json_dict(cls, d: dict) -> BondCredentials
cls
d
dict
BondHarvestError
Bond or token step failed.
0 methods
DeviceConfig
No description documented yet.
0 methods
LabConfig
No description documented yet.
0 methods
WifiConfig
No description documented yet.
0 methods
BridgeConfig
No description documented yet.
0 methods
LeproLabConfig
No description documented yet.
0 methods
BytePatch
No description documented yet.
0 methods
BundleConfig
No description documented yet.
0 methods
FirmwareProfile
No description documented yet.
0 methods
PatchProfiles
No description documented yet.
1 methods
by_id
No description documented yet.
hardware/lepro/lib/lepro/firmware_profile.py:53
No description documented yet.
by_id(self, profile_id: str) -> FirmwareProfile
self
profile_id
str
DecryptedFrame
No description documented yet.
0 methods
RxAssembler
Reassemble fragmented RX packets and optionally decrypt.
8 methods
__init__
No description documented yet.
hardware/lepro/lib/lepro/frame.py:76
No description documented yet.
__init__(self, mac: str, session_rand: int | None = None) -> None
self
mac
str
session_rand
int | None
= None
set_session_rand
Update key after 0x1000 hello reveals bleInit rand() in ctx1.
hardware/lepro/lib/lepro/frame.py:90
Update key after 0x1000 hello reveals bleInit rand() in ctx1.
set_session_rand(self, session_rand: int) -> None
self
session_rand
int
feed
No description documented yet.
hardware/lepro/lib/lepro/frame.py:95
No description documented yet.
feed(self, raw: bytes) -> list[DecryptedFrame]
self
raw
bytes
_reset_fragment
No description documented yet.
hardware/lepro/lib/lepro/frame.py:111
No description documented yet.
_reset_fragment(self) -> None
self
_feed_fragment
No description documented yet.
hardware/lepro/lib/lepro/frame.py:116
No description documented yet.
_feed_fragment(self, raw: bytes, magic2: int) -> list[DecryptedFrame]
self
raw
bytes
magic2
int
_dispatch_single
No description documented yet.
hardware/lepro/lib/lepro/frame.py:176
No description documented yet.
_dispatch_single(self, raw: bytes) -> list[DecryptedFrame]
self
raw
bytes
_maybe_decrypt
No description documented yet.
hardware/lepro/lib/lepro/frame.py:188
No description documented yet.
_maybe_decrypt(self, frame: DecryptedFrame) -> DecryptedFrame
self
frame
DecryptedFrame
_synthetic_body
No description documented yet.
hardware/lepro/lib/lepro/frame.py:206
No description documented yet.
_synthetic_body(seq: int, magic2: int, ptype: int, subtype: int, payload: bytes) -> bytes
seq
int
magic2
int
ptype
int
subtype
int
payload
bytes
OtaStartResponse
No description documented yet.
0 methods
OtaDataResponse
No description documented yet.
0 methods
ModeSpec
No description documented yet.
0 methods
OtaTransferResult
Outcome of the BLE OTA data phase.
2 methods
finalize_code
No description documented yet.
hardware/lepro/lib/lepro/ota.py:113
No description documented yet.
finalize_code(self) -> int | None
self
transfer_complete
No description documented yet.
hardware/lepro/lib/lepro/ota.py:117
No description documented yet.
transfer_complete(self) -> bool
self
OtaConfirmVerdict
Post-reboot discovery verdict.
0 methods
OtaLog
Timestamped, flushed stdout logging for long OTA runs.
3 methods
info
No description documented yet.
hardware/lepro/lib/lepro/ota.py:138
No description documented yet.
info(self, msg: str) -> None
self
msg
str
phase
No description documented yet.
hardware/lepro/lib/lepro/ota.py:144
No description documented yet.
phase(self, name: str) -> None
self
name
str
wait
No description documented yet.
hardware/lepro/lib/lepro/ota.py:147
No description documented yet.
wait(self, msg: str, timeout: float) -> None
self
msg
str
timeout
float
OtaTransport
BLE transport with compact or full TX/RX logging.
2 methods
on_notify
No description documented yet.
hardware/lepro/lib/lepro/ota.py:159
No description documented yet.
on_notify(self, _sender: object, data: bytearray) -> None
self
_sender
object
data
bytearray
send
No description documented yet.
hardware/lepro/lib/lepro/ota.py:165
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
BleOtaSession
Discovery + auth + chunked OTA transfer.
2 methods
__init__
No description documented yet.
hardware/lepro/lib/lepro/ota.py:954
No description documented yet.
__init__(self, session: LeproSession, firmware: Path, image: bytes, log: OtaLog) -> None
self
session
LeproSession
firmware
Path
image
bytes
log
OtaLog
run
No description documented yet.
hardware/lepro/lib/lepro/ota.py:966
No description documented yet.
run(self, json_bytes: bytes, chunk_size: int = 4096, max_retries: int = 3, dry_run: bool = False) -> OtaTransferResult
self
json_bytes
bytes
chunk_size
int
= 4096
max_retries
int
= 3
dry_run
bool
= False
BundleLayout
No description documented yet.
1 methods
record_len
No description documented yet.
hardware/lepro/lib/lepro/patch_cdn.py:78
No description documented yet.
record_len(self) -> int
self
PatchResult
No description documented yet.
0 methods
PacketHeader
No description documented yet.
0 methods
SessionConfig
No description documented yet.
0 methods
DeviceInfo
No description documented yet.
3 methods
prov_state
OTA/provisioning state-machine value (device-info byte[1] = ota_ctx+0x10).
hardware/lepro/lib/lepro/session.py:71
OTA/provisioning state-machine value (device-info byte[1] = ota_ctx+0x10).
prov_state(self) -> int | None
self
prov_slot
Retained provisioning flag (device-info byte[2], from ota_ctx slot 0x42000b3c). Verified in ZB1 v2.3.18 build_device_info_reply:…
hardware/lepro/lib/lepro/session.py:76
Retained provisioning flag (device-info byte[2], from ota_ctx slot 0x42000b3c). Verified in ZB1 v2.3.18 build_device_info_reply: 6 = addable/onboarding (slot unset or factory), 7 = provisioned. NOTE: a power-cycle reset re-enters onboarding via the reboot counter WITHOUT clearing this slot, so a 7 here does NOT prove the CDN cert fetch is disabled — it is only conclusive when 6.
prov_slot(self) -> int | None
self
provisioning_summary
One-line human-readable provisioning/cert-fetch status for CLI output.
hardware/lepro/lib/lepro/session.py:87
One-line human-readable provisioning/cert-fetch status for CLI output.
provisioning_summary(self) -> str
self
Transport
No description documented yet.
3 methods
send
No description documented yet.
hardware/lepro/lib/lepro/session.py:105
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
recv
No description documented yet.
hardware/lepro/lib/lepro/session.py:106
No description documented yet.
recv(self, timeout: float) -> bytes | None
self
timeout
float
drain
No description documented yet.
hardware/lepro/lib/lepro/session.py:107
No description documented yet.
drain(self, timeout: float) -> list[bytes]
self
timeout
float
DryRunTransport
Collect TX packets without BLE.
3 methods
send
No description documented yet.
hardware/lepro/lib/lepro/session.py:116
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
recv
No description documented yet.
hardware/lepro/lib/lepro/session.py:119
No description documented yet.
recv(self, timeout: float) -> bytes | None
self
timeout
float
drain
No description documented yet.
hardware/lepro/lib/lepro/session.py:122
No description documented yet.
drain(self, timeout: float) -> list[bytes]
self
timeout
float
BleakTransport
No description documented yet.
4 methods
on_notify
No description documented yet.
hardware/lepro/lib/lepro/session.py:134
No description documented yet.
on_notify(self, _sender: object, data: bytearray) -> None
self
_sender
object
data
bytearray
send
No description documented yet.
hardware/lepro/lib/lepro/session.py:140
No description documented yet.
send(self, data: bytes, label: str = '') -> None
self
data
bytes
label
str
= ''
recv
No description documented yet.
hardware/lepro/lib/lepro/session.py:145
No description documented yet.
recv(self, timeout: float) -> bytes | None
self
timeout
float
drain
No description documented yet.
hardware/lepro/lib/lepro/session.py:151
No description documented yet.
drain(self, timeout: float) -> list[bytes]
self
timeout
float
LeproSession
No description documented yet.
18 methods
__init__
No description documented yet.
hardware/lepro/lib/lepro/session.py:167
No description documented yet.
__init__(self, mac: str, transport: Transport, config: SessionConfig | None = None) -> None
self
mac
str
transport
Transport
config
SessionConfig | None
= None
_require_session_rand
No description documented yet.
hardware/lepro/lib/lepro/session.py:183
No description documented yet.
_require_session_rand(self) -> int
self
_send
No description documented yet.
hardware/lepro/lib/lepro/session.py:188
No description documented yet.
_send(self, pkt: bytes, label: str = '') -> None
self
pkt
bytes
label
str
= ''
_next_seq
No description documented yet.
hardware/lepro/lib/lepro/session.py:192
No description documented yet.
_next_seq(self) -> int
self
_ingest_rx
No description documented yet.
hardware/lepro/lib/lepro/session.py:197
No description documented yet.
_ingest_rx(self, raw: bytes) -> list[DecryptedFrame]
self
raw
bytes
_wait_opcode
No description documented yet.
hardware/lepro/lib/lepro/session.py:203
No description documented yet.
_wait_opcode(self, opcode: int, timeout: float | None = None) -> DecryptedFrame
self
opcode
int
timeout
float | None
= None
_wait_any
No description documented yet.
hardware/lepro/lib/lepro/session.py:217
No description documented yet.
_wait_any(self, opcodes: set[int], timeout: float) -> DecryptedFrame
self
opcodes
set[int]
timeout
float
run_phase_discovery
No description documented yet.
hardware/lepro/lib/lepro/session.py:231
No description documented yet.
run_phase_discovery(self) -> DeviceInfo
self
_wait_new_auth_resp
No description documented yet.
hardware/lepro/lib/lepro/session.py:269
No description documented yet.
_wait_new_auth_resp(self, after_count: int, timeout: float) -> DecryptedFrame
self
after_count
int
timeout
float
_request_bond
No description documented yet.
hardware/lepro/lib/lepro/session.py:285
No description documented yet.
_request_bond(self, payload: bytes, label: str) -> DecryptedFrame
self
payload
bytes
label
str
run_phase_bond
No description documented yet.
hardware/lepro/lib/lepro/session.py:290
No description documented yet.
run_phase_bond(self, fallback_hs: bytes | None = None) -> BondTokens
self
fallback_hs
bytes | None
= None
_wait_auth_resp
No description documented yet.
hardware/lepro/lib/lepro/session.py:321
No description documented yet.
_wait_auth_resp(self, timeout: float | None = None) -> DecryptedFrame
self
timeout
float | None
= None
run_phase_auth
No description documented yet.
hardware/lepro/lib/lepro/session.py:324
No description documented yet.
run_phase_auth(self, creds: BondCredentials) -> None
self
creds
BondCredentials
send_dp_ciphertext
No description documented yet.
hardware/lepro/lib/lepro/session.py:339
No description documented yet.
send_dp_ciphertext(self, ciphertext: bytes) -> None
self
ciphertext
bytes
send_dp_payload
No description documented yet.
hardware/lepro/lib/lepro/session.py:345
No description documented yet.
send_dp_payload(self, payload: DpPayload) -> None
self
payload
DpPayload
send_get_dp_state
No description documented yet.
hardware/lepro/lib/lepro/session.py:353
No description documented yet.
send_get_dp_state(self, payload: DpPayload) -> DecryptedFrame
self
payload
DpPayload
commit_control
No description documented yet.
hardware/lepro/lib/lepro/session.py:360
No description documented yet.
commit_control(self, creds: BondCredentials) -> None
self
creds
BondCredentials
run_control
Full control session. pre_bulk_pages is only for large scene uploads (capture 11:17 colour).
hardware/lepro/lib/lepro/session.py:379
Full control session. pre_bulk_pages is only for large scene uploads (capture 11:17 colour).
run_control(self, creds: BondCredentials, dp_payload: DpPayload, pre_bulk_pages: list[bytes] | None = None) -> None
self
creds
BondCredentials
dp_payload
DpPayload
pre_bulk_pages
list[bytes] | None
= None
Segment
No description documented yet.
2 methods
p_flags
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:48
No description documented yet.
p_flags(self) -> int
self
sh_flags
No description documented yet.
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py:63
No description documented yet.
sh_flags(self) -> int
self
Elf32
No description documented yet.
5 methods
__init__
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:123
No description documented yet.
__init__(self, data: bytes) -> None
self
data
bytes
u32
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:131
No description documented yet.
u32(self, off: int) -> int
self
off
int
vma_to_offset
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:134
No description documented yet.
vma_to_offset(self, vma: int) -> int | None
self
vma
int
read_cstr
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:146
No description documented yet.
read_cstr(self, vma: int) -> str | None
self
vma
int
pool_strings
No description documented yet.
hardware/lepro/lib/lepro/tools/validate_ota_parser.py:153
No description documented yet.
pool_strings(self, pool_vma: int, count: int) -> list[tuple[int, int, str | None]]
self
pool_vma
int
count
int
LeproSetup
Interactive setup process for Lepro devices.
3 methods
__init__
No description documented yet.
hardware/lepro/setup.py:15
No description documented yet.
__init__(self, base_dir: Path | None = None)
self
base_dir
Path | None
= None
run
No description documented yet.
hardware/lepro/setup.py:28
No description documented yet.
run(self) -> dict[str, Any]
self
fail
No description documented yet.
hardware/lepro/setup.py:254
No description documented yet.
fail(stage: str, message: str) -> dict[str, Any]
stage
str
message
str
DiscordAdapter
No description documented yet.
2 methods
__init__
No description documented yet.
interfaces/discord_bot.py:9
No description documented yet.
__init__(self, chat_engine, logger = None)
self
chat_engine
logger
= None
start
No description documented yet.
interfaces/discord_bot.py:13
No description documented yet.
start(self)
self
TerminalAdapter
No description documented yet.
2 methods
__init__
No description documented yet.
interfaces/terminal.py:9
No description documented yet.
__init__(self, chat_engine, logger = None)
self
chat_engine
logger
= None
run
No description documented yet.
interfaces/terminal.py:13
No description documented yet.
run(self)
self
WebUIAdapter
No description documented yet.
2 methods
__init__
No description documented yet.
interfaces/web_ui.py:6
No description documented yet.
__init__(self, chat_engine, logger = None)
self
chat_engine
logger
= None
start
No description documented yet.
interfaces/web_ui.py:10
No description documented yet.
start(self, host = '127.0.0.1', port = 8000)
self
host
= '127.0.0.1'
port
= 8000
EmbeddingsProvider
No description documented yet.
4 methods
__init__
No description documented yet.
memory/embeddings.py:9
No description documented yet.
__init__(self)
self
embed
No description documented yet.
memory/embeddings.py:12
No description documented yet.
embed(self, texts: List[str]) -> List[List[float]]
self
texts
List[str]
store_embeddings
No description documented yet.
memory/embeddings.py:15
No description documented yet.
store_embeddings(self, ids: List[int], vectors: List[List[float]])
self
ids
List[int]
vectors
List[List[float]]
query
No description documented yet.
memory/embeddings.py:18
No description documented yet.
query(self, vector: List[float], top_k: int = 5)
self
vector
List[float]
top_k
int
= 5
MemoryManager
No description documented yet.
1 methods
__init__
No description documented yet.
memory/memory.py:23
No description documented yet.
__init__(self, conn)
self
conn
ToolResult
No description documented yet.
0 methods
BaseTool
No description documented yet.
1 methods
call
No description documented yet.
tools/base.py:19
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
CalculatorTool
No description documented yet.
2 methods
_safe_eval
No description documented yet.
tools/calculator.py:13
No description documented yet.
_safe_eval(self, expr: str) -> float
self
expr
str
call
No description documented yet.
tools/calculator.py:23
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
ChartTool
General-purpose CYN-X visualization tool. The output is a structured object intended for the frontend.
18 methods
call
Main BaseTool entry point. ToolRouter calls: tool.call(args) and expects a ToolResult.
tools/chart_tool.py:68
Main BaseTool entry point. ToolRouter calls: tool.call(args) and expects a ToolResult.
call(self, args: Dict[str, Any]) -> ToolResult
self
args
Dict[str, Any]
create_chart
Create one complete chart specification.
tools/chart_tool.py:140
Create one complete chart specification.
create_chart(self, chart_type: str, title: str, data: List[Dict[str, Any]], x_key: str | None = None, series: List[Dict[str, Any]] | None = None, description: str | None = None, footer: str | None = None, x_axis_label: str | None = None, x_axis_scale: str | None = None, y_axis_min: float | None = None, y_axis_max: float | None = None, layout: str | None = None, name_key: str | None = None, value_key: str | None = None) -> Dict[str, Any]
self
chart_type
str
title
str
data
List[Dict[str, Any]]
x_key
str | None
= None
series
List[Dict[str, Any]] | None
= None
description
str | None
= None
footer
str | None
= None
x_axis_label
str | None
= None
x_axis_scale
str | None
= None
y_axis_min
float | None
= None
y_axis_max
float | None
= None
layout
str | None
= None
name_key
str | None
= None
value_key
str | None
= None
bar
No description documented yet.
tools/chart_tool.py:291
No description documented yet.
bar(self, title: str, data: List[Dict[str, Any]], x_key: str, series: List[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
x_key
str
series
List[Dict[str, Any]]
**kwargs
Any
line
No description documented yet.
tools/chart_tool.py:309
No description documented yet.
line(self, title: str, data: List[Dict[str, Any]], x_key: str, series: List[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
x_key
str
series
List[Dict[str, Any]]
**kwargs
Any
pie
No description documented yet.
tools/chart_tool.py:327
No description documented yet.
pie(self, title: str, data: List[Dict[str, Any]], name_key: str, value_key: str, series: List[Dict[str, Any]] | None = None, **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
name_key
str
value_key
str
series
List[Dict[str, Any]] | None
= None
**kwargs
Any
scatter
No description documented yet.
tools/chart_tool.py:347
No description documented yet.
scatter(self, title: str, data: List[Dict[str, Any]], x_key: str, series: List[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]
self
title
str
data
List[Dict[str, Any]]
x_key
str
series
List[Dict[str, Any]]
**kwargs
Any
make_series
Build a series definition. Example: ChartTool.make_series( data_key="cigarettes", label="Cigarettes", axis_label="Cigarettes", va…
tools/chart_tool.py:370
Build a series definition. Example: ChartTool.make_series( data_key="cigarettes", label="Cigarettes", axis_label="Cigarettes", value_format="integer", )
make_series(data_key: str, label: str | None = None, axis_label: str | None = None, value_format: str | None = None, value_prefix: str | None = None, value_suffix: str | None = None, stack: str | None = None) -> Dict[str, Any]
data_key
str
label
str | None
= None
axis_label
str | None
= None
value_format
str | None
= None
value_prefix
str | None
= None
value_suffix
str | None
= None
stack
str | None
= None
_normalize_chart_type
No description documented yet.
tools/chart_tool.py:447
No description documented yet.
_normalize_chart_type(chart_type: str) -> str
chart_type
str
_normalize_series
No description documented yet.
tools/chart_tool.py:459
No description documented yet.
_normalize_series(cls, series: List[Dict[str, Any]]) -> List[Dict[str, Any]]
cls
series
List[Dict[str, Any]]
_validate_chart_type
No description documented yet.
tools/chart_tool.py:554
No description documented yet.
_validate_chart_type(self, chart_type: str) -> None
self
chart_type
str
_validate_title
No description documented yet.
tools/chart_tool.py:570
No description documented yet.
_validate_title(title: str) -> None
title
str
_validate_data
No description documented yet.
tools/chart_tool.py:585
No description documented yet.
_validate_data(data: List[Dict[str, Any]]) -> None
data
List[Dict[str, Any]]
_validate_cartesian_chart
No description documented yet.
tools/chart_tool.py:607
No description documented yet.
_validate_cartesian_chart(chart_type: str, data: List[Dict[str, Any]], x_key: str | None, series: List[Dict[str, Any]]) -> None
chart_type
str
data
List[Dict[str, Any]]
x_key
str | None
series
List[Dict[str, Any]]
_validate_pie_chart
No description documented yet.
tools/chart_tool.py:648
No description documented yet.
_validate_pie_chart(data: List[Dict[str, Any]], name_key: str | None, value_key: str | None) -> None
data
List[Dict[str, Any]]
name_key
str | None
value_key
str | None
_validate_x_axis_scale
No description documented yet.
tools/chart_tool.py:705
No description documented yet.
_validate_x_axis_scale(chart_type: str, x_axis_scale: str, data: List[Dict[str, Any]], x_key: str | None) -> None
chart_type
str
x_axis_scale
str
data
List[Dict[str, Any]]
x_key
str | None
_validate_layout
No description documented yet.
tools/chart_tool.py:742
No description documented yet.
_validate_layout(layout: str) -> None
layout
str
_validate_y_axis
No description documented yet.
tools/chart_tool.py:752
No description documented yet.
_validate_y_axis(y_axis_min: float | None, y_axis_max: float | None) -> None
y_axis_min
float | None
y_axis_max
float | None
_format_output
Serialize the chart specification for ToolResult.output. ChatEngine can then parse/recognize the structured chart object rather t…
tools/chart_tool.py:792
Serialize the chart specification for ToolResult.output. ChatEngine can then parse/recognize the structured chart object rather than treating it as ordinary prose.
_format_output(chart: Dict[str, Any]) -> str
chart
Dict[str, Any]
ChartTool
No description documented yet.
3 methods
_ensure_db
No description documented yet.
tools/ChartTool.py:22
No description documented yet.
_ensure_db(self)
self
_smoke_data
No description documented yet.
tools/ChartTool.py:35
No description documented yet.
_smoke_data(self, scope: str = '7d', smoke_type: str | None = None)
self
scope
str
= '7d'
smoke_type
str | None
= None
call
No description documented yet.
tools/ChartTool.py:93
No description documented yet.
call(self, args: Dict[str, Any]) -> ToolResult
self
args
Dict[str, Any]
FilesystemTool
No description documented yet.
1 methods
call
No description documented yet.
tools/filesystem.py:15
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
LeproLightsTool
CYN-X tool for controlling Lepro lights.
3 methods
__init__
No description documented yet.
tools/lepro_lights.py:20
No description documented yet.
__init__(self, device_name: str, mac: str)
self
device_name
str
mac
str
schema
Return the tool schema exposed to CYN.
tools/lepro_lights.py:30
Return the tool schema exposed to CYN.
schema(self) -> dict[str, Any]
self
execute
Execute a light-control request.
tools/lepro_lights.py:86
Execute a light-control request.
execute(self, arguments: dict[str, Any]) -> ToolResult
self
arguments
dict[str, Any]
LeproLightsTool
CYN-X tool for controlling Lepro lights.
3 methods
__init__
No description documented yet.
tools/LeproLightsTool.py:20
No description documented yet.
__init__(self, device_name: str, mac: str)
self
device_name
str
mac
str
schema
Return the tool schema exposed to CYN.
tools/LeproLightsTool.py:30
Return the tool schema exposed to CYN.
schema(self) -> dict[str, Any]
self
execute
Execute a light-control request.
tools/LeproLightsTool.py:86
Execute a light-control request.
execute(self, arguments: dict[str, Any]) -> ToolResult
self
arguments
dict[str, Any]
SmokeCounterTool
Conversational smoke counter for CYN Studio. This class intentionally does NOT use input() or print(). CYN can call it…
1 methods
call
Flexible call interface: - If args is a dict (tool_router), use it. - Otherwise accept keyword args for backward compatibility. R…
tools/SmokeCounterTool.py:611
Flexible call interface: - If args is a dict (tool_router), use it. - Otherwise accept keyword args for backward compatibility. Returns a ToolResult with a human-readable output and metadata containing the raw result dict.
call(self, args = None, action: str = 'stats', smoke_type: Optional[str] = None, amount: float = 1, limit: int = 10, scope: str = 'all') -> ToolResult
self
args
= None
action
str
= 'stats'
smoke_type
Optional[str]
= None
amount
float
= 1
limit
int
= 10
scope
str
= 'all'
ToolRouter
No description documented yet.
9 methods
__init__
No description documented yet.
tools/tool_router.py:16
No description documented yet.
__init__(self)
self
register_tool
No description documented yet.
tools/tool_router.py:20
No description documented yet.
register_tool(self, tool: BaseTool)
self
tool
BaseTool
list_tools
No description documented yet.
tools/tool_router.py:24
No description documented yet.
list_tools(self)
self
describe_tools
Gives the AI a list of available tools.
tools/tool_router.py:28
Gives the AI a list of available tools.
describe_tools(self)
self
as_ollama_tools
Convert the registered tools into Ollama function-calling schemas.
tools/tool_router.py:41
Convert the registered tools into Ollama function-calling schemas.
as_ollama_tools(self)
self
call_tool
No description documented yet.
tools/tool_router.py:180
No description documented yet.
call_tool(self, name: str, args: Dict[str, Any]) -> ToolResult
self
name
str
args
Dict[str, Any]
normalize_smoke_type
Normalize a freeform smoke_type string into a canonical type (pen, vape, cigarette, bong, weed, joint, unknown).
tools/tool_router.py:215
Normalize a freeform smoke_type string into a canonical type (pen, vape, cigarette, bong, weed, joint, unknown).
normalize_smoke_type(self, text: str)
self
text
str
is_read_only_smoke_query
Return True when the request is asking for counts/stats/history instead of logging.
tools/tool_router.py:244
Return True when the request is asking for counts/stats/history instead of logging.
is_read_only_smoke_query(self, text: str) -> bool
self
text
str
detect
Detect whether a message requires a tool.
tools/tool_router.py:285
Detect whether a message requires a tool.
detect(self, text: str)
self
text
str
WeatherTool
No description documented yet.
1 methods
call
No description documented yet.
tools/weather.py:12
No description documented yet.
call(self, args: Dict) -> ToolResult
self
args
Dict
OutputMode
No description documented yet.
0 methods
RankingProfile
No description documented yet.
0 methods
SearchIntent
No description documented yet.
0 methods
ResultFilter
No description documented yet.
2 methods
__init__
No description documented yet.
tools/web_search.py:837
No description documented yet.
__init__(self)
self
is_bad_result
No description documented yet.
tools/web_search.py:841
No description documented yet.
is_bad_result(self, title: str, body: str, href: str) -> bool
self
title
str
body
str
href
str
ResultRanker
No description documented yet.
8 methods
__init__
No description documented yet.
tools/web_search.py:897
No description documented yet.
__init__(self, intent: SearchIntent)
self
intent
SearchIntent
rank
No description documented yet.
tools/web_search.py:905
No description documented yet.
rank(self, title: str, body: str, href: str) -> int
self
title
str
body
str
href
str
score_keywords
No description documented yet.
tools/web_search.py:980
No description documented yet.
score_keywords(title: str, combined: str, keywords: tuple[str, ...], title_weight: int, body_weight: int) -> int
title
str
combined
str
keywords
tuple[str, ...]
title_weight
int
body_weight
int
score_negative
No description documented yet.
tools/web_search.py:1002
No description documented yet.
score_negative(self, title: str, combined: str) -> int
self
title
str
combined
str
output_bonus
No description documented yet.
tools/web_search.py:1022
No description documented yet.
output_bonus(self, title: str) -> int
self
title
str
store_bonus
No description documented yet.
tools/web_search.py:1065
No description documented yet.
store_bonus(self, href: str) -> int
self
href
str
domain_bonus
No description documented yet.
tools/web_search.py:1080
No description documented yet.
domain_bonus(href: str) -> int
href
str
research_source_bonus
No description documented yet.
tools/web_search.py:1110
No description documented yet.
research_source_bonus(href: str) -> int
href
str
WebSearchTool
No description documented yet.
2 methods
call
No description documented yet.
tools/web_search.py:1547
No description documented yet.
call(self, args)
self
args
format_result
No description documented yet.
tools/web_search.py:1913
No description documented yet.
format_result(title: str, body: str, href: str, score: int = 0, source_type: str = 'unknown') -> str
title
str
body
str
href
str
score
int
= 0
source_type
str
= 'unknown'
AudioPlayer
Platform-aware audio playback. Uses native system audio players: - Windows: winsound (built-in) or powershell - macOS:…
4 methods
play
Play a WAV audio file. Args: filepath (str): Path to the WAV file to play Raises: FileNotFoundError: If the audio file doesn't ex…
voice/audio_player.py:18
Play a WAV audio file. Args: filepath (str): Path to the WAV file to play Raises: FileNotFoundError: If the audio file doesn't exist RuntimeError: If playback fails
play(self, filepath)
self
filepath
_play_windows
Play audio on Windows using PowerShell.
voice/audio_player.py:42
Play audio on Windows using PowerShell.
_play_windows(self, filepath)
self
filepath
_play_macos
Play audio on macOS using afplay.
voice/audio_player.py:57
Play audio on macOS using afplay.
_play_macos(self, filepath)
self
filepath
_play_linux
Play audio on Linux using available tools.
voice/audio_player.py:66
Play audio on Linux using available tools.
_play_linux(self, filepath)
self
filepath
PiperTTS
Local Piper TTS engine for converting text to speech. Piper is a lightweight, fast, on-device Text-to-Speech (TTS) syst…
2 methods
__init__
Initialize PiperTTS with a specific model. Args: model_path (str): Path to the .onnx model file e.g., "models/voices/cyn_normal.o…
voice/piper_engine.py:33
Initialize PiperTTS with a specific model. Args: model_path (str): Path to the .onnx model file e.g., "models/voices/cyn_normal.onnx" Raises: FileNotFoundError: If the model file doesn't exist
__init__(self, model_path)
self
model_path
generate
Generate speech from text using Piper TTS. Args: text (str): The text to convert to speech output_file (str): Path where the WAV…
voice/piper_engine.py:53
Generate speech from text using Piper TTS. Args: text (str): The text to convert to speech output_file (str): Path where the WAV file will be saved Returns: str: Path to the generated WAV file Raises: RuntimeError: If Piper subprocess fails or is not installed
generate(self, text, output_file = 'cyn_output.wav')
self
text
output_file
= 'cyn_output.wav'
TTSEngine
No description documented yet.
2 methods
__init__
No description documented yet.
voice/tts_engine.py:6
No description documented yet.
__init__(self)
self
generate
No description documented yet.
voice/tts_engine.py:13
No description documented yet.
generate(self, text, output = 'cyn_output.wav')
self
text
output
= 'cyn_output.wav'
VoiceManager
Decoupled voice synthesis coordinator. Architecture: Text Response (from ChatEngine) | v VoiceManager.speak(text) | +--…
2 methods
__init__
Initialize VoiceManager with TTS and playback engines. Args: tts: TTS engine (e.g., PiperTTS) with generate(text) method player:…
voice/voice_manager.py:26
Initialize VoiceManager with TTS and playback engines. Args: tts: TTS engine (e.g., PiperTTS) with generate(text) method player: Audio player (e.g., AudioPlayer) with play(filepath) method
__init__(self, tts, player)
self
tts
player
speak
Generate speech from text and play it immediately. Args: text (str): The text to speak Raises: Exception: Propagates errors from…
voice/voice_manager.py:37
Generate speech from text and play it immediately. Args: text (str): The text to speak Raises: Exception: Propagates errors from TTS or playback
speak(self, text)
self
text
Modules
A lightweight map of source files and their discovered contents.
ai/__init__.py
0 symbols
0 imports
ai/chat_engine.py
7 symbols
7 imports
ai/context_manager.py
3 symbols
0 imports
ai/knowledge/store.py
5 symbols
1 imports
ai/memory_system/__init__.py
0 symbols
2 imports
ai/memory_system/extractor.py
11 symbols
3 imports
ai/memory_system/manager.py
10 symbols
1 imports
ai/mode_manager.py
7 symbols
1 imports
ai/ollama_client.py
5 symbols
5 imports
ai/personality.py
11 symbols
3 imports
ai/prompt_builder.py
13 symbols
2 imports
ai/prompt_manager.py
11 symbols
3 imports
ai/terminal_ui/__init__.py
0 symbols
1 imports
ai/terminal_ui/colors.py
0 symbols
0 imports
ai/terminal_ui/renderer.py
23 symbols
6 imports
barkly_docs.py
66 symbols
10 imports
benchmark/__init__.py
0 symbols
0 imports
benchmark/analyzer.py
5 symbols
2 imports
benchmark/cleaner.py
10 symbols
3 imports
benchmark/cli.py
1 symbols
1 imports
benchmark/formatter.py
1 symbols
1 imports
benchmark/modes.py
2 symbols
1 imports
benchmark/runner.py
26 symbols
25 imports
benchmark/visualize.py
4 symbols
7 imports
clean_cyn.py
2 symbols
1 imports
config.py
3 symbols
5 imports
count_results.py
0 symbols
0 imports
cyndiscord.py
2 symbols
16 imports
hardware/lepro/__init__.py
0 symbols
0 imports
hardware/lepro/config.py
7 symbols
4 imports
hardware/lepro/devices.py
12 symbols
7 imports
hardware/lepro/discovery.py
4 symbols
3 imports
hardware/lepro/lib/lepro/__init__.py
0 symbols
0 imports
hardware/lepro/lib/lepro/apk_analysis.py
0 symbols
1 imports
hardware/lepro/lib/lepro/bond.py
24 symbols
11 imports
hardware/lepro/lib/lepro/cli/__init__.py
0 symbols
0 imports
hardware/lepro/lib/lepro/cli/_common.py
5 symbols
8 imports
hardware/lepro/lib/lepro/cli/bond.py
3 symbols
10 imports
hardware/lepro/lib/lepro/cli/ctl.py
2 symbols
9 imports
hardware/lepro/lib/lepro/cli/firmware.py
5 symbols
10 imports
hardware/lepro/lib/lepro/cli/ota.py
1 symbols
5 imports
hardware/lepro/lib/lepro/cli/provision.py
2 symbols
6 imports
hardware/lepro/lib/lepro/cli/status.py
1 symbols
5 imports
hardware/lepro/lib/lepro/commands.py
11 symbols
6 imports
hardware/lepro/lib/lepro/config.py
7 symbols
6 imports
hardware/lepro/lib/lepro/crypto.py
13 symbols
4 imports
hardware/lepro/lib/lepro/firmware_profile.py
12 symbols
7 imports
hardware/lepro/lib/lepro/frame.py
18 symbols
5 imports
hardware/lepro/lib/lepro/modes.py
24 symbols
10 imports
hardware/lepro/lib/lepro/ota.py
55 symbols
18 imports
hardware/lepro/lib/lepro/patch_cdn.py
23 symbols
15 imports
hardware/lepro/lib/lepro/paths.py
1 symbols
2 imports
hardware/lepro/lib/lepro/protocol.py
12 symbols
3 imports
hardware/lepro/lib/lepro/provision.py
11 symbols
12 imports
hardware/lepro/lib/lepro/session.py
38 symbols
13 imports
hardware/lepro/lib/lepro/tools/__init__.py
0 symbols
0 imports
hardware/lepro/lib/lepro/tools/debug_hijack.py
10 symbols
14 imports
hardware/lepro/lib/lepro/tools/decrypt_capture.py
3 symbols
8 imports
hardware/lepro/lib/lepro/tools/esp_idf_bin_to_elf.py
9 symbols
6 imports
hardware/lepro/lib/lepro/tools/mqtt_ca_dump.py
7 symbols
10 imports
hardware/lepro/lib/lepro/tools/replay.py
1 symbols
5 imports
hardware/lepro/lib/lepro/tools/validate_ota_parser.py
9 symbols
8 imports
hardware/lepro/setup.py
5 symbols
7 imports
hardware/web/app.py
3 symbols
22 imports
interfaces/discord_bot.py
3 symbols
1 imports
interfaces/terminal.py
3 symbols
2 imports
interfaces/web/app.py
3 symbols
22 imports
interfaces/web_ui.py
3 symbols
0 imports
main.py
1 symbols
17 imports
memory/embeddings.py
5 symbols
1 imports
memory/memory.py
3 symbols
1 imports
memory/sqlite.py
3 symbols
2 imports
memory/test_memory.py
0 symbols
2 imports
run_30_after_fix.py
0 symbols
5 imports
scripts/test_tool_pipeline.py
0 symbols
2 imports
test_refactor.py
8 symbols
2 imports
tests/__init__.py
0 symbols
0 imports
tests/auto_promt_test.py
5 symbols
6 imports
tests/integration_check.py
0 symbols
9 imports
tests/parse_temp_output.py
0 symbols
1 imports
tests/test_memory_system.py
1 symbols
6 imports
tests/test_prompt_builder.py
1 symbols
1 imports
tests/test_smoke_pipeline.py
0 symbols
16 imports
tests/verify_refactoring.py
9 symbols
5 imports
tools/base.py
3 symbols
2 imports
tools/calculator.py
3 symbols
3 imports
tools/chart_tool.py
19 symbols
3 imports
tools/ChartTool.py
4 symbols
5 imports
tools/filesystem.py
2 symbols
3 imports
tools/lepro_lights.py
4 symbols
4 imports
tools/LeproLightsTool.py
4 symbols
4 imports
tools/SmokeCounterTool.py
15 symbols
10 imports
tools/tool_router.py
10 symbols
2 imports
tools/weather.py
2 symbols
2 imports
tools/web_search.py
29 symbols
8 imports
voice/__init__.py
0 symbols
3 imports
voice/audio_player.py
5 symbols
3 imports
voice/piper_engine.py
3 symbols
3 imports
voice/tts_engine.py
3 symbols
1 imports
voice/voice_manager.py
3 symbols
0 imports
Imports
Dependencies discovered from Python import statements.
Lifecycle
The development path used by the project.
Git
Repository state and recent development history.
49f400b|2026-09-26|fixed barkly docs to be more usefull
c7eb7b8|2026-09-26|added barkly docs
a0b3c48|2026-09-14|woring on getting sutff orking
9fe7724|2026-09-14|fixed runner
46cc3a8|2026-09-14|added more content to more of the context md
efebbb3|2026-09-14|added more content to more of the context md
2c3bff1|2026-09-14|added more content to more of the context md
0235a13|2026-09-14|added more content to more of the context md
Changelog
What BARKLY DOCS noticed changed between documentation generations.
BARKLY DOCS stores a small local snapshot of discovered symbols and compares the next scan against it. The scanner uses static Python AST analysis and never imports or executes the project.
On the first generation, the existing project becomes the baseline. Later generations can identify newly discovered and changed functions, methods, classes, and API endpoints.