Skip to content

Commit 06dc7c9

Browse files
committed
merge main
2 parents 87e53cc + 02e7741 commit 06dc7c9

File tree

17 files changed

+600
-126
lines changed

17 files changed

+600
-126
lines changed

Cargo.lock

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/chat-cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ clap = { version = "4.5.32", features = [
5454
] }
5555
clap_complete = "4.5.46"
5656
clap_complete_fig = "4.4.0"
57-
color-eyre = "0.6.2"
57+
color-eyre = "0.6.5"
5858
color-print = "0.3.5"
5959
convert_case = "0.8.0"
6060
cookie = "0.18.1"
@@ -149,6 +149,7 @@ tracing-subscriber = { version = "0.3.19", features = [
149149
"parking_lot",
150150
"time",
151151
] }
152+
typed-path = "0.11.0"
152153
unicode-width = "0.2.0"
153154
url = "2.5.4"
154155
uuid = { version = "1.15.1", features = ["v4", "serde"] }

crates/chat-cli/src/auth/builder_id.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,16 @@ pub async fn logout(database: &mut Database) -> Result<(), AuthError> {
536536
Ok(())
537537
}
538538

539+
pub async fn get_start_url_and_region(database: &Database) -> (Option<String>, Option<String>) {
540+
// NOTE: Database provides direct methods to access the start_url and region, but they are not
541+
// guaranteed to be up to date in the chat session. Example: login is changed mid-chat session.
542+
let token = BuilderIdToken::load(database).await;
543+
match token {
544+
Ok(Some(t)) => (t.start_url, t.region),
545+
_ => (None, None),
546+
}
547+
}
548+
539549
#[derive(Debug, Clone)]
540550
pub struct BearerResolver;
541551

crates/chat-cli/src/cli/chat/mcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn resolve_scope_profile(ctx: &Context, scope: Option<Scope>) -> Result<PathBuf>
256256

257257
fn expand_path(ctx: &Context, p: &str) -> Result<PathBuf> {
258258
let p = shellexpand::tilde(p);
259-
let mut path = PathBuf::from(p.as_ref());
259+
let mut path = PathBuf::from(p.as_ref() as &str);
260260
if path.is_relative() {
261261
path = ctx.env().current_dir()?.join(path);
262262
}

0 commit comments

Comments
 (0)