Skip to content

Commit 13ec6d3

Browse files
committed
Merge remote-tracking branch 'origin/main' into bskiser/add-agent-crate
2 parents fbf08eb + a275492 commit 13ec6d3

29 files changed

+2005
-850
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Amazon Q CLI Team ([email protected])", "Chay Nabors (nabochay@amazon
88
edition = "2024"
99
homepage = "https://aws.amazon.com/q/"
1010
publish = false
11-
version = "1.18.0"
11+
version = "1.19.2"
1212
license = "MIT OR Apache-2.0"
1313

1414
[workspace.dependencies]
@@ -18,7 +18,7 @@ amzn-consolas-client = { path = "crates/amzn-consolas-client" }
1818
amzn-qdeveloper-streaming-client = { path = "crates/amzn-qdeveloper-streaming-client" }
1919
amzn-toolkit-telemetry-client = { path = "crates/amzn-toolkit-telemetry-client" }
2020
anstream = "0.6.13"
21-
arboard = { version = "3.5.0", default-features = false }
21+
arboard = { version = "3.6.1", default-features = false, features = ["image-data"] }
2222
assert_cmd = "2.0"
2323
async-trait = "0.1.87"
2424
aws-config = "1.0.3"
@@ -74,6 +74,7 @@ parking_lot = "0.12.3"
7474
paste = "1.0.11"
7575
pdf-extract = "0.10.0"
7676
percent-encoding = "2.2.0"
77+
image = "0.25"
7778
predicates = "3.0"
7879
prettyplease = "0.2.32"
7980
quote = "1.0.40"

build-config/buildspec-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ phases:
2222
- . "$HOME/.cargo/env"
2323
- rustup toolchain install `cat rust-toolchain.toml | grep channel | cut -d '=' -f2 | tr -d ' "'`
2424
# Install cross only if the musl env var is set and not null
25-
- if [ ! -z "${AMAZON_Q_BUILD_MUSL:+x}" ]; then cargo install cross --git https://github.com/cross-rs/cross; fi
25+
- if [ ! -z "${AMAZON_Q_BUILD_MUSL:+x}" ]; then cargo install cross --git https://github.com/cross-rs/cross --locked; fi
2626
# Install python/node via mise (https://mise.jdx.dev/continuous-integration.html)
2727
- curl --retry 5 --proto '=https' --tlsv1.2 -sSf https://mise.run | sh
2828
- mise install

crates/chat-cli-ui/src/conduit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl std::io::Write for ControlEnd<DestinationStdout> {
298298
if byte == &10 || byte == &13 {
299299
if self.current_event.is_none() {
300300
self.current_event
301-
.replace(Event::LegacyPassThrough(LegacyPassThroughOutput::Stderr(
301+
.replace(Event::LegacyPassThrough(LegacyPassThroughOutput::Stdout(
302302
Default::default(),
303303
)));
304304
}
@@ -323,7 +323,7 @@ impl std::io::Write for ControlEnd<DestinationStdout> {
323323
if start < end {
324324
if self.current_event.is_none() {
325325
self.current_event
326-
.replace(Event::LegacyPassThrough(LegacyPassThroughOutput::Stderr(
326+
.replace(Event::LegacyPassThrough(LegacyPassThroughOutput::Stdout(
327327
Default::default(),
328328
)));
329329
}

crates/chat-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ owo-colors.workspace = true
7171
parking_lot.workspace = true
7272
paste.workspace = true
7373
percent-encoding.workspace = true
74+
image.workspace = true
7475
r2d2.workspace = true
7576
r2d2_sqlite.workspace = true
7677
rand.workspace = true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn client(region: Region) -> Client {
8787
Client::new(
8888
&aws_types::SdkConfig::builder()
8989
.http_client(crate::aws_common::http_client::client())
90-
.behavior_version(BehaviorVersion::v2025_01_17())
90+
.behavior_version(BehaviorVersion::v2025_08_07())
9191
.endpoint_url(oidc_url(&region))
9292
.region(region)
9393
.retry_config(RetryConfig::standard().with_max_attempts(3))

crates/chat-cli/src/aws_common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn app_name() -> AppName {
1717
}
1818

1919
pub fn behavior_version() -> BehaviorVersion {
20-
BehaviorVersion::v2025_01_17()
20+
BehaviorVersion::v2025_08_07()
2121
}
2222

2323
#[cfg(test)]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn hook_matches_tool(hook: &Hook, tool_name: &str) -> bool {
7676

7777
// Use matches_any_pattern for both MCP and built-in tools
7878
let mut patterns = std::collections::HashSet::new();
79-
patterns.insert(pattern.clone());
79+
patterns.insert(pattern.as_str());
8080
matches_any_pattern(&patterns, tool_name)
8181
},
8282
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub mod knowledge;
1111
pub mod logdump;
1212
pub mod mcp;
1313
pub mod model;
14+
pub mod paste;
1415
pub mod persist;
1516
pub mod profile;
1617
pub mod prompts;
@@ -33,6 +34,7 @@ use knowledge::KnowledgeSubcommand;
3334
use logdump::LogdumpArgs;
3435
use mcp::McpArgs;
3536
use model::ModelArgs;
37+
use paste::PasteArgs;
3638
use persist::PersistSubcommand;
3739
use profile::AgentSubcommand;
3840
use prompts::PromptsArgs;
@@ -123,6 +125,8 @@ pub enum SlashCommand {
123125
/// View, manage, and resume to-do lists
124126
#[command(subcommand)]
125127
Todos(TodoSubcommand),
128+
/// Paste an image from clipboard
129+
Paste(PasteArgs),
126130
}
127131

128132
impl SlashCommand {
@@ -191,6 +195,7 @@ impl SlashCommand {
191195
// },
192196
Self::Checkpoint(subcommand) => subcommand.execute(os, session).await,
193197
Self::Todos(subcommand) => subcommand.execute(os, session).await,
198+
Self::Paste(args) => args.execute(os, session).await,
194199
}
195200
}
196201

@@ -223,6 +228,7 @@ impl SlashCommand {
223228
},
224229
Self::Checkpoint(_) => "checkpoint",
225230
Self::Todos(_) => "todos",
231+
Self::Paste(_) => "paste",
226232
}
227233
}
228234

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
use clap::Args;
2+
use crossterm::execute;
3+
use crossterm::style::{
4+
self,
5+
Color,
6+
};
7+
8+
use crate::cli::chat::util::clipboard::paste_image_from_clipboard;
9+
use crate::cli::chat::{
10+
ChatError,
11+
ChatSession,
12+
ChatState,
13+
};
14+
use crate::os::Os;
15+
16+
#[derive(Debug, Args, PartialEq)]
17+
pub struct PasteArgs;
18+
19+
impl PasteArgs {
20+
pub async fn execute(self, _os: &mut Os, session: &mut ChatSession) -> Result<ChatState, ChatError> {
21+
match paste_image_from_clipboard() {
22+
Ok(path) => Ok(ChatState::HandleInput {
23+
input: path.display().to_string(),
24+
}),
25+
Err(e) => {
26+
execute!(
27+
session.stderr,
28+
style::SetForegroundColor(Color::Red),
29+
style::Print("❌ Failed to paste image: "),
30+
style::SetForegroundColor(Color::Reset),
31+
style::Print(format!("{}\n", e))
32+
)?;
33+
34+
Ok(ChatState::PromptUser {
35+
skip_printing_tools: false,
36+
})
37+
},
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)