refactor: пространство имён Rsgrinko\AiSdk

AiSdk\ → Rsgrinko\AiSdk\, AiSdk\Tools\ → Rsgrinko\AiSdk\Tools\: автозагрузка
в bootstrap.php, исходники, тесты, примеры и документация.

Несовместимое изменение: в подключающем коде нужно поправить use.
This commit is contained in:
rsgrinko committed 2026-11-13 15:53:13 +03:00
1 parent ad4dfc3388
commit 0f08f35ba4
79 files changed
+265 -265

No files matched your search

+5 -5
View File
@@ -4,11 +4,11 @@ declare(strict_types=1);
// Тесты: agent. Запускаются из tests/run.php.
use AiSdk\Agent;
use AiSdk\Tool;
use AiSdk\ToolRegistry;
use AiSdk\Tools\CalculatorTool;
use AiSdk\Tools\FinishTool;
use Rsgrinko\AiSdk\Agent;
use Rsgrinko\AiSdk\Tool;
use Rsgrinko\AiSdk\ToolRegistry;
use Rsgrinko\AiSdk\Tools\CalculatorTool;
use Rsgrinko\AiSdk\Tools\FinishTool;
// ---------------------------------------------------------------------------
// Агент
+1 -1
View File
@@ -9,7 +9,7 @@ test('архитектура: ядро не зависит от инструме
$code = (string) file_get_contents($file);
assertTrue(
preg_match('/^use AiSdk\\\\Tools\\\\/m', $code) !== 1,
preg_match('/^use Rsgrinko\\\\AiSdk\\\\Tools\\\\/m', $code) !== 1,
'ядро импортирует инструменты: ' . basename($file)
);
}
+6 -6
View File
@@ -5,12 +5,12 @@ declare(strict_types=1);
// Тесты: AiClient по настоящему HTTP против поддельного сервера
// (tests/stub/llm-server.php). Внешняя сеть не нужна.
use AiSdk\Agent;
use AiSdk\AiClient;
use AiSdk\AiException;
use AiSdk\Retry;
use AiSdk\ToolRegistry;
use AiSdk\Tools\CalculatorTool;
use Rsgrinko\AiSdk\Agent;
use Rsgrinko\AiSdk\AiClient;
use Rsgrinko\AiSdk\AiException;
use Rsgrinko\AiSdk\Retry;
use Rsgrinko\AiSdk\ToolRegistry;
use Rsgrinko\AiSdk\Tools\CalculatorTool;
/**
* Поднять встроенный сервер PHP один раз на весь прогон.
+2 -2
View File
@@ -4,8 +4,8 @@ declare(strict_types=1);
// Тесты: database. SQLite в памяти — тот же PDO, сервер не нужен.
use AiSdk\Tools\DatabaseTool;
use AiSdk\Tools\Support\TextTable;
use Rsgrinko\AiSdk\Tools\DatabaseTool;
use Rsgrinko\AiSdk\Tools\Support\TextTable;
function demoDb(): PDO
{
+8 -8
View File
@@ -4,14 +4,14 @@ declare(strict_types=1);
// Тесты: files. Запускаются из tests/run.php.
use AiSdk\Tools\CsvQueryTool;
use AiSdk\Tools\FileSandbox;
use AiSdk\Tools\FindFilesTool;
use AiSdk\Tools\ListDirTool;
use AiSdk\Tools\ReadFileTool;
use AiSdk\Tools\ReplaceInFileTool;
use AiSdk\Tools\SearchFilesTool;
use AiSdk\Tools\WriteFileTool;
use Rsgrinko\AiSdk\Tools\CsvQueryTool;
use Rsgrinko\AiSdk\Tools\FileSandbox;
use Rsgrinko\AiSdk\Tools\FindFilesTool;
use Rsgrinko\AiSdk\Tools\ListDirTool;
use Rsgrinko\AiSdk\Tools\ReadFileTool;
use Rsgrinko\AiSdk\Tools\ReplaceInFileTool;
use Rsgrinko\AiSdk\Tools\SearchFilesTool;
use Rsgrinko\AiSdk\Tools\WriteFileTool;
// ---------------------------------------------------------------------------
// Файлы
+5 -5
View File
@@ -4,11 +4,11 @@ declare(strict_types=1);
// Тесты: хуки агента — шаги, инструменты, ответ, остановка.
use AiSdk\Agent;
use AiSdk\AgentHooks;
use AiSdk\ToolRegistry;
use AiSdk\Tools\CalculatorTool;
use AiSdk\Tools\FinishTool;
use Rsgrinko\AiSdk\Agent;
use Rsgrinko\AiSdk\AgentHooks;
use Rsgrinko\AiSdk\ToolRegistry;
use Rsgrinko\AiSdk\Tools\CalculatorTool;
use Rsgrinko\AiSdk\Tools\FinishTool;
test('hooks: шаги, инструменты и ответ идут по порядку', function (): void {
$events = [];
+6 -6
View File
@@ -4,12 +4,12 @@ declare(strict_types=1);
// Тесты: http. Запускаются из tests/run.php.
use AiSdk\AiException;
use AiSdk\HttpTransport;
use AiSdk\Tools\Support\HttpRequest;
use AiSdk\Tool;
use AiSdk\Tools\HttpRequestTool;
use AiSdk\Tools\Support\UrlGuard;
use Rsgrinko\AiSdk\AiException;
use Rsgrinko\AiSdk\HttpTransport;
use Rsgrinko\AiSdk\Tools\Support\HttpRequest;
use Rsgrinko\AiSdk\Tool;
use Rsgrinko\AiSdk\Tools\HttpRequestTool;
use Rsgrinko\AiSdk\Tools\Support\UrlGuard;
// ---------------------------------------------------------------------------
// http_request: сборка запроса (без сети)
+7 -7
View File
@@ -4,13 +4,13 @@ declare(strict_types=1);
// Тесты: logging. Запускаются из tests/run.php.
use AiSdk\Agent;
use AiSdk\ChatClient;
use AiSdk\ChatResult;
use AiSdk\LoggingClient;
use AiSdk\ToolRegistry;
use AiSdk\Tools\CalculatorTool;
use AiSdk\Tools\TimeTool;
use Rsgrinko\AiSdk\Agent;
use Rsgrinko\AiSdk\ChatClient;
use Rsgrinko\AiSdk\ChatResult;
use Rsgrinko\AiSdk\LoggingClient;
use Rsgrinko\AiSdk\ToolRegistry;
use Rsgrinko\AiSdk\Tools\CalculatorTool;
use Rsgrinko\AiSdk\Tools\TimeTool;
// ---------------------------------------------------------------------------
// Логирование
+2 -2
View File
@@ -4,8 +4,8 @@ declare(strict_types=1);
// Тесты: повтор запроса к модели при временных сбоях. Без сети и без пауз.
use AiSdk\AiException;
use AiSdk\Retry;
use Rsgrinko\AiSdk\AiException;
use Rsgrinko\AiSdk\Retry;
/**
* Retry с записью пауз вместо реального ожидания.
+1 -1
View File
@@ -4,7 +4,7 @@ declare(strict_types=1);
// Тесты: shell. Запускаются из tests/run.php.
use AiSdk\Tools\ShellTool;
use Rsgrinko\AiSdk\Tools\ShellTool;
// ---------------------------------------------------------------------------
// run_command: оболочка
+9 -9
View File
@@ -4,15 +4,15 @@ declare(strict_types=1);
// Тесты: таймаут от модели, стоимость запроса, накопление usage.
use AiSdk\Agent;
use AiSdk\ChatResult;
use AiSdk\Cost;
use AiSdk\ToolRegistry;
use AiSdk\Tools\HttpRequestTool;
use AiSdk\Tools\ShellTool;
use AiSdk\Tools\CalculatorTool;
use AiSdk\Tools\Support\Number;
use AiSdk\Tools\Support\Timeout;
use Rsgrinko\AiSdk\Agent;
use Rsgrinko\AiSdk\ChatResult;
use Rsgrinko\AiSdk\Cost;
use Rsgrinko\AiSdk\ToolRegistry;
use Rsgrinko\AiSdk\Tools\HttpRequestTool;
use Rsgrinko\AiSdk\Tools\ShellTool;
use Rsgrinko\AiSdk\Tools\CalculatorTool;
use Rsgrinko\AiSdk\Tools\Support\Number;
use Rsgrinko\AiSdk\Tools\Support\Timeout;
test('timeout: значение модели в пределах максимума', function (): void {
assertSame(5.0, Timeout::seconds(['timeout' => 5], 10.0, 60.0));
+9 -9
View File
@@ -4,15 +4,15 @@ declare(strict_types=1);
// Тесты: tools. Запускаются из tests/run.php.
use AiSdk\Tool;
use AiSdk\ToolRegistry;
use AiSdk\Tools\CalculatorTool;
use AiSdk\Tools\ConvertUnitsTool;
use AiSdk\Tools\DateCalcTool;
use AiSdk\Tools\JsonQueryTool;
use AiSdk\Tools\HashTool;
use AiSdk\Tools\TimeTool;
use AiSdk\Tools\UuidTool;
use Rsgrinko\AiSdk\Tool;
use Rsgrinko\AiSdk\ToolRegistry;
use Rsgrinko\AiSdk\Tools\CalculatorTool;
use Rsgrinko\AiSdk\Tools\ConvertUnitsTool;
use Rsgrinko\AiSdk\Tools\DateCalcTool;
use Rsgrinko\AiSdk\Tools\JsonQueryTool;
use Rsgrinko\AiSdk\Tools\HashTool;
use Rsgrinko\AiSdk\Tools\TimeTool;
use Rsgrinko\AiSdk\Tools\UuidTool;
// ---------------------------------------------------------------------------
// Инструменты
+2 -2
View File
@@ -4,8 +4,8 @@ declare(strict_types=1);
// Общие помощники и заглушки для тестов.
use AiSdk\ChatClient;
use AiSdk\ChatResult;
use Rsgrinko\AiSdk\ChatClient;
use Rsgrinko\AiSdk\ChatResult;
/**
* Тесты SDK: без сети, без модели и без API-ключа.