Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plugin-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@omnidotdev/cli": minor
---

Add ecosystem plugin system with three plugin types (bin, api, launch), plugin discovery from config directory and PATH, and CLI routing via external_subcommand
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
published: ${{ steps.changesets.outputs.published }}
version_commit: ${{ steps.detect_version_commit.outputs.version_commit }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Get version from Cargo.toml
id: version
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
echo "${EOF}" >> "$GITHUB_OUTPUT"

- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
Expand All @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Check version sync
run: |
PKG_VERSION=$(jq -r '.version' package.json)
Expand Down
81 changes: 52 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Config
directories = "6"
dirs = "6"
toml = "0.9"
toml = "1"

# Async utilities
futures = "0.3"
Expand Down Expand Up @@ -102,7 +102,7 @@ regex = "1"

# Permission system
uuid = { version = "1", features = ["v4"] }
rand = "0.9.2"
rand = "0.10"
rpassword = "7"
hex = "0.4"
chrono = { version = "0.4.43", features = ["serde"] }
Expand All @@ -111,7 +111,7 @@ ulid = "1"
indexmap = "2"

# LSP integration
which = "7"
which = "8"

[dev-dependencies]
cargo-husky = { version = "1", default-features = false, features = ["precommit-hook", "run-cargo-fmt", "run-cargo-clippy", "run-cargo-test"] }
Expand Down
35 changes: 35 additions & 0 deletions examples/plugins/beacon/plugin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name = "beacon"
version = "0.1.0"
description = "AI assistant runtime — voice, messaging, and browser automation"
type = "api"
endpoint = "${BEACON_GATEWAY_URL}"

[commands.navigate]
description = "Navigate browser to a URL"
method = "POST"
path = "/browser/navigate"

[commands.screenshot]
description = "Take a browser screenshot"
method = "POST"
path = "/browser/screenshot"

[commands.click]
description = "Click an element"
method = "POST"
path = "/browser/click"

[commands.type]
description = "Type text into an element"
method = "POST"
path = "/browser/type"

[commands.execute]
description = "Execute JavaScript in the browser"
method = "POST"
path = "/browser/execute"

[commands.status]
description = "Get browser session status"
method = "GET"
path = "/browser/status"
20 changes: 20 additions & 0 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,26 @@ pub enum Commands {
#[command(subcommand)]
command: AuthCommands,
},

/// List installed plugins.
Plugins,

/// Install a plugin.
Install {
/// Plugin names to install.
#[arg(required = true)]
plugins: Vec<String>,
},

/// Remove a plugin.
Uninstall {
/// Plugin name to remove.
plugin: String,
},

/// Delegate to an ecosystem plugin.
#[command(external_subcommand)]
External(Vec<String>),
}

#[derive(Subcommand)]
Expand Down
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl ApiConfig {
/// Generate a new random API token.
#[must_use]
pub fn generate_token() -> String {
use rand::Rng;
use rand::RngExt;
let mut rng = rand::rng();
let bytes: [u8; 32] = rng.random();
format!("omni_{}", hex::encode(bytes))
Expand Down
2 changes: 1 addition & 1 deletion src/core/agent/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ impl ToolRegistry {
let status = input["status"].as_str().unwrap_or("pending");
let priority = input["priority"].as_str().map(String::from);

let id = format!("{:04}", rand::random::<u16>());
let id = format!("{:04}", rand::RngExt::random::<u16>(&mut rand::rng()));
let item = TodoItem {
id: id.clone(),
content: content.to_string(),
Expand Down
4 changes: 2 additions & 2 deletions src/core/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ pub fn new_slug() -> String {
];
let nouns = ["fox", "owl", "bear", "wolf", "hawk", "deer", "lynx", "crow"];

use rand::prelude::IndexedRandom;
use rand::prelude::*;
let mut rng = rand::rng();

let adj = adjectives.choose(&mut rng).unwrap_or(&"quick");
let noun = nouns.choose(&mut rng).unwrap_or(&"fox");
let num: u16 = rand::Rng::random_range(&mut rng, 100..1000);
let num: u16 = rng.random_range(100..1000);

format!("{adj}-{noun}-{num}")
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/session/share.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ShareToken {

/// Generate a short share token (8 chars, URL-safe)
fn generate_token() -> String {
use rand::Rng;
use rand::RngExt;
const CHARS: &[u8] = b"abcdefghijklmnopqrstuvwxyz0123456789";
let mut rng = rand::rng();
(0..8)
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mod build_info;
pub mod cli;
pub mod config;
pub mod core;
pub mod plugin;
pub mod tui;

pub use config::Config;
Expand Down
Loading
Loading