Initial monorepo — everything BlackRoad in one place
bin/ 230 CLI tools (ask-*, br-*, agent-*, roadid, carpool) scripts/ 99 automation scripts fleet/ Node configs and deployment workers/ Cloudflare Worker sources (roadpay, road-search, squad webhooks) roadc/ RoadC programming language roadnet/ Mesh network (5 APs, WireGuard) operator/ Memory system scripts config/ System configs dotfiles/ Shell configs docs/ Documentation BlackRoad OS — Pave Tomorrow. RoadChain-SHA2048: d1a24f55318d338b RoadChain-Identity: alexa@sovereign RoadChain-Full: d1a24f55318d338b24b60bad7be39286379c76ae5470817482100cb0ddbbcb97e147d07ac7243da0a9f0363e4e5c833d612b9c0df3a3cd20802465420278ef74875a5b77f55af6fe42a931b8b635b3d0d0b6bde9abf33dc42eea52bc03c951406d8cbe49f1a3d29b26a94dade05e9477f34a7d4d4c6ec4005c3c2ac54e73a68440c512c8e83fd9b1fe234750b898ef8f4032c23db173961fe225e67a0432b5293a9714f76c5c57ed5fdf35b9fb40fd73c03ebf88b7253c6a0575f5afb6a6b49b3bda310602fb1ef676859962dad2aebbb2875814b30eee0a8ba195e482d4cbc91d8819e7f38f6db53e8063401649c77bb994371473cabfb917fb53e8cbe73d60
This commit is contained in:
222
bin/blackroad-container
Executable file
222
bin/blackroad-container
Executable file
@@ -0,0 +1,222 @@
|
||||
#!/usr/bin/env bash
|
||||
# ============================================================================
|
||||
# BLACKROAD OS, INC. - PROPRIETARY AND CONFIDENTIAL
|
||||
# Copyright (c) 2025-2026 BlackRoad OS, Inc. All Rights Reserved.
|
||||
#
|
||||
# This code is the intellectual property of BlackRoad OS, Inc.
|
||||
# AI-assisted development does not transfer ownership to AI providers.
|
||||
# Unauthorized use, copying, or distribution is prohibited.
|
||||
# NOT licensed for AI training or data extraction.
|
||||
# ============================================================================
|
||||
# Fixed br-container with proper escape handling
|
||||
|
||||
# Colors using printf instead of echo -e
|
||||
c_pink() { printf '\033[38;5;205m'; }
|
||||
c_blue() { printf '\033[38;5;75m'; }
|
||||
c_purple() { printf '\033[38;5;141m'; }
|
||||
c_orange() { printf '\033[38;5;208m'; }
|
||||
c_gray() { printf '\033[38;5;240m'; }
|
||||
c_white() { printf '\033[38;5;255m'; }
|
||||
c_reset() { printf '\033[0m'; }
|
||||
c_clear() { printf '\033[2J\033[H'; }
|
||||
|
||||
# Box drawing
|
||||
TL='╔'
|
||||
TR='╗'
|
||||
BL='╚'
|
||||
BR='╝'
|
||||
H='═'
|
||||
V='║'
|
||||
CROSS='╬'
|
||||
T_DOWN='╦'
|
||||
T_UP='╩'
|
||||
T_RIGHT='╠'
|
||||
T_LEFT='╣'
|
||||
|
||||
grid_layout() {
|
||||
local rows="${1:-2}"
|
||||
local cols="${2:-2}"
|
||||
local width="${3:-80}"
|
||||
local height="${4:-24}"
|
||||
|
||||
local cell_width=$((width / cols))
|
||||
local cell_height=$((height / rows))
|
||||
|
||||
c_clear
|
||||
c_pink; printf "Grid Layout: ${rows}×${cols}\n\n"; c_reset
|
||||
|
||||
# Draw grid
|
||||
for ((r=0; r<rows; r++)); do
|
||||
# Top border
|
||||
if [[ $r -eq 0 ]]; then
|
||||
c_purple
|
||||
printf "${TL}"
|
||||
for ((c=0; c<cols; c++)); do
|
||||
printf '%*s' $((cell_width-1)) '' | tr ' ' "${H}"
|
||||
[[ $c -lt $((cols-1)) ]] && printf "${T_DOWN}"
|
||||
done
|
||||
printf "${TR}\n"
|
||||
c_reset
|
||||
else
|
||||
c_purple
|
||||
printf "${T_RIGHT}"
|
||||
for ((c=0; c<cols; c++)); do
|
||||
printf '%*s' $((cell_width-1)) '' | tr ' ' "${H}"
|
||||
[[ $c -lt $((cols-1)) ]] && printf "${CROSS}"
|
||||
done
|
||||
printf "${T_LEFT}\n"
|
||||
c_reset
|
||||
fi
|
||||
|
||||
# Cell content
|
||||
for ((line=0; line<cell_height-1; line++)); do
|
||||
for ((c=0; c<cols; c++)); do
|
||||
c_purple; printf "${V}"; c_reset
|
||||
printf '%*s' $((cell_width-1)) ''
|
||||
done
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
done
|
||||
done
|
||||
|
||||
# Bottom border
|
||||
c_purple
|
||||
printf "${BL}"
|
||||
for ((c=0; c<cols; c++)); do
|
||||
printf '%*s' $((cell_width-1)) '' | tr ' ' "${H}"
|
||||
[[ $c -lt $((cols-1)) ]] && printf "${T_UP}"
|
||||
done
|
||||
printf "${BR}\n"
|
||||
c_reset
|
||||
}
|
||||
|
||||
split_horizontal() {
|
||||
local width="${1:-80}"
|
||||
local height="${2:-24}"
|
||||
local half_height=$((height / 2))
|
||||
|
||||
c_clear
|
||||
|
||||
# Top pane
|
||||
c_purple; printf "${TL}"; c_reset
|
||||
printf '%*s' $((width-2)) '' | tr ' ' "${H}"
|
||||
c_purple; printf "${TR}\n"; c_reset
|
||||
|
||||
c_purple; printf "${V}"; c_reset
|
||||
c_blue; printf " Top Pane"; c_reset
|
||||
printf '%*s' $((width - 12)) ''
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
|
||||
for ((i=0; i<half_height-3; i++)); do
|
||||
c_purple; printf "${V}"; c_reset
|
||||
printf '%*s' $((width-2)) ''
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
done
|
||||
|
||||
# Middle
|
||||
c_purple; printf "${T_RIGHT}"; c_reset
|
||||
printf '%*s' $((width-2)) '' | tr ' ' "${H}"
|
||||
c_purple; printf "${T_LEFT}\n"; c_reset
|
||||
|
||||
# Bottom pane
|
||||
c_purple; printf "${V}"; c_reset
|
||||
c_orange; printf " Bottom Pane"; c_reset
|
||||
printf '%*s' $((width - 15)) ''
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
|
||||
for ((i=0; i<half_height-3; i++)); do
|
||||
c_purple; printf "${V}"; c_reset
|
||||
printf '%*s' $((width-2)) ''
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
done
|
||||
|
||||
# Bottom border
|
||||
c_purple; printf "${BL}"; c_reset
|
||||
printf '%*s' $((width-2)) '' | tr ' ' "${H}"
|
||||
c_purple; printf "${BR}\n"; c_reset
|
||||
}
|
||||
|
||||
dashboard() {
|
||||
local width="${1:-120}"
|
||||
local height="${2:-40}"
|
||||
|
||||
c_clear
|
||||
|
||||
# Header
|
||||
c_purple; printf "${TL}"; c_reset
|
||||
printf '%*s' $((width-2)) '' | tr ' ' "${H}"
|
||||
c_purple; printf "${TR}\n"; c_reset
|
||||
|
||||
c_purple; printf "${V}"; c_reset
|
||||
c_pink; printf " BlackRoad OS Dashboard"; c_reset
|
||||
printf '%*s' $((width - 25)) ''
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
|
||||
c_purple; printf "${T_RIGHT}"; c_reset
|
||||
printf '%*s' $((width-2)) '' | tr ' ' "${H}"
|
||||
c_purple; printf "${T_LEFT}\n"; c_reset
|
||||
|
||||
# 3 columns
|
||||
local col1_width=$((width / 3))
|
||||
local col2_width=$((width / 3))
|
||||
local col3_width=$((width - col1_width - col2_width))
|
||||
|
||||
for ((row=0; row<height-4; row++)); do
|
||||
c_purple; printf "${V}"; c_reset
|
||||
if [[ $row -eq 0 ]]; then
|
||||
c_blue; printf " Status"; c_reset
|
||||
printf '%*s' $((col1_width - 9)) ''
|
||||
else
|
||||
printf '%*s' $((col1_width - 2)) ''
|
||||
fi
|
||||
|
||||
c_purple; printf "${V}"; c_reset
|
||||
if [[ $row -eq 0 ]]; then
|
||||
c_orange; printf " Metrics"; c_reset
|
||||
printf '%*s' $((col2_width - 10)) ''
|
||||
else
|
||||
printf '%*s' $((col2_width - 2)) ''
|
||||
fi
|
||||
|
||||
c_purple; printf "${V}"; c_reset
|
||||
if [[ $row -eq 0 ]]; then
|
||||
c_white; printf " Logs"; c_reset
|
||||
printf '%*s' $((col3_width - 7)) ''
|
||||
else
|
||||
printf '%*s' $((col3_width - 2)) ''
|
||||
fi
|
||||
|
||||
c_purple; printf "${V}\n"; c_reset
|
||||
done
|
||||
|
||||
# Footer
|
||||
c_purple; printf "${BL}"; c_reset
|
||||
printf '%*s' $((width-2)) '' | tr ' ' "${H}"
|
||||
c_purple; printf "${BR}\n"; c_reset
|
||||
}
|
||||
|
||||
case "${1:-help}" in
|
||||
grid)
|
||||
grid_layout "${2:-2}" "${3:-2}" "${4:-80}" "${5:-24}"
|
||||
;;
|
||||
hsplit|horizontal)
|
||||
split_horizontal "${2:-80}" "${3:-24}"
|
||||
;;
|
||||
dashboard)
|
||||
dashboard "${2:-120}" "${3:-40}"
|
||||
;;
|
||||
test)
|
||||
printf "Testing colors:\n"
|
||||
c_pink; printf "Pink "; c_reset
|
||||
c_blue; printf "Blue "; c_reset
|
||||
c_purple; printf "Purple "; c_reset
|
||||
c_orange; printf "Orange\n"; c_reset
|
||||
;;
|
||||
*)
|
||||
c_pink; printf "BlackRoad Container System (Fixed)\n\n"; c_reset
|
||||
printf "Usage:\n"
|
||||
c_blue; printf " grid"; c_reset; printf " [rows] [cols] [width] [height]\n"
|
||||
c_blue; printf " hsplit"; c_reset; printf " [width] [height]\n"
|
||||
c_blue; printf " dashboard"; c_reset; printf " [width] [height]\n"
|
||||
c_blue; printf " test"; c_reset; printf " - Test escape codes\n"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user