Skip to content

Commit 8406a4f

Browse files
authored
Merge pull request #1 from Sewer56/impl-initial-tools
Initial implementation of LLM coding tools
2 parents 0440fe5 + 397a9a4 commit 8406a4f

76 files changed

Lines changed: 8183 additions & 228 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ body:
7777
- type: input
7878
id: version
7979
attributes:
80-
label: "rig-coding-tools version"
81-
description: The version of rig-coding-tools you're using
80+
label: "llm-coding-tools version"
81+
description: The version of llm-coding-tools you're using
8282
placeholder: e.g. 0.1.0
8383
validations:
8484
required: true

‎.github/pull_request_template.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
<!--
44
Please, make sure:
5-
- you have read the contributing guidelines:
6-
https://github.com/Sewer56/rig-coding-tools/blob/main/docs/CONTRIBUTING.md
5+
- you have read the contributing guidelines https://reloaded-project.github.io/reloaded-templates-rust/manual/#contributing
76
-->

‎.github/workflows/rust.yml‎

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
tags:
7-
- '*'
7+
- "*"
88
pull_request:
9-
branches: [ main ]
9+
branches: [main]
1010
workflow_dispatch:
1111

12-
13-
1412
jobs:
1513
build-and-test:
1614
strategy:
@@ -19,20 +17,37 @@ jobs:
1917
- os: ubuntu-latest
2018
target: x86_64-unknown-linux-gnu
2119
use-cross: false
20+
- os: windows-latest
21+
target: x86_64-pc-windows-msvc
22+
use-cross: false
23+
- os: macos-latest
24+
target: aarch64-apple-darwin
25+
use-cross: false
2226

2327
runs-on: ${{ matrix.os }}
2428

2529
steps:
2630
- uses: actions/checkout@v6
2731

28-
- name: Run Tests and Upload Coverage
32+
- name: Run Tests (async mode) and Upload Coverage
2933
uses: Reloaded-Project/devops-rust-test-and-coverage@v1
3034
with:
3135
rust-project-path: ./src
3236
upload-coverage: true
3337
codecov-token: ${{ secrets.CODECOV_TOKEN }}
3438
target: ${{ matrix.target }}
3539
use-cross: ${{ matrix.use-cross }}
40+
41+
- name: Run Tests (blocking mode) and Upload Coverage
42+
uses: Reloaded-Project/devops-rust-test-and-coverage@v1
43+
with:
44+
rust-project-path: ./src
45+
upload-coverage: true
46+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
47+
target: ${{ matrix.target }}
48+
use-cross: ${{ matrix.use-cross }}
49+
cargo-test-args: "-p llm-coding-tools-core --no-default-features --features blocking"
50+
3651
# Note: The GitHub Runner Images will contain an up to date Rust Stable Toolchain
3752
# thus as per recommendation of cargo-semver-checks, we're using stable here.
3853
#
@@ -42,29 +57,37 @@ jobs:
4257
working-directory: src
4358
shell: bash
4459
run: |
45-
SEARCH_RESULT=$(cargo search "^rig-coding-tools$" --limit 1)
60+
# Note: binstall is available after devops-rust-test-and-coverage@v1 call
61+
cargo +stable binstall --no-confirm cargo-semver-checks --force
62+
rustup +stable target add ${{ matrix.target }}
4663
47-
if echo "$SEARCH_RESULT" | grep -q "^rig-coding-tools "; then
48-
# Run semver checks on stable, because nightly sometimes gets borked in cargo-semver-checks.
49-
rustup +stable target add ${{ matrix.target }}
50-
# Note: binstall is available after devops-rust-test-and-coverage@v1 call
51-
cargo +stable binstall --no-confirm cargo-semver-checks --force
52-
cargo +stable semver-checks --target ${{ matrix.target }}
53-
else
54-
echo "No previous version found on crates.io. Skipping semver checks."
55-
fi
64+
for CRATE in "llm-coding-tools-core" "llm-coding-tools-rig"; do
65+
SEARCH_RESULT=$(cargo search "^${CRATE}$" --limit 1)
66+
if echo "$SEARCH_RESULT" | grep -q "^${CRATE} "; then
67+
echo "Running semver checks for ${CRATE}..."
68+
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }}
69+
else
70+
echo "No previous version of ${CRATE} found on crates.io. Skipping semver checks."
71+
fi
72+
done
5673
5774
- name: Check documentation is valid
5875
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
5976
working-directory: src
6077
env:
6178
RUSTDOCFLAGS: "-D warnings"
62-
run: cargo doc --workspace --all-features --document-private-items --target ${{ matrix.target }}
79+
# Note: Can't use --all-features at workspace level because tokio/blocking are mutually exclusive
80+
run: |
81+
cargo doc -p llm-coding-tools-core --features tokio --document-private-items --target ${{ matrix.target }}
82+
cargo doc -p llm-coding-tools-rig --document-private-items --target ${{ matrix.target }}
6383
6484
- name: Run linter
6585
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
6686
working-directory: src
67-
run: cargo clippy --workspace --all-features --target ${{ matrix.target }} -- -D warnings
87+
# Note: Can't use --all-features at workspace level because tokio/blocking are mutually exclusive
88+
run: |
89+
cargo clippy -p llm-coding-tools-core --features tokio --target ${{ matrix.target }} -- -D warnings
90+
cargo clippy -p llm-coding-tools-rig --target ${{ matrix.target }} -- -D warnings
6891
6992
- name: Run formatter check
7093
uses: actions-rust-lang/rustfmt@v1
@@ -85,12 +108,14 @@ jobs:
85108
uses: Reloaded-Project/devops-publish-action@v3
86109
with:
87110
rust-crates-io-token: ${{ secrets.CRATES_IO_TOKEN }}
88-
rust-cargo-project-paths: src/rig-coding-tools
111+
rust-cargo-project-paths: |
112+
src/llm-coding-tools-core
113+
src/llm-coding-tools-rig
89114
compression-tool: 7z
90115
artifact-groups-file: .github/artifact-groups.yml
91-
changelog-enabled: 'true'
116+
changelog-enabled: "true"
92117
changelog-template: .github/changelog.hbs
93118
changelog-is-release: ${{ startsWith(github.ref, 'refs/tags/') }}
94119
changelog-release-tag: ${{ github.ref_name }}
95-
changelog-override-starting-version: 'true'
96-
changelog-hide-credit: 'true'
120+
changelog-override-starting-version: "true"
121+
changelog-hide-credit: "true"

