API Reference / agent / tools / system /

self_update.py

In-place package upgrade.

Functions

Func

execute_self_update

Line 13
execute_self_update(**kwargs) -> Dict[str, Any]

Upgrade tuiml to the latest PyPI version using the detected installer.

Backs the tuiml_self_update tool. Editable/dev checkouts are refused; use git pull there instead.

Parameters

target_version
str = None
Specific version to install; defaults to the latest release (arrives via **kwargs, like all parameters below).
dry_run
bool = False
Only report the command that would run; make no changes.
_progress_callback
callable = None
Internal phase progress hook; stripped from recorded args. Called with {"type": "update_progress", "phase": ..., "message": ...} as the upgrade moves between phases. The installer subprocess can run for minutes with its output captured, so callers that front a UI need these to show the command is alive.

Returns

result
dict
On success: status ('success'), install_method, command, returncode, stdout, stderr, version_before, version_after, restart_required and note (dry runs return dry_run and command only). On failure: status ('error'), error and error_type. A dry run always succeeds: in an editable checkout, where a real upgrade is refused, it reports that refusal as its prediction with command set to None, rather than failing.