-
Notifications
You must be signed in to change notification settings - Fork 85
RCLI Open Frontier: coding harness, browser cloud auth, hosted OpenCode, and release hardening #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
94b7913
2433759
f2a0fe2
d294b32
a986856
645252d
69a47d2
b28c1fc
536ecfb
5b3de31
c77a231
8f7619d
8f7c6ac
609e192
e4467ab
edd8aea
bc8fc37
824b732
b401336
cb3e3e3
fe62112
384ce42
04ce064
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,44 @@ aliases (`run`, `pull`, `stt`). One `configure_*` wires both. See | |
| Do not reintroduce FetchContent of the SDK, a second inference backend tree, | ||
| or a retired MetalRT / hardcoded catalog. | ||
|
|
||
| ## Signing in to a console | ||
|
|
||
| `rcli login` is a device flow, the same shape `gh auth login` uses. The terminal | ||
| asks for a code, a browser the person already trusts approves it, and the | ||
| terminal collects a key. No password ever reaches the CLI. | ||
|
|
||
| The four endpoints it calls are **not ours to rename**: an installed binary | ||
| talks to whatever the console deploys, so a field or path change breaks every | ||
| copy in the wild. They are `POST /auth/cli/start`, `/auth/cli/poll`, | ||
| `/auth/cli/refresh`, and `GET /v1/me`. The console side has a test that reads | ||
|
Comment on lines
+72
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Document the revoke endpoint. The paragraph says the client uses four endpoints. The account contract test in 🤖 Prompt for AI Agents |
||
| `src/account/console.cpp` directly and fails if the two drift. | ||
|
|
||
| Two secrets do different jobs. `request_code` is public and names the attempt; | ||
| `poll_secret` proves the process collecting the grant is the one that started | ||
| it. The console stores only a hash of the second. | ||
|
|
||
| `RCLI_CONSOLE_URL` points at the console; it defaults to `http://localhost:8080`, | ||
| which is nothing, so a local run needs it set. `RCLI_PROFILE_DIR` moves the | ||
| credential file, which is what lets several accounts share one machine. | ||
|
|
||
| The credential is a normal API key with the customer's credit behind it. Treat | ||
| it as one: it goes in the profile file at `0600` and nowhere else, and it is | ||
| never logged. | ||
|
|
||
| ## Building against the SDK | ||
|
|
||
| `RCLI_SDK_KIT` points at a built kit, not at SDK source. `cmake/sdk-pin.cmake` | ||
| pins the IDL version and its hash; a mismatch is a hard error and the fix is to | ||
| consume a matching kit or bump the pin, **never to run protoc**. | ||
|
|
||
| Two binaries come out of a build. `rcli-cxx` is the CLI. `rcli` is the same | ||
| thing plus the MLX backend, and it only builds when `RCLI_SDK_SWIFT_PATH` names | ||
| an SDK checkout with the Swift tree. Ship `rcli`. | ||
|
|
||
| MLX resolves its Metal shaders from `mlx-swift_Cmlx.bundle` beside the | ||
| executable. Copy the binary somewhere on its own and MLX silently fails to | ||
| register, so an install puts both together and points a wrapper at them. | ||
|
|
||
| ## Configuration and secrets | ||
|
|
||
| - Read environment in one place (`GlobalOptions` / `bootstrap()`). | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,19 @@ set(RCLI_SOURCES | |
| src/commands/cmd_voice.cpp | ||
| src/commands/cmd_rag.cpp | ||
| src/commands/cmd_bench.cpp | ||
| src/commands/cmd_editors.cpp | ||
| src/commands/cmd_harness.cpp | ||
| src/commands/cmd_account.cpp | ||
| src/account/console.cpp | ||
| src/account/credentials.cpp | ||
| src/anthropic/messages.cpp | ||
| src/anthropic/translate.cpp | ||
| src/desktop/claude_profile.cpp | ||
| src/harness/harness.cpp | ||
| src/harness/opencode.cpp | ||
| src/harness/local_models.cpp | ||
| src/ide/jetbrains_profile.cpp | ||
| src/ide/openai_proxy.cpp | ||
| src/commands/engine_options.cpp | ||
| src/commands/model_setup.cpp | ||
| src/config/cli_paths.cpp | ||
|
|
@@ -79,12 +92,43 @@ endif() | |
| target_include_directories(rcli_core PUBLIC | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/include" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/src" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/third_party" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/third_party/CLI11" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/third_party/linenoise" | ||
| ) | ||
|
|
||
| # The Anthropic translator and the JetBrains proxy need an HTTP client and a | ||
| # JSON reader. Both used to arrive from the SDK's own source build; a kit | ||
| # consumer never configures that build, so they are fetched here. | ||
| # | ||
| # Fetched rather than vendored on purpose. Checking cpp-httplib in would drop | ||
| # thirty thousand lines of somebody else's code into this repo, where the | ||
| # security scanner reads it as ours and flags the http:// URLs an HTTP client | ||
| # is obliged to construct. | ||
| include(FetchContent) | ||
| set(HTTPLIB_REQUIRE_OPENSSL OFF CACHE BOOL "" FORCE) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Description: Inspect cpp-httplib v0.46.1 TLS options and how our sources build clients.
set -euo pipefail
curl -sL https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/CMakeLists.txt \
| rg -n 'OPENSSL|CPPHTTPLIB_OPENSSL_SUPPORT' -C2
# Where an upstream base_url becomes an httplib client.
rg -nP --type=cpp -C3 'httplib::Client\s*\w*\(' srcRepository: RunanywhereAI/RCLI Length of output: 6803 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- repository conventions and learnings ---'
find /tmp/coderabbit-repo-knowledge/runanywhereai-rcli-099d596b \
-maxdepth 2 -type f -name '*.md' -print -exec sh -c 'echo "--- $1"; head -80 "$1"' sh {} \;
printf '%s\n' '--- changed CMake context ---'
cat -n CMakeLists.txt | sed -n '95,120p'
printf '%s\n' '--- Runtime/origin definitions and uses ---'
rg -n -P -C3 'struct Runtime|class Runtime|Runtime\s*\{|origin\s*=|base_url|runtime\.origin|\*origin' \
src/ide/openai_proxy.cpp src/anthropic/messages.cpp src
printf '%s\n' '--- pinned cpp-httplib HTTPS behavior ---'
curl -sSfL https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/httplib.h \
| rg -n -C4 'https scheme is not supported|scheme is not supported|CPPHTTPLIB_OPENSSL_SUPPORT|Client\(const std::string|Client\(std::string|make_client|https://' \
| head -240Repository: RunanywhereAI/RCLI Length of output: 50374 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- pinned cpp-httplib no-TLS HTTPS path ---'
curl -sSfL https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/httplib.h \
| rg -n -C8 'https scheme is not supported|scheme is not supported|CPPHTTPLIB_OPENSSL_SUPPORT|is_ssl\(\)|https://' \
| head -180
printf '%s\n' '--- hosted endpoint construction ---'
cat -n src/harness/harness.cpp | sed -n '260,285p'
cat -n src/bootstrap.h | sed -n '34,44p'
cat -n src/anthropic/messages.cpp | sed -n '18,35p;180,195p'
cat -n src/ide/openai_proxy.cpp | sed -n '20,35p;360,375p'Repository: RunanywhereAI/RCLI Length of output: 6528 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
import urllib.request
url = "https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/httplib.h"
text = urllib.request.urlopen(url).read().decode()
lines = text.splitlines()
needles = ("scheme", "SSL_ENABLED", "OPENSSL_SUPPORT", "is_ssl", "SSLNotSupported",
"SSLConnection", "HTTPS")
for i, line in enumerate(lines):
if any(n.lower() in line.lower() for n in needles):
lo = max(0, i - 4)
hi = min(len(lines), i + 5)
print(f"--- lines {lo + 1}-{hi} ---")
for j in range(lo, hi):
print(f"{j + 1}:{lines[j]}")
PYRepository: RunanywhereAI/RCLI Length of output: 2442 🏁 Script executed: #!/bin/bash
set -euo pipefail
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
curl -ksSfL https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/httplib.h -o "$tmp"
rg -n -i -C6 'scheme|ssl_enabled|cpphttplib_open_ssl_support|sslnot|https' "$tmp" \
| sed -n '1,220p'Repository: RunanywhereAI/RCLI Length of output: 7286 🏁 Script executed: #!/bin/bash
set -euo pipefail
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
curl -ksSfL https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/httplib.h -o "$tmp"
rg -n -i -C8 \
'Client::Client|ClientImpl::ClientImpl|scheme_host_port|is_ssl_|unsupported|not supported|SSLNotSupported|Error::' \
"$tmp" | sed -n '1,260p'Repository: RunanywhereAI/RCLI Length of output: 7989 🏁 Script executed: #!/bin/bash
set -euo pipefail
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
curl -ksSfL https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.46.1/httplib.cc -o "$tmp"
rg -n -i -C8 \
'ClientImpl::ClientImpl|Client::Client|scheme_host_port|is_ssl_|unsupported|not supported|SSL_ENABLED|parse_url|https' \
"$tmp" | sed -n '1,260p'Repository: RunanywhereAI/RCLI Length of output: 258 Require OpenSSL for cpp-httplib. When OpenSSL is unavailable, 🤖 Prompt for AI Agents |
||
| set(JSON_BuildTests OFF CACHE BOOL "" FORCE) | ||
| FetchContent_Declare(cpp_httplib | ||
| GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git | ||
| GIT_TAG v0.46.1 | ||
| GIT_SHALLOW TRUE) | ||
| FetchContent_Declare(nlohmann_json | ||
| GIT_REPOSITORY https://github.com/nlohmann/json.git | ||
| GIT_TAG v3.11.3 | ||
| GIT_SHALLOW TRUE) | ||
| FetchContent_MakeAvailable(cpp_httplib nlohmann_json) | ||
|
|
||
| find_package(Threads REQUIRED) | ||
| target_link_libraries(rcli_core PUBLIC rac_commons Threads::Threads) | ||
| target_link_libraries(rcli_core PRIVATE httplib::httplib nlohmann_json::nlohmann_json) | ||
| if(WIN32) | ||
| # The console client uses the Windows system HTTP stack so source builds and | ||
| # release archives do not need curl/OpenSSL DLLs beside rcli.exe. | ||
| target_link_libraries(rcli_core PRIVATE winhttp) | ||
| else() | ||
| find_package(CURL REQUIRED) | ||
| target_link_libraries(rcli_core PRIVATE CURL::libcurl) | ||
| endif() | ||
| target_compile_definitions(rcli_core PUBLIC | ||
| RCLI_VERSION="${PROJECT_VERSION}" | ||
| RCLI_PINNED_SDK_VERSION="${RCLI_PINNED_SDK_VERSION}" | ||
|
|
@@ -112,6 +156,8 @@ endif() | |
| # Include path + google=runanywhere_internal come from RunAnywhere::commons. | ||
|
|
||
| if(APPLE) | ||
| # SecItem, for the credential a JetBrains IDE reads its provider key from. | ||
| target_link_libraries(rcli_core PRIVATE "-framework Security" "-framework CoreFoundation") | ||
| target_link_libraries(rcli_core PUBLIC "-framework IOKit" "-framework CoreFoundation") | ||
| endif() | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.