初始提交:terminalX 可运行态(M0/M1/M1.5 已真机验证)

- M0: libghostty SSH 终端(渲染/输入/连接)+ 白屏修复(OutputGate) + 会话状态机/自动重连
- M1: tsnet 用户态组网 + SSH-over-tsnet(fd 桥),shell 级真机验证;R5(Go+gvisor+C+++Swift 同进程) retire
- M1.5: tmux -CC 原生 tab(MVP)
- 结构: packages/(TXCore·TXTransport), apps/TerminalX, vendor/(libghostty-spm/libssh2/mbedtls/tsnet-bridge), artifacts/
- 文档: CLAUDE.md + docs/HANDOFF.md(新会话入口)
- 环境: 认证代理→依赖 vendor 本地化;Go 在 ~/.local/go;仅模拟器/未签名
- 待续: M2 mosh, tmux 多 pane, M4 安全(host key/SE)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
kid
2026-07-24 10:20:46 +08:00
commit aa92d0e676
2761 changed files with 803505 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
# Copyright (C) Viktor Szakats
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.7)
message(STATUS "Using CMake version ${CMAKE_VERSION}")
project(test-dependent C)
option(TEST_INTEGRATION_MODE "Integration mode" "find_package")
message(STATUS "TEST_INTEGRATION_MODE: ${TEST_INTEGRATION_MODE}")
if(TEST_INTEGRATION_MODE STREQUAL "find_package" OR
TEST_INTEGRATION_MODE STREQUAL "ExternalProject")
if(TEST_INTEGRATION_MODE STREQUAL "ExternalProject")
include(ExternalProject)
ExternalProject_Add(libssh2
URL "${FROM_ARCHIVE}"
URL_HASH "SHA256=${FROM_HASH}"
INSTALL_COMMAND ""
DOWNLOAD_EXTRACT_TIMESTAMP ON)
endif()
find_package(libssh2 REQUIRED CONFIG)
find_package(libssh2 REQUIRED CONFIG) # test for double-inclusion
foreach(result_var IN ITEMS libssh2_FOUND libssh2_VERSION)
if(${result_var})
message(STATUS "${result_var}: |${${result_var}}|")
else()
message(FATAL_ERROR "'${result_var}' variable not set by the libssh2 package.")
endif()
endforeach()
elseif(TEST_INTEGRATION_MODE STREQUAL "add_subdirectory")
add_subdirectory(libssh2)
elseif(TEST_INTEGRATION_MODE STREQUAL "FetchContent")
include(FetchContent)
option(FROM_GIT_REPO "Git URL" "https://github.com/libssh2/libssh2.git")
option(FROM_GIT_TAG "Git tag" "master")
FetchContent_Declare(libssh2
GIT_REPOSITORY "${FROM_GIT_REPO}"
GIT_TAG "${FROM_GIT_TAG}")
FetchContent_MakeAvailable(libssh2)
endif()
add_executable(test-dependent-static-ns "test.c")
target_link_libraries(test-dependent-static-ns PRIVATE "libssh2::libssh2_static")
add_executable(test-dependent-shared-ns "test.c")
target_link_libraries(test-dependent-shared-ns PRIVATE "libssh2::libssh2_shared")
# Alias for either shared or static library
add_executable(test-dependent-selected-ns "test.c")
target_link_libraries(test-dependent-selected-ns PRIVATE "libssh2::libssh2")
if(TEST_INTEGRATION_MODE STREQUAL "find_package" OR
TEST_INTEGRATION_MODE STREQUAL "ExternalProject")
# Compatibility alias
add_executable(test-dependent-compat "test.c")
target_link_libraries(test-dependent-compat PRIVATE "Libssh2::libssh2")
elseif(TEST_INTEGRATION_MODE STREQUAL "add_subdirectory" OR
TEST_INTEGRATION_MODE STREQUAL "FetchContent")
add_executable(test-dependent-static-bare "test.c")
target_link_libraries(test-dependent-static-bare PRIVATE "libssh2_static")
add_executable(test-dependent-shared-bare "test.c")
target_link_libraries(test-dependent-shared-bare PRIVATE "libssh2_shared")
add_executable(test-dependent-selected-bare "test.c")
target_link_libraries(test-dependent-selected-bare PRIVATE "libssh2")
endif()

13
vendor/libssh2/tests/cmake/test.c vendored Normal file
View File

@@ -0,0 +1,13 @@
/* Copyright (C) Viktor Szakats
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "libssh2.h"
#include <stdio.h>
int main(void)
{
printf("libssh2_version(0): |%s|\n", libssh2_version(0));
return 0;
}

30
vendor/libssh2/tests/cmake/test.sh vendored Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
#
# Copyright (C) Viktor Szakats
# SPDX-License-Identifier: BSD-3-Clause
set -e
set -u
cd "$(dirname "$0")"
rm -rf bld-fetchcontent; cmake -B bld-fetchcontent -DTEST_INTEGRATION_MODE=FetchContent \
-DFROM_GIT_REPO="${PWD}/../.." \
-DFROM_GIT_TAG="$(git rev-parse HEAD)"
make -j3 -C bld-fetchcontent
rm -rf libssh2; ln -s ../.. libssh2
rm -rf bld-add_subdirectory; cmake -B bld-add_subdirectory -DTEST_INTEGRATION_MODE=add_subdirectory
make -j3 -C bld-add_subdirectory
rm -rf bld-libssh2; cmake ../.. -B bld-libssh2
make -j3 -C bld-libssh2 DESTDIR=pkg install
rm -rf bld-find_package; cmake -B bld-find_package -DTEST_INTEGRATION_MODE=find_package \
-DCMAKE_PREFIX_PATH="${PWD}/bld-libssh2/pkg/usr/local/lib/cmake/libssh2"
make -j3 -C bld-find_package
(cd ../..; git archive --format=tar HEAD) | gzip > source.tar.gz
rm -rf bld-externalproject; cmake -B bld-externalproject -DTEST_INTEGRATION_MODE=ExternalProject \
-DFROM_ARCHIVE="${PWD}/source.tar.gz" \
-DFROM_HASH="$(openssl dgst -sha256 source.tar.gz | grep -a -i -o -E '[0-9a-f]{64}$')"
make -j3 -C bld-externalproject