From ddab1863155ea5cfba48409790c376a99e580fcb Mon Sep 17 00:00:00 2001 From: teernisse Date: Wed, 11 Mar 2026 10:29:56 -0400 Subject: [PATCH] feat(me): include GitLab base URL in robot meta for URL construction The `me` dashboard robot output now includes `meta.gitlab_base_url` so consuming agents can construct clickable issue/MR links without needing access to the lore config file. The pattern is: {gitlab_base_url}/{project}/-/issues/{iid} {gitlab_base_url}/{project}/-/merge_requests/{iid} This uses the new RobotMeta::with_base_url() constructor. The base URL is sourced from config.gitlab.base_url (already available in the me command's execution context) and normalized to strip trailing slashes. robot-docs updated to document the new meta field and URL construction pattern for the me command's response schema. Co-Authored-By: Claude Opus 4.6 --- src/app/robot_docs.rs | 5 +++-- src/cli/commands/me/mod.rs | 2 +- src/cli/commands/me/render_robot.rs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/robot_docs.rs b/src/app/robot_docs.rs index efd6dfe..2c2d8c1 100644 --- a/src/app/robot_docs.rs +++ b/src/app/robot_docs.rs @@ -382,7 +382,7 @@ fn handle_robot_docs(robot_mode: bool, brief: bool) -> Result<(), Box Result<(), Box.json. --project filters display only for since-last-check; cursor still advances for all projects for that user." + "cursor_persistence": "Stored per user in ~/.local/share/lore/me_cursor_.json. --project filters display only for since-last-check; cursor still advances for all projects for that user.", + "url_construction": "Use meta.gitlab_base_url + project + entity_type + iid to build links: {gitlab_base_url}/{project}/-/{issues|merge_requests}/{iid}" } }, "robot-docs": { diff --git a/src/cli/commands/me/mod.rs b/src/cli/commands/me/mod.rs index 0e7a8b2..a60c7b2 100644 --- a/src/cli/commands/me/mod.rs +++ b/src/cli/commands/me/mod.rs @@ -247,7 +247,7 @@ pub fn run_me(config: &Config, args: &MeArgs, robot_mode: bool) -> Result<()> { if robot_mode { let fields = args.fields.as_deref(); - render_robot::print_me_json(&dashboard, elapsed_ms, fields)?; + render_robot::print_me_json(&dashboard, elapsed_ms, fields, &config.gitlab.base_url)?; } else if show_all { render_human::print_me_dashboard(&dashboard, single_project); } else { diff --git a/src/cli/commands/me/render_robot.rs b/src/cli/commands/me/render_robot.rs index 042ea58..48cb217 100644 --- a/src/cli/commands/me/render_robot.rs +++ b/src/cli/commands/me/render_robot.rs @@ -15,11 +15,12 @@ pub fn print_me_json( dashboard: &MeDashboard, elapsed_ms: u64, fields: Option<&[String]>, + gitlab_base_url: &str, ) -> crate::core::error::Result<()> { let envelope = MeJsonEnvelope { ok: true, data: MeDataJson::from_dashboard(dashboard), - meta: RobotMeta { elapsed_ms }, + meta: RobotMeta::with_base_url(elapsed_ms, gitlab_base_url), }; let mut value = serde_json::to_value(&envelope)