‎README.MD‎

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,94 @@
1-
# rig-coding-tools
1+
# llm-coding-tools
22

3-
## Additional Setup Required!!
3+
[![Crates.io - llm-coding-tools-core](https://img.shields.io/crates/v/llm-coding-tools-core.svg)](https://crates.io/crates/llm-coding-tools-core)
4+
[![Crates.io - llm-coding-tools-rig](https://img.shields.io/crates/v/llm-coding-tools-rig.svg)](https://crates.io/crates/llm-coding-tools-rig)
5+
[![Docs.rs](https://docs.rs/llm-coding-tools-rig/badge.svg)](https://docs.rs/llm-coding-tools-rig)
6+
[![CI](https://github.com/Sewer56/llm-coding-tools/actions/workflows/rust.yml/badge.svg)](https://github.com/Sewer56/llm-coding-tools/actions)
47

5-
<!-- DELETE THIS SECTION AFTER COMPLETING SETUP -->
8+
Lightweight, high-performance coding tool implementations for LLM-powered development agents. Plug and play into your favourite frameworks like [Rig](https://github.com/0xPlaygrounds/rig).
69

7-
Additional setup might be required.
8-
Once you do the stuff under this text, delete this section.
10+
## About This Workspace
911

10-
### Code Coverage
11-
To setup code coverage for this project:
12+
This workspace contains multiple Rust crates for integrating coding tools with LLM agents:
1213

13-
1. Go to [Codecov][codecov], add your project.
14-
2. Go to [Settings -> Secrets and variables -> Actions][gh-actions-secrets] in your repo and add a repository secret named `CODECOV_TOKEN`.
15-
3. Do the same in [Settings -> Secrets and variables -> Dependabot][gh-actions-dependabot].
14+
- **[llm-coding-tools-core](./src/llm-coding-tools-core/)**: Framework-agnostic core operations and utilities
15+
- **[llm-coding-tools-rig](./src/llm-coding-tools-rig/)**: Rig framework-specific Tool implementations
1616

17-
The instructions on the Codecov page will provide the token to use.
17+
## Features
1818

19+
- **File Operations**: Read, write, edit files with line-numbered output
20+
- **Search**: Glob pattern matching and regex content search
21+
- **Shell**: Cross-platform command execution with timeout
22+
- **Web**: URL fetching with HTML-to-markdown conversion
23+
- **Task Delegation**: Sub-agent spawning for complex workflows
24+
- **Path Security**: Choose between unrestricted or sandboxed file access
25+
- **Context Strings**: Embedded LLM guidance for tool usage
1926

20-
### Setup API Key (crates.io)
27+
## Feature Flags (llm-coding-tools-core)
2128

22-
You'll need to set up an API key to publish to `crates.io` on tag.
23-
24-
- Generate your API key in [crates.io (Account Settings -> API Tokens)][crates-io-key].
25-
- Go to [Settings -> Secrets and variables -> Actions][gh-actions-secrets] in your repo and add environment secret named `CRATES_IO_TOKEN`.
26-
- Paste your API key.
27-
28-
29-
30-
31-
### Fill in README Documentation
32-
33-
This repository uses a two-level README structure:
34-
35-
| File | Purpose | What to Write |
36-
|------|---------|---------------|
37-
| `README.MD` (this file) | GitHub landing page | Project overview, quick start example, badges |
38-
| [`src/rig-coding-tools/README.MD`](./src/rig-coding-tools/README.MD) | crates.io page | Detailed features, installation, comprehensive usage examples |
39-
40-
-----------------------
41-
42-
[![Crates.io](https://img.shields.io/crates/v/rig-coding-tools.svg)](https://crates.io/crates/rig-coding-tools)
43-
[![Docs.rs](https://docs.rs/rig-coding-tools/badge.svg)](https://docs.rs/rig-coding-tools)
44-
[![CI](https://github.com/Sewer56/rig-coding-tools/actions/workflows/rust.yml/badge.svg)](https://github.com/Sewer56/rig-coding-tools/actions)
45-
46-
Basic coding tools for rig based LLM agents
29+
- `tokio` (default): Async mode with tokio runtime
30+
- `blocking`: Sync/blocking mode, mutually exclusive with `async`
4731

4832
## Quick Start
4933

5034
Add to your `Cargo.toml`:
5135

5236
```toml
5337
[dependencies]
54-
rig-coding-tools = "0.1.0"
38+
llm-coding-tools-rig = "0.1"
5539
```
5640

5741
```rust
58-
// TODO: Add a minimal example showing the most common use case
42+
use llm_coding_tools_rig::absolute::{ReadTool, WriteTool, GlobTool};
43+
use llm_coding_tools_rig::{BashTool, PreambleBuilder, TodoTools};
44+
use rig::tool::ToolSet;
45+
46+
// Track tools and generate LLM guidance
47+
let mut pb = PreambleBuilder::new();
48+
let todos = TodoTools::new();
49+
50+
let toolset = ToolSet::builder()
51+
.static_tool(pb.track(ReadTool::<true>::new()))
52+
.static_tool(pb.track(WriteTool::new()))
53+
.static_tool(pb.track(GlobTool::new()))
54+
.static_tool(pb.track(BashTool::new()))
55+
.static_tool(pb.track(todos.read))
56+
.static_tool(pb.track(todos.write))
57+
.build();
58+
59+
// Generate preamble for agent system prompt
60+
let preamble = pb.build();
61+
62+
// Use with rig agent:
63+
// let agent = client.agent("gpt-4o")
64+
// .preamble(&preamble)
65+
// .tools(toolset)
66+
// .build();
5967
```
60-
See the [rig-coding-tools crate documentation](./src/rig-coding-tools/README.MD) for detailed usage.
6168

62-
## Crates
69+
## Examples
6370

64-
- [rig-coding-tools](./src/rig-coding-tools/README.MD): Core library <!-- TODO: Update description -->
71+
```bash
72+
# Basic toolset setup
73+
cargo run --example basic -p llm-coding-tools-rig
6574

66-
## Developer Manual
75+
# Complete agent configuration (recommended starting point)
76+
cargo run --example full_agent -p llm-coding-tools-rig
6777

68-
For step-by-step development guidance, see the [Developer Manual](https://reloaded-project.github.io/reloaded-templates-rust/manual/).
78+
# Sandboxed file access
79+
cargo run --example sandboxed -p llm-coding-tools-rig
80+
```
81+
82+
## Documentation
83+
84+
- [llm-coding-tools-core README](./src/llm-coding-tools-core/README.md)
85+
- [llm-coding-tools-rig README](./src/llm-coding-tools-rig/README.md)
86+
- [Developer Guidelines](./src/AGENTS.md)
6987

7088
## Contributing
7189

72-
We welcome contributions! See the [Contributing Guide](https://reloaded-project.github.io/reloaded-templates-rust/manual/#contributing) for details.
90+
Contributions are welcome! Please ensure all tests pass and the code follows our guidelines.
7391

7492
## License
7593

7694
Licensed under [Apache 2.0](./LICENSE).
77-
78-
[codecov]: https://app.codecov.io
79-
[gh-actions-secrets]: https://github.com/Sewer56/rig-coding-tools/settings/secrets/actions
80-
[gh-actions-dependabot]: https://github.com/Sewer56/rig-coding-tools/settings/secrets/dependabot
81-
[gh-pages]: https://github.com/Sewer56/rig-coding-tools/settings/pages
82-
[crates-io-key]: https://crates.io/settings/tokens
83-
[nuget-key]: https://www.nuget.org/account/apikeys

‎README.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎src/.vscode/tasks.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"label": "Auto Test on Save",
66
"type": "shell",
7-
"command": "cargo install cargo-watch --quiet && cargo watch -x \"test\" -w rig-coding-tools/src",
7+
"command": "cargo install cargo-watch --quiet && cargo watch -x \"test\" -w llm-coding-tools-core/src -w llm-coding-tools-rig/src",
88
"group": "test",
99
"presentation": {
1010
"reveal": "always"
@@ -14,7 +14,7 @@
1414
{
1515
"label": "Auto Coverage on Save",
1616
"type": "shell",
17-
"command": "cargo install cargo-watch --quiet && cargo install cargo-tarpaulin --quiet && cargo watch -x \"tarpaulin --skip-clean --out Xml --out Html --engine llvm --target-dir target/coverage-build\" -w rig-coding-tools/src",
17+
"command": "cargo install cargo-watch --quiet && cargo install cargo-tarpaulin --quiet && cargo watch -x \"tarpaulin --skip-clean --out Xml --out Html --engine llvm --target-dir target/coverage-build\" -w llm-coding-tools-core/src -w llm-coding-tools-rig/src",
1818
"group": "test",
1919
"presentation": {
2020
"reveal": "always"

0 commit comments

Comments
 (0)