Fix bin/publish: copy docs.dist from project root

Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-10-21 02:08:33 +00:00
commit f6fac6c4bc
79758 changed files with 10547827 additions and 0 deletions

166
vendor/clue/ndjson-react/src/Decoder.php vendored Executable file
View File

@@ -0,0 +1,166 @@
<?php
namespace Clue\React\NDJson;
use Evenement\EventEmitter;
use React\Stream\ReadableStreamInterface;
use React\Stream\Util;
use React\Stream\WritableStreamInterface;
/**
* The Decoder / Parser reads from a plain stream and emits data objects for each JSON element
*/
class Decoder extends EventEmitter implements ReadableStreamInterface
{
private $input;
private $assoc;
private $depth;
private $options;
/** @var int */
private $maxlength;
private $buffer = '';
private $closed = false;
/**
* @param ReadableStreamInterface $input
* @param bool $assoc
* @param int $depth
* @param int $options (requires PHP 5.4+)
* @param int $maxlength
* @throws \BadMethodCallException
*/
public function __construct(ReadableStreamInterface $input, $assoc = false, $depth = 512, $options = 0, $maxlength = 65536)
{
// @codeCoverageIgnoreStart
if ($options !== 0 && \PHP_VERSION < 5.4) {
throw new \BadMethodCallException('Options parameter is only supported on PHP 5.4+');
}
if (\defined('JSON_THROW_ON_ERROR')) {
$options = $options & ~\JSON_THROW_ON_ERROR;
}
// @codeCoverageIgnoreEnd
$this->input = $input;
if (!$input->isReadable()) {
$this->close();
return;
}
$this->assoc = $assoc;
$this->depth = $depth;
$this->options = $options;
$this->maxlength = $maxlength;
$this->input->on('data', array($this, 'handleData'));
$this->input->on('end', array($this, 'handleEnd'));
$this->input->on('error', array($this, 'handleError'));
$this->input->on('close', array($this, 'close'));
}
public function isReadable()
{
return !$this->closed;
}
public function close()
{
if ($this->closed) {
return;
}
$this->closed = true;
$this->buffer = '';
$this->input->close();
$this->emit('close');
$this->removeAllListeners();
}
public function pause()
{
$this->input->pause();
}
public function resume()
{
$this->input->resume();
}
public function pipe(WritableStreamInterface $dest, array $options = array())
{
Util::pipe($this, $dest, $options);
return $dest;
}
/** @internal */
public function handleData($data)
{
if (!\is_string($data)) {
$this->handleError(new \UnexpectedValueException('Expected stream to emit string, but got ' . \gettype($data)));
return;
}
$this->buffer .= $data;
// keep parsing while a newline has been found
while (($newline = \strpos($this->buffer, "\n")) !== false && $newline <= $this->maxlength) {
// read data up until newline and remove from buffer
$data = (string)\substr($this->buffer, 0, $newline);
$this->buffer = (string)\substr($this->buffer, $newline + 1);
// decode data with options given in ctor
// @codeCoverageIgnoreStart
if ($this->options === 0) {
$data = \json_decode($data, $this->assoc, $this->depth);
} else {
assert(\PHP_VERSION_ID >= 50400);
$data = \json_decode($data, $this->assoc, $this->depth, $this->options);
}
// @codeCoverageIgnoreEnd
// abort stream if decoding failed
if ($data === null && \json_last_error() !== \JSON_ERROR_NONE) {
// @codeCoverageIgnoreStart
if (\PHP_VERSION_ID > 50500) {
$errstr = \json_last_error_msg();
} elseif (\json_last_error() === \JSON_ERROR_SYNTAX) {
$errstr = 'Syntax error';
} else {
$errstr = 'Unknown error';
}
// @codeCoverageIgnoreEnd
return $this->handleError(new \RuntimeException('Unable to decode JSON: ' . $errstr, \json_last_error()));
}
$this->emit('data', array($data));
}
if (isset($this->buffer[$this->maxlength])) {
$this->handleError(new \OverflowException('Buffer size exceeded'));
}
}
/** @internal */
public function handleEnd()
{
if ($this->buffer !== '') {
$this->handleData("\n");
}
if (!$this->closed) {
$this->emit('end');
$this->close();
}
}
/** @internal */
public function handleError(\Exception $error)
{
$this->emit('error', array($error));
$this->close();
}
}

