mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-07 16:44:50 +08:00
Merge remote-tracking branch 'origin/omx-issue-9201-release-ci'
# Conflicts: # .github/workflows/rust-ci.yml # rust/crates/rusty-claude-cli/src/main.rs
This commit is contained in:
60
.github/workflows/rust-ci.yml
vendored
60
.github/workflows/rust-ci.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: rust-ci
|
name: Rust CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -6,33 +6,51 @@ on:
|
|||||||
- main
|
- main
|
||||||
- 'gaebal/**'
|
- 'gaebal/**'
|
||||||
- 'omx-issue-*'
|
- 'omx-issue-*'
|
||||||
|
paths:
|
||||||
|
- .github/workflows/rust-ci.yml
|
||||||
|
- rust/**
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- .github/workflows/rust-ci.yml
|
||||||
|
- rust/**
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: rust-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: rust
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rust-ci:
|
fmt:
|
||||||
|
name: cargo fmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: rust
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: Cache cargo
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
with:
|
||||||
workspaces: rust
|
workspaces: rust -> target
|
||||||
|
- name: Check formatting
|
||||||
- name: cargo fmt
|
|
||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
- name: cargo clippy
|
test-rusty-claude-cli:
|
||||||
run: cargo clippy -p rusty-claude-cli --bin claw --no-deps -- -D warnings
|
name: cargo test -p rusty-claude-cli
|
||||||
|
runs-on: ubuntu-latest
|
||||||
- name: cargo test
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: rust -> target
|
||||||
|
- name: Run crate tests
|
||||||
run: cargo test -p rusty-claude-cli
|
run: cargo test -p rusty-claude-cli
|
||||||
|
|||||||
@@ -322,7 +322,10 @@ impl AnthropicClient {
|
|||||||
.with_property(
|
.with_property(
|
||||||
"estimated_cost_usd",
|
"estimated_cost_usd",
|
||||||
Value::String(format_usd(
|
Value::String(format_usd(
|
||||||
response.usage.estimated_cost_usd(&response.model).total_cost_usd(),
|
response
|
||||||
|
.usage
|
||||||
|
.estimated_cost_usd(&response.model)
|
||||||
|
.total_cost_usd(),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ pub use compact::{
|
|||||||
get_compact_continuation_message, should_compact, CompactionConfig, CompactionResult,
|
get_compact_continuation_message, should_compact, CompactionConfig, CompactionResult,
|
||||||
};
|
};
|
||||||
pub use config::{
|
pub use config::{
|
||||||
ConfigEntry, ConfigError, ConfigLoader, ConfigSource, McpManagedProxyServerConfig,
|
ConfigEntry, ConfigError, ConfigLoader, ConfigSource, McpConfigCollection,
|
||||||
McpConfigCollection, McpOAuthConfig, McpRemoteServerConfig, McpSdkServerConfig,
|
McpManagedProxyServerConfig, McpOAuthConfig, McpRemoteServerConfig, McpSdkServerConfig,
|
||||||
McpServerConfig, McpStdioServerConfig, McpTransport, McpWebSocketServerConfig, OAuthConfig,
|
McpServerConfig, McpStdioServerConfig, McpTransport, McpWebSocketServerConfig, OAuthConfig,
|
||||||
ResolvedPermissionMode, RuntimeConfig, RuntimeFeatureConfig, RuntimeHookConfig,
|
ResolvedPermissionMode, RuntimeConfig, RuntimeFeatureConfig, RuntimeHookConfig,
|
||||||
RuntimePermissionRuleConfig, RuntimePluginConfig, ScopedMcpServerConfig,
|
RuntimePermissionRuleConfig, RuntimePluginConfig, ScopedMcpServerConfig,
|
||||||
CLAW_SETTINGS_SCHEMA_NAME,
|
CLAW_SETTINGS_SCHEMA_NAME,
|
||||||
};
|
};
|
||||||
pub use conversation::{
|
pub use conversation::{
|
||||||
auto_compaction_threshold_from_env, ApiClient, ApiRequest, AssistantEvent,
|
auto_compaction_threshold_from_env, ApiClient, ApiRequest, AssistantEvent, AutoCompactionEvent,
|
||||||
AutoCompactionEvent, ConversationRuntime, PromptCacheEvent, RuntimeError,
|
ConversationRuntime, PromptCacheEvent, RuntimeError, StaticToolExecutor, ToolError,
|
||||||
StaticToolExecutor, ToolError, ToolExecutor, TurnSummary,
|
ToolExecutor, TurnSummary,
|
||||||
};
|
};
|
||||||
pub use file_ops::{
|
pub use file_ops::{
|
||||||
edit_file, glob_search, grep_search, read_file, write_file, EditFileOutput, GlobSearchOutput,
|
edit_file, glob_search, grep_search, read_file, write_file, EditFileOutput, GlobSearchOutput,
|
||||||
@@ -49,7 +49,7 @@ pub use mcp::{
|
|||||||
scoped_mcp_config_hash, unwrap_ccr_proxy_url,
|
scoped_mcp_config_hash, unwrap_ccr_proxy_url,
|
||||||
};
|
};
|
||||||
pub use mcp_client::{
|
pub use mcp_client::{
|
||||||
McpManagedProxyTransport, McpClientAuth, McpClientBootstrap, McpClientTransport,
|
McpClientAuth, McpClientBootstrap, McpClientTransport, McpManagedProxyTransport,
|
||||||
McpRemoteTransport, McpSdkTransport, McpStdioTransport,
|
McpRemoteTransport, McpSdkTransport, McpStdioTransport,
|
||||||
};
|
};
|
||||||
pub use mcp_stdio::{
|
pub use mcp_stdio::{
|
||||||
|
|||||||
@@ -97,12 +97,10 @@ impl McpClientTransport {
|
|||||||
McpServerConfig::Sdk(config) => Self::Sdk(McpSdkTransport {
|
McpServerConfig::Sdk(config) => Self::Sdk(McpSdkTransport {
|
||||||
name: config.name.clone(),
|
name: config.name.clone(),
|
||||||
}),
|
}),
|
||||||
McpServerConfig::ManagedProxy(config) => {
|
McpServerConfig::ManagedProxy(config) => Self::ManagedProxy(McpManagedProxyTransport {
|
||||||
Self::ManagedProxy(McpManagedProxyTransport {
|
url: config.url.clone(),
|
||||||
url: config.url.clone(),
|
id: config.id.clone(),
|
||||||
id: config.id.clone(),
|
}),
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -876,6 +876,7 @@ impl GitWorkspaceSummary {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
fn format_unknown_slash_command_message(name: &str) -> String {
|
fn format_unknown_slash_command_message(name: &str) -> String {
|
||||||
let suggestions = suggest_slash_commands(name);
|
let suggestions = suggest_slash_commands(name);
|
||||||
if suggestions.is_empty() {
|
if suggestions.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user