main
md 47 lines 2.92 KB
Rendered Raw
1 # integration_commands.py DOX
2
3 ## Purpose
4
5 - Own the `integration_commands.py` helper module.
6 - This module parses external integration slash commands such as project/model/send controls.
7 - Keep this file-level DOX profile synchronized with `integration_commands.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `integration_commands.py` owns the runtime implementation.
12 - `integration_commands.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Public command helpers are `extract_command_line`, `parse_command`, `resolve_command`, `telegram_menu_commands`, `command_names`, `help_text`, `unknown_command_text`, and `try_handle_command`.
14 - Internal handlers own queue, status, session, lifecycle, toggle, project, model-preset, and agent-profile commands.
15 - Notable constants are `COMMAND_REGISTRY`, `_CLEAR_VALUES`, and `_MODEL_INHERIT_VALUES`.
16
17 ## Runtime Contracts
18
19 - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together.
20 - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change.
21 - Observed side-effect areas: filesystem writes, model calls, plugin state, settings/state persistence.
22 - Imported dependency areas include: `__future__`, `helpers`, `helpers.persist_chat`, `helpers.state_monitor_integration`, `plugins._model_config.helpers`, `re`, `typing`.
23 - `/agent` switches the top-level chat profile and preserves existing
24 subordinate agent profiles. Choices come from the shared presentation
25 catalog, though status may report an existing chat using the utility profile.
26 - `/model <preset>` stores a per-chat global preset reference, `/model inherit` clears it, and status always reports the effective scoped-or-chat preset. `Default` is a real selectable preset, not an alias for clearing the chat selection.
27
28 ## Key Concepts
29
30 - Important called helpers/classes include `mq.get_queue`, `mq.send_all_aggregated`, `mark_dirty_for_context`, `projects.activate_project`, `initialize_agent`, `model_config.get_effective_preset_name`, `model_config.get_presets`, `context.get_data`, `context.set_data`, and `save_tmp_chat`.
31 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
32
33 ## Work Guidance
34
35 - Preserve public helper APIs used by core code and plugins unless every caller is updated.
36 - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded.
37 - Prefer adding cohesive helper functions here only when behavior is reused across modules.
38
39 ## Verification
40
41 - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers.
42 - Related tests observed by source search:
43 - `tests/test_subagent_profiles.py`
44
45 ## Child DOX Index
46
47 No child DOX files.