144
vendor/clue/ndjson-react/src/Encoder.php vendored Executable file
View File

@@ -0,0 +1,144 @@
<?php
namespace Clue\React\NDJson;
use Evenement\EventEmitter;
use React\Stream\WritableStreamInterface;
/**
* The Encoder / Serializer can be used to write any value, encode it as a JSON text and forward it to an output stream
*/
class Encoder extends EventEmitter implements WritableStreamInterface
{
private $output;
private $options;
private $depth;
private $closed = false;
/**
* @param WritableStreamInterface $output
* @param int $options
* @param int $depth (requires PHP 5.5+)
* @throws \InvalidArgumentException
* @throws \BadMethodCallException
*/
public function __construct(WritableStreamInterface $output, $options = 0, $depth = 512)
{
// @codeCoverageIgnoreStart
if (\defined('JSON_PRETTY_PRINT') && $options & \JSON_PRETTY_PRINT) {
throw new \InvalidArgumentException('Pretty printing not available for NDJSON');
}
if ($depth !== 512 && \PHP_VERSION < 5.5) {
throw new \BadMethodCallException('Depth parameter is only supported on PHP 5.5+');
}
if (\defined('JSON_THROW_ON_ERROR')) {
$options = $options & ~\JSON_THROW_ON_ERROR;
}
// @codeCoverageIgnoreEnd
$this->output = $output;
if (!$output->isWritable()) {
$this->close();
return;
}
$this->options = $options;
$this->depth = $depth;
$this->output->on('drain', array($this, 'handleDrain'));
$this->output->on('error', array($this, 'handleError'));
$this->output->on('close', array($this, 'close'));
}
public function write($data)
{
if ($this->closed) {
return false;
}
// we have to handle PHP warnings for legacy PHP < 5.5
// certain values (such as INF etc.) emit a warning, but still encode successfully
// @codeCoverageIgnoreStart
if (\PHP_VERSION_ID < 50500) {
$errstr = null;
\set_error_handler(function ($_, $error) use (&$errstr) {
$errstr = $error;
});
// encode data with options given in ctor (depth not supported)
$data = \json_encode($data, $this->options);
// always check error code and match missing error messages
\restore_error_handler();
$errno = \json_last_error();
if (\defined('JSON_ERROR_UTF8') && $errno === \JSON_ERROR_UTF8) {
// const JSON_ERROR_UTF8 added in PHP 5.3.3, but no error message assigned in legacy PHP < 5.5
// this overrides PHP 5.3.14 only: https://3v4l.org/IGP8Z#v5314
$errstr = 'Malformed UTF-8 characters, possibly incorrectly encoded';
} elseif ($errno !== \JSON_ERROR_NONE && $errstr === null) {
// error number present, but no error message applicable
$errstr = 'Unknown error';
}
// abort stream if encoding fails
if ($errno !== \JSON_ERROR_NONE || $errstr !== null) {
$this->handleError(new \RuntimeException('Unable to encode JSON: ' . $errstr, $errno));
return false;
}
} else {
// encode data with options given in ctor
$data = \json_encode($data, $this->options, $this->depth);
// abort stream if encoding fails
if ($data === false && \json_last_error() !== \JSON_ERROR_NONE) {
$this->handleError(new \RuntimeException('Unable to encode JSON: ' . \json_last_error_msg(), \json_last_error()));
return false;
}
}
// @codeCoverageIgnoreEnd
return $this->output->write($data . "\n");
}
public function end($data = null)
{
if ($data !== null) {
$this->write($data);
}
$this->output->end();
}
public function isWritable()
{
return !$this->closed;
}
public function close()
{
if ($this->closed) {
return;
}
$this->closed = true;
$this->output->close();
$this->emit('close');
$this->removeAllListeners();
}
/** @internal */
public function handleDrain()
{
$this->emit('drain');
}
/** @internal */
public function handleError(\Exception $error)
{
$this->emit('error', array($error));
$this->close();
}
}