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 | lib/clacky/server/channel/channel_config.rb | Ruby | mit | 194 | main | 4,401 | # frozen_string_literal: true
require "yaml"
require "fileutils"
require "json"
module Clacky
# ChannelConfig manages IM platform credentials (Feishu, WeCom, etc.).
#
# Config is stored in ~/.clacky/channels.yml:
#
# channels:
# feishu:
# enabled: true
# app_id: cli_xxx
# app... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/channel_manager.rb | Ruby | mit | 194 | main | 14,917 | # frozen_string_literal: true
require_relative "channel_ui_controller"
module Clacky
module Channel
# ChannelManager starts and supervises IM platform adapter threads.
# When an inbound message arrives it:
# 1. Resolves (or auto-creates) a Session bound to this IM identity
# 2. Retrieves the Web... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/channel_ui_controller.rb | Ruby | mit | 194 | main | 7,078 | # frozen_string_literal: true
require_relative "../../ui_interface"
module Clacky
module Channel
# ChannelUIController implements UIInterface for IM platform sessions.
# It is registered as a subscriber on WebUIController so that every
# agent output event is forwarded here and sent back to the IM platf... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/base.rb | Ruby | mit | 194 | main | 2,588 | # frozen_string_literal: true
module Clacky
module Channel
module Adapters
# Adapter registry: maps platform symbol → adapter class.
# Each adapter registers itself by calling Adapters.register at load time.
@registry = {}
def self.register(platform, klass)
@registry[platform] = ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/wecom/ws_client.rb | Ruby | mit | 194 | main | 15,549 | # frozen_string_literal: true
require "websocket"
require "json"
require "uri"
require "securerandom"
module Clacky
module Channel
module Adapters
module Wecom
# WebSocket client for WeCom (Enterprise WeChat) intelligent robot long connection.
# Protocol: plain JSON frames over wss://openw... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/wecom/adapter.rb | Ruby | mit | 194 | main | 4,929 | # frozen_string_literal: true
require_relative "../../adapters/base"
require_relative "ws_client"
require_relative "media_downloader"
require_relative "../feishu/file_processor"
module Clacky
module Channel
module Adapters
module Wecom
# WeCom (Enterprise WeChat) adapter.
# Receives messag... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/wecom/media_downloader.rb | Ruby | mit | 194 | main | 4,462 | # frozen_string_literal: true
require "openssl"
require "faraday"
require "uri"
module Clacky
module Channel
module Adapters
module Wecom
# Downloads and decrypts media files from WeCom message URLs.
#
# WeCom long-connection bot messages include a per-resource aeskey.
# En... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/weixin/adapter.rb | Ruby | mit | 194 | main | 21,800 | # frozen_string_literal: true
require "base64"
require_relative "../../adapters/base"
require_relative "api_client"
module Clacky
module Channel
module Adapters
module Weixin
# Weixin (WeChat iLink) adapter.
#
# Protocol: HTTP long-poll via ilinkai.weixin.qq.com
# Auth: tok... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/weixin/api_client.rb | Ruby | mit | 194 | main | 17,073 | # frozen_string_literal: true
require "net/http"
require "json"
require "openssl"
require "securerandom"
require "base64"
require "digest"
require "tempfile"
module Clacky
module Channel
module Adapters
module Weixin
# HTTP API client for Weixin iLink bot protocol.
#
# All requests... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/feishu/file_processor.rb | Ruby | mit | 194 | main | 1,369 | # frozen_string_literal: true
require "clacky/utils/file_processor"
module Clacky
module Channel
module Adapters
module Feishu
# Processes file attachments downloaded from Feishu messages.
# Delegates to the unified Clacky::Utils::FileProcessor pipeline:
# - saves original file t... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/feishu/message_parser.rb | Ruby | mit | 194 | main | 4,147 | # frozen_string_literal: true
require "json"
module Clacky
module Channel
module Adapters
module Feishu
# Parses incoming Feishu webhook events into a standardized InboundMessage format.
class MessageParser
# Parse a Feishu webhook event body
# @param body [String, Hash... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/feishu/ws_client.rb | Ruby | mit | 194 | main | 15,297 | # frozen_string_literal: true
require "websocket"
require "json"
require "net/http"
require "uri"
module Clacky
module Channel
module Adapters
module Feishu
# WebSocket client for Feishu long connection mode.
# Feishu uses protobuf-encoded binary frames (pbbp2.Frame) over WebSocket.
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/feishu/bot.rb | Ruby | mit | 194 | main | 17,155 | # frozen_string_literal: true
require "faraday"
require "faraday/multipart"
require "json"
module Clacky
module Channel
module Adapters
module Feishu
# Raised when the app lacks read permission for a specific Feishu document (error code 91403).
# The user needs to add the app as a collabor... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/server/channel/adapters/feishu/adapter.rb | Ruby | mit | 194 | main | 12,711 | # frozen_string_literal: true
require_relative "../../adapters/base"
require_relative "bot"
require_relative "message_parser"
require_relative "file_processor"
require_relative "ws_client"
module Clacky
module Channel
module Adapters
module Feishu
DEFAULT_DOMAIN = "https://open.feishu.cn"
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/message_format/bedrock.rb | Ruby | mit | 194 | main | 15,010 | # frozen_string_literal: true
module Clacky
module MessageFormat
# Static helpers for AWS Bedrock Converse API message format.
#
# The Bedrock Converse API has a completely different format from Anthropic's Messages API:
# - Authentication: Authorization: Bearer <ABSK...key>
# - Endpoint: POS... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/message_format/anthropic.rb | Ruby | mit | 194 | main | 11,921 | # frozen_string_literal: true
module Clacky
module MessageFormat
# Static helpers for Anthropic API message format.
#
# Responsibilities:
# - Identify Anthropic-style messages stored in @messages
# - Convert internal @messages → Anthropic API request body
# - Parse Anthropic API respons... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/message_format/open_ai.rb | Ruby | mit | 194 | main | 9,616 | # frozen_string_literal: true
module Clacky
module MessageFormat
# Static helpers for OpenAI-compatible API message format.
#
# The canonical internal @messages format IS OpenAI format, so this module
# mainly handles response parsing, tool result formatting, and message
# type identification — m... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/arguments_parser.rb | Ruby | mit | 194 | main | 7,357 | # frozen_string_literal: true
require "json"
module Clacky
module Utils
class ArgumentsParser
# Parse and validate tool call arguments with JSON repair capability
def self.parse_and_validate(call, tool_registry)
# 1. Try standard parsing
begin
args = JSON.parse(call[:argume... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/browser_detector.rb | Ruby | mit | 194 | main | 7,494 | # frozen_string_literal: true
require "socket"
module Clacky
module Utils
# Detects a running browser (Chrome/Edge) that has remote debugging enabled.
#
# Detection strategy:
#
# 1. Scan known UserData directories for DevToolsActivePort file.
# This file contains the exact port + WS p... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/parser_manager.rb | Ruby | mit | 194 | main | 3,624 | # frozen_string_literal: true
require "fileutils"
require "open3"
module Clacky
module Utils
# Manages user-space parsers in ~/.clacky/parsers/.
#
# On first use, default parser scripts are copied from the gem's
# default_parsers/ directory into ~/.clacky/parsers/. After that,
# the user-space v... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/file_ignore_helper.rb | Ruby | mit | 194 | main | 4,275 | # frozen_string_literal: true
module Clacky
module Utils
# Helper module for file ignoring functionality shared between tools
module FileIgnoreHelper
# Default patterns to ignore when .gitignore is not available
DEFAULT_IGNORED_PATTERNS = [
'node_modules',
'vendor/bundle',
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/file_processor.rb | Ruby | mit | 194 | main | 22,030 | # frozen_string_literal: true
require "tmpdir"
require "fileutils"
require "securerandom"
require "stringio"
require_relative "parser_manager"
require "zip"
module Clacky
module Utils
# File processing pipeline.
#
# Two entry points:
# FileProcessor.save(body:, filename:)
# → Store raw bytes to dis... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/trash_directory.rb | Ruby | mit | 194 | main | 3,808 | # frozen_string_literal: true
require "digest"
require "fileutils"
module Clacky
# Manages global trash directory at ~/.clacky/trash
# Organizes trash by project directory using path hash
class TrashDirectory
GLOBAL_TRASH_ROOT = File.join(Dir.home, ".clacky", "trash")
attr_reader :project_root, :trash_... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/scripts_manager.rb | Ruby | mit | 194 | main | 2,018 | # frozen_string_literal: true
require "fileutils"
module Clacky
module Utils
# Manages user-space shell scripts in ~/.clacky/scripts/.
#
# On first use, bundled scripts are copied from the gem's scripts/
# directory into ~/.clacky/scripts/. The user-space copy is always
# used so users can custo... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/encoding.rb | Ruby | mit | 194 | main | 4,303 | # frozen_string_literal: true
module Clacky
module Utils
# Centralised UTF-8 encoding helpers used throughout the codebase.
#
# Three distinct use-cases exist:
#
# 1. to_utf8 – binary/unknown bytes → valid UTF-8 String.
# Used when reading shell output, HTTP respo... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/model_pricing.rb | Ruby | mit | 194 | main | 11,372 | # frozen_string_literal: true
module Clacky
# Module for handling AI model pricing
# Supports different pricing tiers and prompt caching
module ModelPricing
# Pricing per 1M tokens (MTok) in USD
# All pricing is based on official API documentation
PRICING_TABLE = {
# Claude 4.5 models - tiered ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/workspace_rules.rb | Ruby | mit | 194 | main | 1,612 | # frozen_string_literal: true
module Clacky
module Utils
# Discovers .clackyrules files in the workspace.
# Used by both SystemPromptBuilder (rules injection) and WelcomeBanner (UI display).
module WorkspaceRules
RULES_FILENAMES = [".clackyrules", ".cursorrules", "CLAUDE.md"].freeze
SUB_PROJE... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/logger.rb | Ruby | mit | 194 | main | 3,679 | # frozen_string_literal: true
require "fileutils"
require "time"
module Clacky
# Thread-safe daily-rotating file logger.
#
# Log files are written to ~/.clacky/logger/clacky-YYYY-MM-DD.log.
# At most 7 daily log files are kept; older ones are pruned automatically.
#
# Usage (anywhere in the codebase):
#... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/limit_stack.rb | Ruby | mit | 194 | main | 4,278 | # frozen_string_literal: true
module Clacky
module Utils
# Auto-rolling fixed-size array.
# Automatically discards oldest elements when the line-count limit is exceeded.
#
# Optional limits (all default to nil = no limit):
# max_line_chars – truncate each individual line to this many characters... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/string_matcher.rb | Ruby | mit | 194 | main | 4,613 | # frozen_string_literal: true
module Clacky
module Utils
# Utilities for finding and matching strings in file content.
# Used by the Edit tool and edit preview to apply a consistent
# layered matching strategy: exact → trim → unescape → smart line match.
module StringMatcher
# Find a matching s... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/path_helper.rb | Ruby | mit | 194 | main | 376 | # frozen_string_literal: true
module Clacky
module Utils
module PathHelper
# Safely get basename from path, return placeholder if path is nil
def self.safe_basename(path, placeholder: "?")
return placeholder if path.nil? || path.to_s.empty?
File.basename(path.to_s)
rescue Standa... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/gitignore_parser.rb | Ruby | mit | 194 | main | 4,309 | # frozen_string_literal: true
module Clacky
# Parser for .gitignore files to determine which files should be ignored
class GitignoreParser
attr_reader :patterns
def initialize(gitignore_path = nil)
@patterns = []
@negation_patterns = []
if gitignore_path && File.exist?(gitignore_p... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/utils/environment_detector.rb | Ruby | mit | 194 | main | 4,734 | # frozen_string_literal: true
module Clacky
module Utils
# Detects the current operating system environment and desktop path.
module EnvironmentDetector
# Detect OS type.
# @return [Symbol] :wsl, :linux, :macos, or :unknown
def self.os_type
return @os_type if defined?(@os_type)
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/line_editor.rb | Ruby | mit | 194 | main | 13,489 | # frozen_string_literal: true
require "pastel"
module Clacky
module UI2
# LineEditor module provides single-line text editing functionality
# Shared by InputArea and InlineInput components
module LineEditor
# Maximum content width ratio (percentage of terminal width)
# Use 90% of terminal wi... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/output_buffer.rb | Ruby | mit | 194 | main | 10,363 | # frozen_string_literal: true
require_relative "../utils/limit_stack"
module Clacky
module UI2
# OutputBuffer manages the logical sequence of rendered output lines.
#
# It replaces the scattered state that used to live across
# LayoutManager (@output_buffer + @output_row) and UIController
# (@pr... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/markdown_renderer.rb | Ruby | mit | 194 | main | 3,658 | # frozen_string_literal: true
require "tty-markdown"
require_relative "theme_manager"
module Clacky
module UI2
# MarkdownRenderer handles rendering Markdown content with syntax highlighting
module MarkdownRenderer
class << self
# Render markdown content with theme-aware colors
# @param... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/layout_manager.rb | Ruby | mit | 194 | main | 25,532 | # frozen_string_literal: true
require_relative "screen_buffer"
require_relative "output_buffer"
require_relative "../utils/encoding"
module Clacky
module UI2
# LayoutManager coordinates the split-screen layout:
# [ scrollable output area ]
# [ gap / todo / input (fixed) ]
#
# Responsibilitie... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/theme_manager.rb | Ruby | mit | 194 | main | 2,235 | # frozen_string_literal: true
require_relative "themes/base_theme"
require_relative "themes/hacker_theme"
require_relative "themes/minimal_theme"
module Clacky
module UI2
# ThemeManager handles theme registration and switching
class ThemeManager
class << self
def instance
@instance |... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/screen_buffer.rb | Ruby | mit | 194 | main | 8,830 | # frozen_string_literal: true
require "tty-screen"
require "io/console"
require_relative "../utils/encoding"
module Clacky
module UI2
# ScreenBuffer manages terminal screen state and provides low-level rendering primitives
class ScreenBuffer
attr_reader :width, :height
def initialize
@w... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/progress_indicator.rb | Ruby | mit | 194 | main | 1,445 | # frozen_string_literal: true
module Clacky
class ProgressIndicator
def initialize(verbose: false, message: nil)
@verbose = verbose
@start_time = nil
@custom_message = message
@thinking_verb = message || THINKING_VERBS.sample
@running = false
@update_thread = nil
end
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/ui_controller.rb | Ruby | mit | 194 | main | 59,264 | # frozen_string_literal: true
require_relative "layout_manager"
require_relative "view_renderer"
require_relative "progress_handle"
require_relative "components/input_area"
require_relative "components/todo_area"
require_relative "components/welcome_banner"
require_relative "components/inline_input"
require_relative "... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/block_font.rb | Ruby | mit | 194 | main | 221 | # frozen_string_literal: true
require_relative "../block_font"
module Clacky
module UI2
# Alias for backward compatibility — BlockFont now lives at Clacky::BlockFont.
BlockFont = Clacky::BlockFont
end
end |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/terminal_detector.rb | Ruby | mit | 194 | main | 4,340 | # frozen_string_literal: true
module Clacky
module UI2
# TerminalDetector - Detect terminal background color before UI starts
class TerminalDetector
# Detect if terminal has dark background
# Uses multiple strategies to determine background color
# @return [Boolean] true if dark background,... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/progress_handle.rb | Ruby | mit | 194 | main | 11,621 | # frozen_string_literal: true
require "monitor"
module Clacky
module UI2
# An *owned* progress indicator.
#
# Why this exists
# ---------------
# The previous design had a single, globally-shared spinner slot on
# UiController (`@progress_id` / `@progress_thread` / `@progress_message`
# ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/view_renderer.rb | Ruby | mit | 194 | main | 5,745 | # frozen_string_literal: true
require_relative "components/message_component"
require_relative "components/tool_component"
require_relative "components/common_component"
require_relative "markdown_renderer"
module Clacky
module UI2
# ViewRenderer coordinates all UI components and provides a unified rendering in... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/thinking_verbs.rb | Ruby | mit | 194 | main | 443 | # frozen_string_literal: true
module Clacky
THINKING_VERBS = [
"Cogitating",
"Pondering",
"Ruminating",
"Deliberating",
"Contemplating",
"Flibbertigibbeting",
"Percolating",
"Noodling",
"Brewing",
"Marinating",
"Stewing",
"Mulling",
"Processing",
"Computing",
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/themes/minimal_theme.rb | Ruby | mit | 194 | main | 2,228 | # frozen_string_literal: true
require_relative "base_theme"
module Clacky
module UI2
module Themes
# MinimalTheme - Clean, simple symbols
class MinimalTheme < BaseTheme
SYMBOLS = {
user: ">",
assistant: "<",
tool_call: "*",
tool_result: "-",
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/themes/hacker_theme.rb | Ruby | mit | 194 | main | 2,644 | # frozen_string_literal: true
require_relative "base_theme"
module Clacky
module UI2
module Themes
# HackerTheme - Matrix/hacker-style with bracket symbols
class HackerTheme < BaseTheme
SYMBOLS = {
user: "[>>]",
assistant: "[<<]",
tool_call: "[=>]",
to... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/themes/base_theme.rb | Ruby | mit | 194 | main | 3,530 | # frozen_string_literal: true
require "pastel"
module Clacky
module UI2
module Themes
# BaseTheme defines the abstract interface for all themes
# Subclasses MUST define SYMBOLS and COLORS constants
class BaseTheme
def initialize
@pastel = Pastel.new
@is_dark_backgro... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/command_suggestions.rb | Ruby | mit | 194 | main | 10,124 | # frozen_string_literal: true
require "pastel"
require_relative "../theme_manager"
module Clacky
module UI2
module Components
# CommandSuggestions displays a dropdown menu of available commands
# Supports keyboard navigation and filtering
class CommandSuggestions
attr_reader :selected_... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/input_area.rb | Ruby | mit | 194 | main | 46,742 | # frozen_string_literal: true
require "pastel"
require "tempfile"
require_relative "../theme_manager"
require_relative "../line_editor"
require_relative "command_suggestions"
require_relative "../../utils/encoding"
module Clacky
module UI2
module Components
# InputArea manages the fixed input area at the ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/tool_component.rb | Ruby | mit | 194 | main | 3,521 | # frozen_string_literal: true
require_relative "base_component"
module Clacky
module UI2
module Components
# ToolComponent renders tool calls and results
class ToolComponent < BaseComponent
# Render a tool event
# @param data [Hash] Tool event data
# - :type [Symbol] :call,... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/common_component.rb | Ruby | mit | 194 | main | 3,471 | # frozen_string_literal: true
require_relative "base_component"
module Clacky
module UI2
module Components
# CommonComponent renders common UI elements (progress, success, error, warning)
class CommonComponent < BaseComponent
# Render thinking indicator
# @return [String] Thinking in... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/inline_input.rb | Ruby | mit | 194 | main | 6,898 | # frozen_string_literal: true
require_relative "../line_editor"
module Clacky
module UI2
module Components
# InlineInput provides inline input for confirmations and simple prompts
# Renders at the end of output area, not at fixed bottom position
class InlineInput
include LineEditor
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/welcome_banner.rb | Ruby | mit | 194 | main | 8,543 | # frozen_string_literal: true
require "pastel"
require_relative "../../version"
require_relative "../block_font"
require_relative "../../utils/workspace_rules"
module Clacky
module UI2
module Components
# WelcomeBanner displays the startup screen with ASCII logo, tagline, tips, and agent info.
#
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/modal_component.rb | Ruby | mit | 194 | main | 15,390 | # frozen_string_literal: true
require 'io/console'
require 'tty-prompt'
require_relative 'base_component'
module Clacky
module UI2
module Components
# ModalComponent - Displays a centered modal dialog with form fields
class ModalComponent < BaseComponent
attr_reader :width, :height
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/message_component.rb | Ruby | mit | 194 | main | 3,590 | # frozen_string_literal: true
require_relative "base_component"
module Clacky
module UI2
module Components
# MessageComponent renders user and assistant messages
class MessageComponent < BaseComponent
# Render a message
# @param data [Hash] Message data
# - :role [String] "... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/todo_area.rb | Ruby | mit | 194 | main | 3,780 | # frozen_string_literal: true
require "pastel"
module Clacky
module UI2
module Components
# TodoArea displays active todos above the separator line
class TodoArea
attr_accessor :height
attr_reader :todos
MAX_DISPLAY_TASKS = 3 # Show current + next 2 tasks
def initi... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/ui2/components/base_component.rb | Ruby | mit | 194 | main | 5,210 | # frozen_string_literal: true
require "pastel"
module Clacky
module UI2
module Components
# BaseComponent provides common functionality for all UI components
class BaseComponent
def initialize
@pastel = Pastel.new
end
# Render component with given data
# @p... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/cost_tracker.rb | Ruby | mit | 194 | main | 5,185 | # frozen_string_literal: true
module Clacky
class Agent
# Cost tracking and token usage statistics
# Manages cost calculation, token estimation, and usage display
module CostTracker
# Track cost from API usage
# Updates total cost and displays iteration statistics
# @param usage [Hash] ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/tool_executor.rb | Ruby | mit | 194 | main | 17,620 | # frozen_string_literal: true
module Clacky
class Agent
# Tool execution and permission management
# Handles tool confirmation, preview, and result building
module ToolExecutor
# Check if a tool should be auto-executed based on permission mode
# @param tool_name [String] Name of the tool
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/llm_caller.rb | Ruby | mit | 194 | main | 10,801 | # frozen_string_literal: true
module Clacky
class Agent
# LLM API call management
# Handles API calls with retry logic, fallback model support, and progress indication
module LlmCaller
# Number of consecutive RetryableError failures (503/429/5xx) before switching to fallback.
# Network-level ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/tool_registry.rb | Ruby | mit | 194 | main | 833 | # frozen_string_literal: true
module Clacky
class ToolRegistry
def initialize
@tools = {}
end
def register(tool)
@tools[tool.name] = tool
end
def get(name)
@tools[name] || raise(Clacky::ToolCallError, "Tool not found: #{name}")
end
def all
@tools.values
end
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/system_prompt_builder.rb | Ruby | mit | 194 | main | 4,432 | # frozen_string_literal: true
require_relative "../utils/workspace_rules"
module Clacky
class Agent
# System prompt construction
# Builds system prompt by composing layers:
# 1. Agent-specific system_prompt.md (role & responsibilities)
# 2. base_prompt.md (universal rules: tod... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/skill_reflector.rb | Ruby | mit | 194 | main | 3,941 | # frozen_string_literal: true
module Clacky
class Agent
# Scenario 2: Reflect on skill execution and suggest improvements.
#
# After a skill completes, forks a subagent to analyze:
# - Were instructions clear enough?
# - Any missing edge cases?
# - Any improvements needed?
#
# I... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/skill_manager.rb | Ruby | mit | 194 | main | 22,675 | # frozen_string_literal: true
module Clacky
class Agent
# Skill management and execution
# Handles skill loading, command parsing, and subagent execution
module SkillManager
# Load all skills from configured locations
# @return [Array<Skill>]
def load_skills
@skill_loader.load_a... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/hook_manager.rb | Ruby | mit | 194 | main | 1,257 | # frozen_string_literal: true
module Clacky
class HookManager
HOOK_EVENTS = [
:before_tool_use,
:after_tool_use,
:on_tool_error,
:on_start,
:on_complete,
:on_iteration,
:session_rollback
].freeze
def initialize
@hooks = Hash.new { |h, k| h[k] = [] }
en... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/session_serializer.rb | Ruby | mit | 194 | main | 29,619 | # frozen_string_literal: true
module Clacky
class Agent
# Session serialization for saving and restoring agent state
# Handles session data serialization and deserialization
module SessionSerializer
# Restore from a saved session
# @param session_data [Hash] Saved session data
def resto... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/skill_evolution.rb | Ruby | mit | 194 | main | 1,462 | # frozen_string_literal: true
module Clacky
class Agent
# Unified entry point for skill self-evolution system.
# Coordinates two scenarios:
# 1. Auto-create new skills from complex task patterns
# 2. Reflect on executed skills and suggest improvements
#
# Triggered at the end of Agent#run... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/message_compressor_helper.rb | Ruby | mit | 194 | main | 32,234 | # frozen_string_literal: true
module Clacky
class Agent
# Message compression functionality for managing conversation history
# Handles automatic compression when token limits are exceeded
module MessageCompressorHelper
# Compression thresholds
COMPRESSION_THRESHOLD = 150_000 # Trigger compr... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/memory_updater.rb | Ruby | mit | 194 | main | 11,228 | # frozen_string_literal: true
module Clacky
class Agent
# Long-term memory update functionality.
#
# Runs at the end of a qualifying task to persist important knowledge
# into ~/.clacky/memories/. The LLM decides:
# - Which topics were discussed
# - Which memory files to update or create
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/message_compressor.rb | Ruby | mit | 194 | main | 10,131 | # frozen_string_literal: true
module Clacky
# Message compressor using Insert-then-Compress strategy
#
# New Strategy: Instead of creating a separate API call for compression,
# we insert a compression instruction into the current conversation flow.
# This allows us to reuse the existing cache (system prompt... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/skill_auto_creator.rb | Ruby | mit | 194 | main | 5,082 | # frozen_string_literal: true
module Clacky
class Agent
# Scenario 1: Auto-create new skills from complex task patterns.
#
# After completing a complex task (high iteration count, no existing skill used),
# forks a subagent to analyze if the workflow is reusable and worth capturing
# as a new ski... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/agent/time_machine.rb | Ruby | mit | 194 | main | 7,130 | # frozen_string_literal: true
module Clacky
class Agent
# Time Machine module for task history management with undo/redo support
# Stores complete file snapshots (AFTER state) to support message compression
module TimeMachine
# Initialize Time Machine state
private def init_time_machine
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_parsers/pdf_parser.rb | Ruby | mit | 194 | main | 1,836 | #!/usr/bin/env ruby
# frozen_string_literal: true
#
# Clacky PDF Parser — CLI interface
#
# Usage:
# ruby pdf_parser.rb <file_path>
#
# Output:
# stdout — extracted text content (UTF-8)
# stderr — error messages
# exit 0 — success
# exit 1 — failure
#
# This file lives in ~/.clacky/parsers/ and can be modifie... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_parsers/pptx_parser.rb | Ruby | mit | 194 | main | 3,111 | #!/usr/bin/env ruby
# frozen_string_literal: true
#
# Clacky PPTX Parser — CLI interface
#
# Usage:
# ruby pptx_parser.rb <file_path>
#
# Output:
# stdout — extracted content in Markdown (UTF-8)
# stderr — error messages
# exit 0 — success
# exit 1 — failure
#
# Dependencies: rubyzip gem (gem install rubyzip)... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_parsers/xlsx_parser.rb | Ruby | mit | 194 | main | 2,861 | #!/usr/bin/env ruby
# frozen_string_literal: true
#
# Clacky XLSX Parser — CLI interface
#
# Usage:
# ruby xlsx_parser.rb <file_path>
#
# Output:
# stdout — extracted content in Markdown tables (UTF-8)
# stderr — error messages
# exit 0 — success
# exit 1 — failure
#
# Dependencies: rubyzip gem (gem install r... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_parsers/doc_parser.rb | Ruby | mit | 194 | main | 1,547 | #!/usr/bin/env ruby
# frozen_string_literal: true
#
# Clacky DOC Parser — CLI interface
#
# Usage:
# ruby doc_parser.rb <file_path>
#
# Output:
# stdout — extracted text content (UTF-8)
# stderr — error messages
# exit 0 — success
# exit 1 — failure
#
# This file lives in ~/.clacky/parsers/ and can be modifie... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_parsers/docx_parser.rb | Ruby | mit | 194 | main | 4,551 | #!/usr/bin/env ruby
# frozen_string_literal: true
# encoding: utf-8
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
#
# Clacky DOCX Parser — CLI interface
#
# Usage:
# ruby docx_parser.rb <file_path>
#
# Output:
# stdout — extracted text in Markdown (UTF-8)
# stderr — err... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/channel-setup/feishu_setup.rb | Ruby | mit | 194 | main | 20,828 | #!/usr/bin/env ruby
# frozen_string_literal: true
# feishu_setup.rb — Automated Feishu channel setup via internal API.
#
# Strategy: Use browser (via clacky server's /api/tool/browser) ONLY to:
# 1. Check login status and grab Cookie + CSRF token
# 2. Navigate to trigger session initialization
#
# Then call Feishu... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/channel-setup/weixin_setup.rb | Ruby | mit | 194 | main | 9,525 | #!/usr/bin/env ruby
# frozen_string_literal: true
# weixin_setup.rb — Automated Weixin (WeChat iLink) channel setup.
#
# Modes:
# --fetch-qr Output JSON {qrcode_url, qrcode_id} then exit — used by Agent/browser flow
# --qrcode-id <id> Skip QR fetch, use existing qrcode_id, long-poll until confirmed, th... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/skill-creator/scripts/validate_skill_frontmatter.rb | Ruby | mit | 194 | main | 4,480 | #!/usr/bin/env ruby
# frozen_string_literal: true
# validate_skill_frontmatter.rb
#
# Validates and auto-fixes the YAML frontmatter of a SKILL.md file.
#
# Usage:
# ruby validate_skill_frontmatter.rb <path/to/SKILL.md>
#
# What it does:
# 1. Parses the frontmatter between --- delimiters
# 2. If YAML is invalid O... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/set_deploy_variables.rb | Ruby | mit | 194 | main | 7,151 | # frozen_string_literal: true
require "open3"
module Clacky
module DeployTools
# Set environment variables on a Railway service via `railway variables --set`.
# Uses RAILWAY_TOKEN passed through environment — no clackycli wrapper needed.
#
# Supports both normal key=value pairs and Railway inter-ser... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/list_services.rb | Ruby | mit | 194 | main | 2,229 | # frozen_string_literal: true
require "open3"
require "json"
module Clacky
module DeployTools
# List Railway services for the linked project.
# Uses RAILWAY_TOKEN passed through environment — no clackycli wrapper needed.
#
# NOTE: In the new deploy flow, service discovery is primarily done via the
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/check_health.rb | Ruby | mit | 194 | main | 3,472 | # frozen_string_literal: true
require 'net/http'
require 'uri'
require 'json'
module Clacky
module DeployTools
# Perform HTTP health check on deployed application
class CheckHealth
DEFAULT_PATH = '/'
DEFAULT_TIMEOUT = 30
MAX_TIMEOUT = 120
# Perform health check
#
# @para... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/fetch_runtime_logs.rb | Ruby | mit | 194 | main | 2,700 | # frozen_string_literal: true
require "net/http"
require "uri"
require "json"
module Clacky
module DeployTools
# Fetch runtime (environment) logs from a deployed Railway service via
# the Clacky Deploy API SSE endpoint.
#
# Uses DeployApiClient#stream_build_logs for build-phase logs (on failure),
... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/create_database_service.rb | Ruby | mit | 194 | main | 11,075 | # frozen_string_literal: true
require "json"
require "tempfile"
module Clacky
module DeployTools
# Create a PostgreSQL database service on Railway and wait for it to be ready.
#
# This tool handles the known Railway CLI bug where `railway add` returns an
# error exit code when using project tokens, ... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/report_deploy_status.rb | Ruby | mit | 194 | main | 1,981 | # frozen_string_literal: true
module Clacky
module DeployTools
# Report deployment status to user with formatted output
class ReportDeployStatus
VALID_STATUSES = %w[analyzing deploying checking success failed].freeze
STATUS_ICONS = {
'analyzing' => '🔍',
'deploying' => '🚀'... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/tools/execute_deployment.rb | Ruby | mit | 194 | main | 3,467 | # frozen_string_literal: true
module Clacky
module DeployTools
# Trigger a Railway deployment via `railway up` (blocking, with live logs).
# Uses RAILWAY_TOKEN passed through environment — no clackycli wrapper needed.
class ExecuteDeployment
# Trigger deployment for a service (blocking - waits for... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/deploy/scripts/rails_deploy.rb | Ruby | mit | 194 | main | 53,181 | # frozen_string_literal: true
# Ensure all output is flushed immediately so users see live progress
# even when the script is run inside a subprocess (terminal / Open3).
$stdout.sync = true
$stderr.sync = true
require "yaml"
require "json"
require "fileutils"
require "open3"
# Load gem libs — resolve path relative t... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/skill-add/scripts/install_from_zip.rb | Ruby | mit | 194 | main | 9,390 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'fileutils'
require 'tmpdir'
require 'uri'
require 'net/http'
require 'find'
# Install a skill from a remote zip archive URL.
# Usage: ruby install_from_zip.rb <zip_url>
#
# The zip archive is expected to contain a skill directory at its root, e.g.:
# my-ski... |
github | clacky-ai/openclacky | https://github.com/clacky-ai/openclacky | lib/clacky/default_skills/personal-website/publish.rb | Ruby | mit | 194 | main | 8,329 | #!/usr/bin/env ruby
# publish.rb — Publish or delete a profile card on the platform
#
# Usage:
# ruby publish.rb publish --name "NAME" --html-file /path/to/card.html
# ruby publish.rb delete --slug SLUG
#
# On first publish, prints the card URL and saves the update token to
# ~/.clacky/card_token (used for future ... |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | rack-reverse-proxy.gemspec | Ruby | mit | 194 | master | 1,282 | lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "rack_reverse_proxy/version"
# rubocop:disable
Gem::Specification.new do |spec|
spec.name = "rack-reverse-proxy"
spec.version = RackReverseProxy::VERSION
spec.authors = [
"Jon Swope",
... |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | Rakefile | Ruby | mit | 194 | master | 202 | require "rubygems"
require "rake"
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = "spec/**/*_spec.rb"
end
task :default => :spec |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | Gemfile | Ruby | mit | 194 | master | 424 | source "https://rubygems.org"
gemspec
ruby_version = RUBY_VERSION.to_f
rubocop_platform = [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
rubocop_platform = [:ruby_20, :ruby_21] if ruby_version < 2.0
group :test do
gem "rspec"
gem "rack-test"
gem "webmock"
gem "rubocop", :platform => rubocop_platform
g... |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | lib/rack_reverse_proxy.rb | Ruby | mit | 194 | master | 203 | require "rack_reverse_proxy/version"
require "rack_reverse_proxy/errors"
require "rack_reverse_proxy/rule"
require "rack_reverse_proxy/middleware"
# A Reverse Proxy for Rack
module RackReverseProxy
end |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | lib/rack_reverse_proxy/errors.rb | Ruby | mit | 194 | master | 770 | module RackReverseProxy
module Errors
# GenericURI indicates that url is too generic
class GenericURI < RuntimeError
attr_reader :url
def intialize(url)
@url = url
end
def to_s
%(Your URL "#{@url}" is too generic. Did you mean "http://#{@url}"?)
end
end
... |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | lib/rack_reverse_proxy/rule.rb | Ruby | mit | 194 | master | 4,427 | module RackReverseProxy
# Rule understands which urls need to be proxied
class Rule
# FIXME: It needs to be hidden
attr_reader :options
def initialize(spec, url = nil, options = {})
@has_custom_url = url.nil?
@url = url
@options = options
@spec = build_matcher(spec)
end
... |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | lib/rack_reverse_proxy/roundtrip.rb | Ruby | mit | 194 | master | 6,715 | require "rack_reverse_proxy/response_builder"
module RackReverseProxy
# FIXME: Enable them and fix issues during refactoring
# rubocop:disable Metrics/ClassLength
# RoundTrip represents one request-response made by rack-reverse-proxy
# middleware.
class RoundTrip
def initialize(app, env, global_options,... |
github | waterlink/rack-reverse-proxy | https://github.com/waterlink/rack-reverse-proxy | lib/rack_reverse_proxy/middleware.rb | Ruby | mit | 194 | master | 1,118 | require "net/http"
require "net/https"
require "rack-proxy"
require "rack_reverse_proxy/roundtrip"
module RackReverseProxy
# Rack middleware for handling reverse proxying
class Middleware
include NewRelic::Agent::Instrumentation::ControllerInstrumentation if defined? NewRelic
DEFAULT_OPTIONS = {
:pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.