use serde_json::{Value, json};
use super::tool;
pub(super) fn console_tools() -> Vec<Value> {
vec![
tool(
"console_metrics",
"Return the standard trusty-console metrics report for trusty-mpm: \
service id, display name, version, coarse health status, and a \
`metrics` payload carrying the managed-session fleet snapshot \
(counts by lifecycle state) and the supervisor auto-resume control \
state. Polled uniformly by trusty-console for the dashboard.",
json!({
"type": "object",
"properties": {},
"additionalProperties": false
}),
),
tool(
"supervisor_status",
"Return the managed-session fleet snapshot and the supervisor \
auto-resume control state as `{ fleet, auto_resume }`. `fleet` carries \
counts by lifecycle state (provisioning/active/stopped/errored/\
decommissioned), pending decisions, and last activity; `auto_resume` \
carries the persisted desired flag, the supervisor's boot-time env \
flag, and whether a restart is pending.",
json!({
"type": "object",
"properties": {},
"additionalProperties": false
}),
),
tool(
"auto_resume_set",
"Enable or disable supervisor auto-resume by persisting the operator's \
desired flag to `~/.trusty-mpm/auto_resume`. The 24/7 supervisor reads \
this on its next sweep; the env var the supervisor booted with stays \
in force until then (the response's `pending_restart` flags the \
difference). This is the console's non-CLI auto-resume control.",
json!({
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "True to enable auto-resume of stopped sessions; false to disable."
}
},
"required": ["enabled"],
"additionalProperties": false
}),
),
tool(
"config_read",
"Read trusty-mpm's `~/.trusty-tools/trusty-mpm/config.yaml` (the #1220 \
cross-crate config convention) and return its current settings as JSON: \
`workspace_root_template`, `auto_resume`, and `default_model`. An absent \
file returns the defaults (all null). Backs the trusty-console Config tab.",
json!({
"type": "object",
"properties": {},
"additionalProperties": false
}),
),
tool(
"config_write",
"Write trusty-mpm's `~/.trusty-tools/trusty-mpm/config.yaml` (#1220). \
Supplied fields replace the corresponding settings; omitted fields are \
left unchanged. `workspace_root_template` sets the managed-session \
workspace root (a leading `~` is expanded); `auto_resume` sets the \
supervisor default; `default_model` sets the launch model. Returns the \
merged config that was persisted.",
json!({
"type": "object",
"properties": {
"workspace_root_template": {
"type": "string",
"description": "Template dir for session workspaces (e.g. `~/trusty-mpm-projects`)."
},
"auto_resume": {
"type": "boolean",
"description": "Default supervisor auto-resume preference."
},
"default_model": {
"type": "string",
"description": "Default model id or tier alias for launched sessions."
}
},
"additionalProperties": false
}),
),
]
}