source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/ui2/components/command_suggestions_spec.rb
Ruby
mit
194
main
5,649
# frozen_string_literal: true require "spec_helper" require "clacky/ui2/components/command_suggestions" RSpec.describe Clacky::UI2::Components::CommandSuggestions do let(:suggestions) { described_class.new } describe "#initialize" do it "starts hidden" do expect(suggestions.visible).to be false end...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/inject_session_context_spec.rb
Ruby
mit
194
main
2,555
# frozen_string_literal: true RSpec.describe "Agent#inject_session_context_if_needed" do let(:client) do instance_double(Clacky::Client).tap do |c| c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) do Clacky::AgentConfig.new(model: "gpt-4o", permission_mode: :auto_approve)...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/compression_system_prompt_dup_spec.rb
Ruby
mit
194
main
7,371
# frozen_string_literal: true # Regression tests for the "duplicate system prompt after compression" bug. # # Bug report: # After uploading an image, the system prompt appeared N times in session.json. # Each compression round re-inserted the system message because # get_recent_messages_with_tool_pairs did NOT e...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/message_compressor_chunk_spec.rb
Ruby
mit
194
main
25,383
# frozen_string_literal: true require "tmpdir" require "fileutils" require "time" RSpec.describe "Compression chunk MD archiving" do let(:sessions_dir) { Dir.mktmpdir } let(:session_id) { "abc12345-0000-0000-0000-000000000000" } let(:created_at) { "2026-03-08T10:00:00+08:00" } # Minimal agent class that incl...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/file_processing_spec.rb
Ruby
mit
194
main
8,825
# frozen_string_literal: true require "tmpdir" RSpec.describe "Agent file processing" do let(:client) do instance_double(Clacky::Client).tap do |c| c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) do Clacky::AgentConfig.new(model: "gpt-4o", permission_mode: :auto_approve...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/inject_skill_command_spec.rb
Ruby
mit
194
main
16,741
# frozen_string_literal: true RSpec.describe "Agent#inject_skill_command_as_assistant_message" do let(:client) do instance_double(Clacky::Client).tap do |c| c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) { Clacky::AgentConfig.new(model: "gpt-3.5-turbo", permission_mode: :au...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/bedrock_truncation_recovery_spec.rb
Ruby
mit
194
main
10,127
# frozen_string_literal: true # Business-logic tests for the Bedrock streaming truncation recovery. # # Background: # AWS Bedrock occasionally streams tool call arguments that stop mid-JSON # (e.g. only 18 tokens: '{"path": "/tmp/build_manual.py"' — no `content`). # When this happens, ArgumentsParser raises BadA...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/chunk_index_injection_spec.rb
Ruby
mit
194
main
15,560
# frozen_string_literal: true require "tmpdir" require "fileutils" RSpec.describe "chunk index injection and topics" do let(:sessions_dir) { Dir.mktmpdir } after { FileUtils.rm_rf(sessions_dir) } # ── Helper: write a minimal chunk MD with optional topics ────────────────── def write_chunk(path, topics: nil...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/tool_pair_spec.rb
Ruby
mit
194
main
6,959
# frozen_string_literal: true # Tests for get_recent_messages_with_tool_pairs # Verifies tool_call / tool_result pairing is preserved during compression # for both Anthropic format (role:user + content:[{type:tool_result}]) # and OpenAI format (role:tool + tool_call_id). RSpec.describe "get_recent_messages_with_tool_...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/memory_updater_spec.rb
Ruby
mit
194
main
8,406
# frozen_string_literal: true require "tmpdir" require "fileutils" RSpec.describe Clacky::Agent::MemoryUpdater do # Create a minimal test class that includes the module let(:agent_class) do Class.new do include Clacky::Agent::MemoryUpdater attr_accessor :iterations, :messages, :task_start_iterati...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/session_replay_chunk_spec.rb
Ruby
mit
194
main
18,971
# frozen_string_literal: true require "tmpdir" require "fileutils" require "time" RSpec.describe "replay_history chunk MD expansion" do let(:sessions_dir) { Dir.mktmpdir } after { FileUtils.rm_rf(sessions_dir) } # Minimal agent stub that includes SessionSerializer def build_agent(messages) history = Cla...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/skill_manager_memories_spec.rb
Ruby
mit
194
main
5,962
# frozen_string_literal: true require "tmpdir" require "fileutils" RSpec.describe "SkillManager memory helpers" do # Minimal class that mixes in SkillManager and redirects memories_base_dir to tmpdir let(:agent_class) do Class.new do include Clacky::Agent::SkillManager attr_writer :memories_dir ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent/session_restore_system_prompt_spec.rb
Ruby
mit
194
main
3,410
# frozen_string_literal: true RSpec.describe "Agent#restore_session refreshes system prompt" do let(:client) do instance_double(Clacky::Client).tap do |c| c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) do Clacky::AgentConfig.new(model: "gpt-3.5-turbo", permission_mode: ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/utils/encoding_spec.rb
Ruby
mit
194
main
4,699
# frozen_string_literal: true RSpec.describe Clacky::Utils::Encoding do describe ".cmd_to_utf8" do context "with nil or empty input" do it "returns empty string for nil" do expect(described_class.cmd_to_utf8(nil)).to eq("") end it "returns empty string for empty string" do expe...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/utils/file_processor_spec.rb
Ruby
mit
194
main
14,486
# frozen_string_literal: true require "tmpdir" RSpec.describe Clacky::Utils::FileProcessor do # --------------------------------------------------------------------------- # .save — store only, no parsing # --------------------------------------------------------------------------- describe ".save" do it ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/utils/scripts_manager_spec.rb
Ruby
mit
194
main
3,668
# frozen_string_literal: true require "tmpdir" require "fileutils" RSpec.describe Clacky::Utils::ScriptsManager do describe "DEFAULT_SCRIPTS_DIR" do it "points to the gem scripts/ directory (not a parent workspace)" do dir = described_class::DEFAULT_SCRIPTS_DIR # Must end with /scripts, not /../scri...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/utils/limit_stack_spec.rb
Ruby
mit
194
main
6,585
# frozen_string_literal: true RSpec.describe Clacky::Utils::LimitStack do # --------------------------------------------------------------------------- # Basic behaviour (existing semantics — must not regress) # --------------------------------------------------------------------------- describe "basic push / ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/utils/parser_manager_spec.rb
Ruby
mit
194
main
4,281
# frozen_string_literal: true require "tmpdir" require "fileutils" RSpec.describe Clacky::Utils::ParserManager do # Use a temp dir as PARSERS_DIR so tests don't pollute ~/.clacky/parsers/ let(:tmp_parsers_dir) { Dir.mktmpdir } before do stub_const("Clacky::Utils::ParserManager::PARSERS_DIR", tmp_parsers_di...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/utils/arguments_parser_spec.rb
Ruby
mit
194
main
6,766
# frozen_string_literal: true require "spec_helper" require "clacky/utils/arguments_parser" RSpec.describe Clacky::Utils::ArgumentsParser do let(:tool_registry) do registry = instance_double("Clacky::ToolRegistry") # Mock a tool with required and optional parameters tool = double("Tool", name...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/web/syntax_spec.rb
Ruby
mit
194
main
12,547
# frozen_string_literal: true require "open3" require "tmpdir" # Helpers for running external syntax checkers module SyntaxChecker # Check JavaScript syntax using `node --check`. # Returns { valid: true/false, output: String } def self.check_js(path) stdout, stderr, status = Open3.capture3("node", "--check"...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/server/http_server_spec.rb
Ruby
mit
194
main
40,384
# frozen_string_literal: true require "spec_helper" require "net/http" require "json" require "tmpdir" require "fileutils" require "clacky/server/http_server" require "clacky/agent_config" # ───────────────────────────────────────────────────────────────────────────── # Helpers # ─────────────────────────────────────...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/server/scheduler_spec.rb
Ruby
mit
194
main
8,660
# frozen_string_literal: true require "spec_helper" require "tmpdir" require "fileutils" require "clacky/server/scheduler" RSpec.describe Clacky::Server::Scheduler do let(:tmpdir) { Dir.mktmpdir("clacky_scheduler_spec") } # Build a scheduler that uses tmpdir instead of ~/.clacky subject(:scheduler) do s = ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/server/http_server_auth_spec.rb
Ruby
mit
194
main
7,472
require "spec_helper" # --------------------------------------------------------------------------- # Unit tests for HttpServer access key authentication logic. # # These tests exercise the brute-force protection state machine directly, # without booting a real HTTP server. The failures hash and mutex mirror # the ins...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/server/browser_manager_spec.rb
Ruby
mit
194
main
15,797
# frozen_string_literal: true require "spec_helper" require "tmpdir" require "fileutils" require "stringio" require "json" require "clacky/server/browser_manager" require "clacky/tools/browser" RSpec.describe Clacky::BrowserManager do # Each test gets a fresh instance — avoids singleton state leaking between exampl...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/server/channel/adapters/weixin/adapter_spec.rb
Ruby
mit
194
main
7,597
# frozen_string_literal: true require "spec_helper" require "clacky/server/channel/adapters/weixin/adapter" require "clacky/server/channel/adapters/weixin/api_client" require "tempfile" RSpec.describe Clacky::Channel::Adapters::Weixin::Adapter do let(:config) do { token: "test-token", base_u...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/server/channel/adapters/weixin/api_client_spec.rb
Ruby
mit
194
main
8,573
# frozen_string_literal: true require "spec_helper" require "clacky/server/channel/adapters/weixin/api_client" require "openssl" require "digest" require "tempfile" RSpec.describe Clacky::Channel::Adapters::Weixin::ApiClient do let(:token) { "test-token-abc123" } let(:client) { described_class.new(base_url: ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/web_fetch_spec.rb
Ruby
mit
194
main
1,858
# frozen_string_literal: true RSpec.describe Clacky::Tools::WebFetch do let(:tool) { described_class.new } describe "#execute" do it "returns error for invalid URL" do result = tool.execute(url: "not a url") expect(result[:error]).to include("Invalid URL") end it "returns error for non-H...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/todo_manager_spec.rb
Ruby
mit
194
main
11,018
# frozen_string_literal: true RSpec.describe Clacky::Tools::TodoManager do let(:tool) { described_class.new } describe "#execute" do describe "add action" do it "adds a new todo" do storage = [] result = tool.execute(action: "add", task: "Write tests", todos_storage: storage) ex...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/time_machine_tools_spec.rb
Ruby
mit
194
main
7,344
# frozen_string_literal: true require "spec_helper" RSpec.describe "Time Machine Tools" do let(:client) do instance_double(Clacky::Client).tap do |c| c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) do Clacky::AgentConfig.new( model: "gpt-3.5-turbo", permiss...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/invoke_skill_spec.rb
Ruby
mit
194
main
7,276
# frozen_string_literal: true require "tmpdir" require "fileutils" RSpec.describe Clacky::Tools::InvokeSkill do let(:tool) { described_class.new } # ── helpers ────────────────────────────────────────────────────────────────── def create_skill(dir, name:, content: "Skill content.", fork_agent: false) skil...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/edit_ai_tolerance_spec.rb
Ruby
mit
194
main
4,559
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::Tools::Edit do let(:tool) { described_class.new } describe "AI error tolerance" do context "when AI adds extra whitespace" do it "handles old_string with extra leading/trailing newlines" do Dir.mktmpdir do ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/web_search_parser_spec.rb
Ruby
mit
194
main
2,809
# frozen_string_literal: true # Parser unit tests using real HTML fixtures captured from each provider. # # Fixtures are saved in spec/fixtures/web_search/ and should be refreshed # periodically (or when a parser breaks) by re-running: # # bin/refresh_search_fixtures (to be created) # # Each test asserts the MINIM...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/glob_spec.rb
Ruby
mit
194
main
8,653
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::Tools::Glob do let(:tool) { described_class.new } describe "#execute" do it "finds files matching pattern" do Dir.mktmpdir do |dir| # Create test files FileUtils.touch(File.join(dir, "test1.rb")) ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/browser_spec.rb
Ruby
mit
194
main
10,980
# frozen_string_literal: true require "spec_helper" require "clacky/tools/browser" RSpec.describe Clacky::Tools::Browser do let(:tool) { described_class.new } # --------------------------------------------------------------------------- # compress_snapshot # --------------------------------------------------...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/write_spec.rb
Ruby
mit
194
main
2,111
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::Tools::Write do let(:tool) { described_class.new } describe "#execute" do it "writes content to a new file" do Dir.mktmpdir do |dir| file_path = File.join(dir, "test.txt") content = "Hello, World!" ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/terminal_spec.rb
Ruby
mit
194
main
31,274
# frozen_string_literal: true require "shellwords" require "tmpdir" # Specs for the redesigned, unified Terminal tool. # Contract recap: # - `terminal(command: ...)` → run a new command # - `terminal(session_id:, input: ...)` → continue a blocked session # - `terminal(session_id:, k...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/edit_spec.rb
Ruby
mit
194
main
6,091
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::Tools::Edit do let(:tool) { described_class.new } describe "#execute" do it "replaces string in file" do Dir.mktmpdir do |dir| file_path = File.join(dir, "test.txt") File.write(file_path, "Hello, Wo...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/file_reader_spec.rb
Ruby
mit
194
main
16,316
# frozen_string_literal: true require "tempfile" require "tmpdir" require "json" RSpec.describe Clacky::Tools::FileReader do let(:tool) { described_class.new } describe "#execute" do context "when reading a file" do it "reads file contents" do Dir.mktmpdir do |dir| file_path = File.jo...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/web_search_spec.rb
Ruby
mit
194
main
1,737
# frozen_string_literal: true RSpec.describe Clacky::Tools::WebSearch do let(:tool) { described_class.new } describe "#execute" do it "returns error for empty query" do result = tool.execute(query: "") expect(result[:error]).to include("cannot be empty") end it "returns error for nil que...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/grep_spec.rb
Ruby
mit
194
main
5,179
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::Tools::Grep do let(:tool) { described_class.new } describe "#execute" do it "finds matching lines in a file" do Dir.mktmpdir do |dir| file_path = File.join(dir, "test.txt") File.write(file_path, "fo...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/tools/request_user_feedback_spec.rb
Ruby
mit
194
main
4,869
# frozen_string_literal: true RSpec.describe Clacky::Tools::RequestUserFeedback do let(:tool) { described_class.new } describe "#execute" do it "returns formatted message with question only" do result = tool.execute(question: "What color scheme should I use?") expect(result[:success]).to be true ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/integration/web_search_smoke_spec.rb
Ruby
mit
194
main
2,373
# frozen_string_literal: true # Smoke tests: real network requests to each search provider. # # Run only in CI smoke test workflow (tag: smoke), NOT in the normal test suite. # Locally: bundle exec rspec spec/integration/web_search_smoke_spec.rb --tag smoke # # These tests verify that: # 1. Each provider is reachabl...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
homebrew/openclacky.rb
Ruby
mit
194
main
781
# frozen_string_literal: true class Openclacky < Formula desc "Command-line interface for AI models with autonomous agent capabilities" homepage "https://github.com/clacky-ai/openclacky" url "https://rubygems.org/downloads/openclacky-0.6.1.gem" sha256 "" # Will be updated when gem is published license "MIT" ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
clacky-legacy/clarky.gemspec
Ruby
mit
194
main
980
# frozen_string_literal: true Gem::Specification.new do |spec| spec.name = "clarky" spec.version = "0.5.1" spec.authors = ["ClackyAI Team"] spec.email = ["support@clacky.ai"] spec.summary = "Legacy name for openclacky - AI agent command-line interface" spec.description = "This is a placeholder gem. Instal...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
clacky-legacy/clacky.gemspec
Ruby
mit
194
main
983
# frozen_string_literal: true Gem::Specification.new do |spec| spec.name = "clacky" spec.version = "0.5.1" spec.authors = ["ClackyAI Team"] spec.email = ["support@clacky.ai"] spec.summary = "Legacy name for openclacky gem" spec.description = "This is a transitional gem that depends on openclacky. The clac...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky.rb
Ruby
mit
194
main
5,633
# frozen_string_literal: true # ── Global encoding defaults ────────────────────────────────────────────────── # Force UTF-8 as the default external/internal encoding for all IO operations # (File.read, Open3.capture3, HTTP bodies, etc.) so that binary-encoded strings # from external processes or network I/O never cau...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/block_font.rb
Ruby
mit
194
main
9,373
# frozen_string_literal: true module Clacky # BlockFont renders text using Unicode box-drawing characters (█ ║ ╗ ╔ ╚ ╝ ═) # in the same visual style as the hardcoded OpenClacky logo. # # Each glyph is 6 lines tall. Characters are joined horizontally with one # space column between them. module BlockFont ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/client.rb
Ruby
mit
194
main
18,790
# frozen_string_literal: true require "faraday" require "json" module Clacky class Client MAX_RETRIES = 10 RETRY_DELAY = 5 # seconds def initialize(api_key, base_url:, model:, anthropic_format: false) @api_key = api_key @base_url = base_url @model = model @use_anthropic_format =...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/idle_compression_timer.rb
Ruby
mit
194
main
4,199
# frozen_string_literal: true module Clacky # IdleCompressionTimer triggers memory compression after a period of inactivity. # # Both CLI and WebUI use the same agent-level compression logic; this class # abstracts the "wait N seconds, then compress" pattern so it can be shared. # # Usage: # timer = Id...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/json_ui_controller.rb
Ruby
mit
194
main
5,334
# frozen_string_literal: true require "json" require "securerandom" require_relative "ui_interface" module Clacky # JsonUIController implements UIInterface for JSON (NDJSON) output mode. # All output is written as one-JSON-per-line to stdout. # Confirmation requests read responses from stdin. class JsonUICont...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/aes_gcm.rb
Ruby
mit
194
main
6,936
# frozen_string_literal: true require "openssl" require "base64" module Clacky # Pure-Ruby AES-256-GCM implementation. # # Why this exists: # macOS ships Ruby 2.6 linked against LibreSSL 3.3.x which has a known # bug: AES-GCM encrypt/decrypt raises CipherError even for valid inputs. # This implement...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/agent_profile.rb
Ruby
mit
194
main
3,481
# frozen_string_literal: true require "yaml" module Clacky # Loads and represents an agent profile (system prompt + skill whitelist). # # Lookup order for a profile named "coding": # 1. ~/.clacky/agents/coding/ (user override) # 2. <gem>/lib/clacky/default_agents/coding/ (built-in default) #...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/message_history.rb
Ruby
mit
194
main
14,433
# frozen_string_literal: true module Clacky # MessageHistory wraps the conversation message list and exposes # business-meaningful operations instead of raw array manipulation. # # Internal fields (task_id, created_at, system_injected, etc.) are kept # in the internal store but stripped when calling #to_api....
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/plain_ui_controller.rb
Ruby
mit
194
main
5,400
# frozen_string_literal: true require_relative "ui_interface" module Clacky # PlainUIController implements UIInterface for non-interactive (--message) mode. # Writes human-readable plain text directly to stdout so the caller can capture # or pipe the output. No spinners, no TUI — just clean lines. class Plain...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/brand_config.rb
Ruby
mit
194
main
59,351
# frozen_string_literal: true require "yaml" require "fileutils" require "digest" require "openssl" require "securerandom" require "json" require "time" require "socket" require "uri" module Clacky # BrandConfig manages white-label branding for the OpenClacky gem. # # Brand information is stored separately in ~...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/ui2.rb
Ruby
mit
194
main
1,343
# frozen_string_literal: true # UI2 - MVC-based terminal UI system for Clacky # Provides split-screen interface with scrollable output and fixed input require_relative "ui2/thinking_verbs" require_relative "ui2/progress_indicator" require_relative "ui2/terminal_detector" require_relative "ui2/theme_manager" require_r...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/cloud_project_client.rb
Ruby
mit
194
main
6,086
# frozen_string_literal: true require "faraday" require "json" module Clacky # CloudProjectClient - Manages cloud project lifecycle via the OpenClacky API # # Handles creating projects, fetching project details (including subscription # status and categorized_config), and listing projects in a workspace. # ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/cli.rb
Ruby
mit
194
main
45,918
# frozen_string_literal: true require "thor" require "tty-prompt" require "fileutils" require_relative "ui2" require_relative "json_ui_controller" require_relative "plain_ui_controller" require_relative "brand_config" module Clacky class CLI < Thor def self.exit_on_failure? true end # Set agent a...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/clacky_cloud_config.rb
Ruby
mit
194
main
4,648
# frozen_string_literal: true require "yaml" require "fileutils" module Clacky # ClackyCloudConfig — stores the Clacky Cloud credentials used for workspace-key # import (workspace_api_key + backend base_url) in a dedicated file so the user # never has to re-enter them. # # File location: ~/.clacky/clacky_cl...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/providers.rb
Ruby
mit
194
main
17,624
# frozen_string_literal: true module Clacky # Built-in model provider presets # Provides default configurations for supported AI model providers module Providers # Provider preset definitions # Each preset includes: # - name: Human-readable provider name # - base_url: Default API endpoint # -...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/skill.rb
Ruby
mit
194
main
22,266
# frozen_string_literal: true require "yaml" require "pathname" require_relative "utils/file_ignore_helper" require_relative "utils/gitignore_parser" module Clacky # Represents a skill with its metadata and content. # A skill is defined by a SKILL.md file with optional YAML frontmatter. class Skill # Frontm...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/telemetry.rb
Ruby
mit
194
main
3,964
# frozen_string_literal: true require "json" require "digest" require "socket" require_relative "platform_http_client" require_relative "brand_config" module Clacky # Telemetry — lightweight, anonymous usage reporting for the OpenClacky gem. # # Privacy-first design (modeled after Homebrew's opt-out analytics):...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/ui_interface.rb
Ruby
mit
194
main
5,319
# frozen_string_literal: true module Clacky # UIInterface defines the standard interface between Agent/CLI and UI implementations. # All UI controllers (UIController, JsonUIController) must implement these methods. module UIInterface # === Output display === # @param content [String] text portion of the ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/clacky_auth_client.rb
Ruby
mit
194
main
5,830
# frozen_string_literal: true require "faraday" require "json" module Clacky # ClackyAuthClient - Fetches LLM keys from a Clacky workspace via API # # Usage: # client = ClackyAuthClient.new("clacky_ak_xxx", base_url: "https://api.example.com") # result = client.fetch_workspace_keys # # => { success:...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/deploy_api_client.rb
Ruby
mit
194
main
18,474
# frozen_string_literal: true require "faraday" require "json" module Clacky # DeployApiClient - Encapsulates all Deploy API calls for the Railway deployment flow. # # All endpoints use Workspace API Key (clacky_ak_*) authentication, as the backend # supports both clacky_ak_* and clacky_dk_* for all deploy en...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/skill_loader.rb
Ruby
mit
194
main
15,471
# frozen_string_literal: true require "pathname" require "fileutils" require "clacky" module Clacky # Loader and registry for skills. # Discovers skills from multiple locations and provides lookup functionality. class SkillLoader # Skill discovery locations (in priority order: lower index = lower priority) ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/platform_http_client.rb
Ruby
mit
194
main
15,446
# frozen_string_literal: true require "net/http" require "uri" require "json" require "fileutils" module Clacky # PlatformHttpClient provides a resilient HTTP client for all calls to the # OpenClacky platform API (www.openclacky.com and its fallback domain). # # Features: # - Automatic retry with exponent...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/session_manager.rb
Ruby
mit
194
main
5,820
# frozen_string_literal: true require "json" require "fileutils" require "securerandom" module Clacky class SessionManager SESSIONS_DIR = File.join(Dir.home, ".clacky", "sessions") # Generate a new unique session ID (16-char hex string). # This is the single authoritative source for session IDs — all c...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/agent.rb
Ruby
mit
194
main
64,962
# frozen_string_literal: true require "securerandom" require "json" require "cgi" require "tty-prompt" require "set" require_relative "utils/arguments_parser" require_relative "utils/file_processor" require_relative "utils/environment_detector" # Load all agent modules require_relative "agent/message_compressor" requ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/agent_config.rb
Ruby
mit
194
main
37,410
# frozen_string_literal: true require "yaml" require "fileutils" require "securerandom" module Clacky # ClaudeCode environment variable compatibility layer # Provides configuration detection from ClaudeCode's environment variables module ClaudeCodeEnv # Environment variable names used by ClaudeCode ENV_...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/banner.rb
Ruby
mit
194
main
2,692
# frozen_string_literal: true require "pastel" require_relative "version" require_relative "brand_config" require_relative "block_font" module Clacky # Banner provides logo and branding for CLI and Web UI startup. # Lightweight — no terminal UI dependencies. class Banner DEFAULT_CLI_LOGO = <<~'LOGO' ████...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/redo_task.rb
Ruby
mit
194
main
1,109
# frozen_string_literal: true module Clacky module Tools # Tool for redoing a task after undo (Time Machine feature) class RedoTask < Base self.tool_name = "redo_task" self.tool_description = "Redo to a specific task after undo. Restores files to that task's state. " \ "Use when user want...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/base.rb
Ruby
mit
194
main
2,558
# frozen_string_literal: true module Clacky module Tools class Base class << self attr_accessor :tool_name, :tool_description, :tool_parameters, :tool_category end def name self.class.tool_name end def description self.class.tool_description end ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/web_fetch.rb
Ruby
mit
194
main
7,478
# frozen_string_literal: true require "net/http" require "uri" require "tmpdir" require "fileutils" require_relative "../utils/encoding" module Clacky module Tools class WebFetch < Base self.tool_name = "web_fetch" self.tool_description = "Fetch and parse content from a web page. Returns the page co...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/security.rb
Ruby
mit
194
main
11,835
# frozen_string_literal: true require "shellwords" require "json" require "fileutils" require_relative "../utils/trash_directory" require_relative "../utils/encoding" module Clacky module Tools # Pre-execution safety layer for shell-style commands. # # Responsibilities (applied to the `command` string B...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/trash_manager.rb
Ruby
mit
194
main
12,093
# frozen_string_literal: true require "json" require "fileutils" require_relative "base" require_relative "../utils/trash_directory" module Clacky module Tools class TrashManager < Base self.tool_name = "trash_manager" self.tool_description = "Manage deleted files in the AI trash - list, restore, or...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/invoke_skill.rb
Ruby
mit
194
main
4,209
# frozen_string_literal: true module Clacky module Tools # Tool for invoking skills within the agent # This allows the AI to call skills as tools rather than requiring explicit user commands class InvokeSkill < Base self.tool_name = "invoke_skill" self.tool_description = "Invoke a specialized...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/browser.rb
Ruby
mit
194
main
27,094
# frozen_string_literal: true require "json" require "open3" require "timeout" require "tmpdir" require "shellwords" require "yaml" require "base64" require "fileutils" require "securerandom" require_relative "base" module Clacky module Tools # Browser tool — controls the user's real Chromium-based browser (Chr...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/undo_task.rb
Ruby
mit
194
main
844
# frozen_string_literal: true module Clacky module Tools # Tool for undoing the last task (Time Machine feature) class UndoTask < Base self.tool_name = "undo_task" self.tool_description = "Undo the last task and restore files to previous state. " \ "Use when user wants to go back to previ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/request_user_feedback.rb
Ruby
mit
194
main
2,740
# frozen_string_literal: true module Clacky module Tools class RequestUserFeedback < Base self.tool_name = "request_user_feedback" self.tool_description = <<~DESC Request feedback or clarification from the user when you need more information to complete a task. Use this tool when: ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/list_tasks.rb
Ruby
mit
194
main
1,550
# frozen_string_literal: true module Clacky module Tools # Tool for listing task history (Time Machine feature) class ListTasks < Base self.tool_name = "list_tasks" self.tool_description = "List recent tasks in the task history with summaries. " \ "Shows current task, past tasks, and futu...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/grep.rb
Ruby
mit
194
main
11,073
# frozen_string_literal: true module Clacky module Tools class Grep < Base # Maximum file size to search (1MB) MAX_FILE_SIZE = 1_048_576 # Maximum line length to display (to avoid huge outputs) MAX_LINE_LENGTH = 500 self.tool_name = "grep" self.tool_description = "Search fil...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/file_reader.rb
Ruby
mit
194
main
14,562
# frozen_string_literal: true require_relative "base" require_relative "../utils/file_processor" module Clacky module Tools class FileReader < Base self.tool_name = "file_reader" self.tool_description = "Read contents of a file from the filesystem. Supports text files, images (PNG/JPG/GIF/WEBP), and...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/edit.rb
Ruby
mit
194
main
5,694
# frozen_string_literal: true module Clacky module Tools class Edit < Base self.tool_name = "edit" self.tool_description = "Make precise edits to existing files by replacing old text with new text. " \ "The old_string must match exactly (including whitespace and indentat...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/glob.rb
Ruby
mit
194
main
6,794
# frozen_string_literal: true require "pathname" module Clacky module Tools class Glob < Base # Maximum file size to search (1MB) MAX_FILE_SIZE = 1_048_576 self.tool_name = "glob" self.tool_description = "Find files matching a glob pattern (e.g., '**/*.rb', 'src/**/*.js'). " \ ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/terminal.rb
Ruby
mit
194
main
43,553
# frozen_string_literal: true require "pty" require "securerandom" require "fileutils" require_relative "base" require_relative "security" require_relative "terminal/session_manager" require_relative "terminal/output_cleaner" require_relative "terminal/persistent_session" module Clacky module Tools # Unified te...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/write.rb
Ruby
mit
194
main
1,985
# frozen_string_literal: true module Clacky module Tools class Write < Base self.tool_name = "write" self.tool_description = "Write content to a file. Creates new files or overwrites existing ones." self.tool_category = "file_system" self.tool_parameters = { type: "object", ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/todo_manager.rb
Ruby
mit
194
main
8,025
# frozen_string_literal: true require "json" require "time" module Clacky module Tools class TodoManager < Base self.tool_name = "todo_manager" self.tool_description = "Plan and track multi-step tasks." self.tool_category = "task_management" self.tool_parameters = { type: "object...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/web_search.rb
Ruby
mit
194
main
9,948
# frozen_string_literal: true require "net/http" require "json" require "uri" require "cgi" require "base64" require_relative "../utils/encoding" module Clacky module Tools class WebSearch < Base self.tool_name = "web_search" self.tool_description = "Search the web for current information. Returns s...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/run_project.rb
Ruby
mit
194
main
8,619
# frozen_string_literal: true require_relative "base" require_relative "../utils/limit_stack" require_relative "../utils/encoding" require "yaml" require "open3" module Clacky module Tools class RunProject < Base self.tool_name = "run_project" self.tool_description = "Start, stop, or get status of t...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/terminal/persistent_session.rb
Ruby
mit
194
main
8,850
# frozen_string_literal: true require "digest" module Clacky module Tools class Terminal < Base # Holds (at most) ONE long-lived PTY shell session that is reused # across multiple terminal calls. Reusing the session eliminates the # ~1s cold-start cost of `zsh -l -i` / `bash -l -i` on every co...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/terminal/output_cleaner.rb
Ruby
mit
194
main
2,385
# frozen_string_literal: true module Clacky module Tools class Terminal < Base # Output cleaning for raw PTY bytes. # # A PTY emits whatever the child writes plus terminal control codes. # Since the Terminal tool is targeted at LINE-BASED interactive shells # (not full-screen TUIs l...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/tools/terminal/session_manager.rb
Ruby
mit
194
main
7,175
# frozen_string_literal: true require "fileutils" require "tmpdir" require "securerandom" module Clacky module Tools class Terminal < Base # In-process registry of interactive PTY sessions. # # Lifecycle: sessions die with the openclacky process because the child # bash is a grandchild o...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/web_ui_controller.rb
Ruby
mit
194
main
16,806
# frozen_string_literal: true require "json" require "securerandom" require_relative "../ui_interface" module Clacky module Server # WebUIController implements UIInterface for the web server mode. # Instead of writing to stdout, it broadcasts JSON events over WebSocket connections. # Multiple browser ta...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/http_server.rb
Ruby
mit
194
main
132,768
# frozen_string_literal: true require "webrick" require "websocket" require "json" require "thread" require "fileutils" require "tmpdir" require "uri" require "securerandom" require "timeout" require_relative "session_registry" require_relative "web_ui_controller" require_relative "scheduler" require_relative "../bran...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/session_registry.rb
Ruby
mit
194
main
13,139
# frozen_string_literal: true module Clacky module Server # SessionRegistry is the single authoritative source for session state. # # It owns two concerns: # 1. Runtime state — agent instance, thread, status, pending_task, idle_timer. # 2. Session list — reads from disk (via session_manage...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/channel.rb
Ruby
mit
194
main
1,081
# frozen_string_literal: true # Channel layer — bridges Server Sessions to IM platforms (Feishu, WeCom, etc.) # # Load order: # 1. Adapter base & registry # 2. Platform adapters (each self-registers via Adapters.register) # 3. ChannelConfig (IM platform credentials) # 4. ChannelUIController (UIInterface impl t...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/scheduler.rb
Ruby
mit
194
main
11,742
# frozen_string_literal: true require "yaml" require "fileutils" module Clacky module Server # Scheduler reads ~/.clacky/schedules.yml and runs tasks on a cron-like schedule. # # It starts a background thread that ticks every 60 seconds, checks all # configured schedules, and fires any task whose cr...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/browser_manager.rb
Ruby
mit
194
main
13,924
# frozen_string_literal: true require "yaml" module Clacky # BrowserManager owns the chrome-devtools-mcp daemon lifecycle. # # It mirrors the ChannelManager pattern: # - start → read browser.yml; if enabled, pre-warm the MCP daemon # - stop → kill the daemon # - reload → stop + re-read yml + s...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
lib/clacky/server/server_master.rb
Ruby
mit
194
main
11,180
# frozen_string_literal: true require "socket" require "tmpdir" require_relative "../banner" require_relative "../version" module Clacky module Server # Master process — owns the listen socket, spawns/monitors worker processes. # # Lifecycle: # clacky server # └─ Master.run (this file) ...