diff --git a/docs/src/content/docs/en/downloads.mdx b/docs/src/content/docs/en/downloads.mdx
index 9d8d96c..4ef4cf3 100644
--- a/docs/src/content/docs/en/downloads.mdx
+++ b/docs/src/content/docs/en/downloads.mdx
@@ -6,7 +6,7 @@ description: Downloadable Nibiru framework training corpus — chunks, instructi
import DownloadsManifest from '../../../components/DownloadsManifest.astro';
A pre-built training corpus for fine-tuning your own LoRA on Nibiru. Generated
-deterministically from two sources: the deep [framework reference](/en/reference/)
+deterministically from two sources: the deep [framework reference](https://github.com/alllinux/Nibiru/blob/master/docs/scripts/extraction/framework-reference-v2.md)
(every public factory, namespace, idiom and gotcha cited file:line) and the
public docs in five languages.
diff --git a/docs/src/content/docs/en/showcase/patterns.md b/docs/src/content/docs/en/showcase/patterns.md
index 2f6799b..d7b45fe 100644
--- a/docs/src/content/docs/en/showcase/patterns.md
+++ b/docs/src/content/docs/en/showcase/patterns.md
@@ -70,7 +70,7 @@ Multiple trackers without controller coupling.
$analytics = new Analytics();
$analytics->attach(new Plugin\Matomo());
$analytics->attach(new Plugin\Plausible());
-$analytics->trackPageView(); // calls notify() internally
+$analytics->trackPageView(); / calls notify() internally
```
Each observer's `update($subject)` pulls only the fields it cares about. Adding a tracker is a one-line change.
diff --git a/docs/src/content/docs/en/showcase/projects.md b/docs/src/content/docs/en/showcase/projects.md
index bad6d51..cc71f27 100644
--- a/docs/src/content/docs/en/showcase/projects.md
+++ b/docs/src/content/docs/en/showcase/projects.md
@@ -56,7 +56,7 @@ public function detailAction()
try {
$machine = Machine::init()->getMachine((int) $machineId);
} catch (\Throwable $e) {
- $machine = null; // DB blip → page still renders with fallback.
+ $machine = null; / DB blip → page still renders with fallback.
}
$machineName = $machine['ms_machines_name'] ?? "Maschine #$machineId";
diff --git a/docs/src/content/docs/en/why-nibiru.md b/docs/src/content/docs/en/why-nibiru.md
index 3ba1fbd..4a9623c 100644
--- a/docs/src/content/docs/en/why-nibiru.md
+++ b/docs/src/content/docs/en/why-nibiru.md
@@ -53,7 +53,7 @@ class Cms implements Interfaces\Cms, SplSubject
use Traits\PageBuilderForm;
use Traits\CmsPageStructureModifier;
use Traits\FormElements;
- // …8 more traits
+ / …8 more traits
}
```
@@ -117,7 +117,7 @@ The API controller takes the inverse approach: a whitelist of public endpoints i
```php
// public endpoints can be listed up-front, auth wraps the rest.
if (in_array($action, ['category', 'machines', 'ollama', 'team'])) {
- // public, skip auth
+ / public, skip auth
} else {
$this->user = new User();
$this->acl = new Acl();
@@ -148,8 +148,8 @@ class Machineryscout implements IModule, \SplSubject
}
public function indexMachines(): void {
- // …do the work…
- $this->notify(); // analytics, cache invalidator, audit log all see it.
+ / …do the work…
+ $this->notify(); / analytics, cache invalidator, audit log all see it.
}
}
```
diff --git a/docs/src/content/docs/es/ai/corpus.md b/docs/src/content/docs/es/ai/corpus.md
index 0d33114..06a0978 100644
--- a/docs/src/content/docs/es/ai/corpus.md
+++ b/docs/src/content/docs/es/ai/corpus.md
@@ -60,7 +60,7 @@ Fragmentos sin procesar para su uso como datos de recuperación RAG:
"content": "Modules implementing `SplSubject` can broadcast events…"
}
```
-Este es exactamente el archivo que usa internamente [Oracle](/ai/oracle/).
+Este es exactamente el archivo que usa internamente [Oracle](/es/ai/oracle/).
## Cómo se derivan los fragmentos
diff --git a/docs/src/content/docs/es/ai/module/chat.md b/docs/src/content/docs/es/ai/module/chat.md
index 7ff5cb9..b5cf2bf 100644
--- a/docs/src/content/docs/es/ai/module/chat.md
+++ b/docs/src/content/docs/es/ai/module/chat.md
@@ -10,19 +10,19 @@ El complemento de chat es la pieza más simple del módulo de IA. Envuelve la AP
$ai = new \Nibiru\Module\Ai\Ai();
$chat = $ai->chat();
-$chat->system('Be terse.'); // optional system prompt
-$chat->model('qwen2.5-coder:14b'); // override the configured model
-$chat->temperature(0.2); // override config
-$chat->maxTokens(512); // override config
+$chat->system('Be terse.'); / optional system prompt
+$chat->model('qwen2.5-coder:14b'); / override the configured model
+$chat->temperature(0.2); / override config
+$chat->maxTokens(512); / override config
-$chat->user('Hello'); // append a user message
-$chat->assistant('Hi.'); // append an assistant message (rare)
+$chat->user('Hello'); / append a user message
+$chat->assistant('Hi.'); / append an assistant message (rare)
-$reply = $chat->complete(); // run the call, return text
-$reply = $chat->ask('How are you?'); // = ->user(...)->complete()
+$reply = $chat->complete(); / run the call, return text
+$reply = $chat->ask('How are you?'); / = ->user(...)->complete()
-$chat->reset(); // clear messages, keep model + system
-$chat->history(); // [{role, content}, …]
+$chat->reset(); / clear messages, keep model + system
+$chat->history(); / [{role, content}, …]
```
## En un solo paso
```php
@@ -35,10 +35,10 @@ echo (new \Nibiru\Module\Ai\Ai())
$chat = $ai->chat();
$chat->user('Name three Nibiru singletons.');
-$singletons = $chat->complete(); // appended to history
+$singletons = $chat->complete(); / appended to history
$chat->user('What does the second one do?');
-$detail = $chat->complete(); // model has full context
+$detail = $chat->complete(); / model has full context
```
## Sobrescribir modelo y estilo por llamada
```php
diff --git a/docs/src/content/docs/es/ai/module/embed.md b/docs/src/content/docs/es/ai/module/embed.md
index a8f9130..bb6b1a2 100644
--- a/docs/src/content/docs/es/ai/module/embed.md
+++ b/docs/src/content/docs/es/ai/module/embed.md
@@ -9,12 +9,12 @@ El complemento Embed es un envoltorio ligero alrededor de `/api/embeddings` de O
```php
$embed = (new \Nibiru\Module\Ai\Ai())->embed();
-$vec = $embed->one('controller'); // float[]
-$vectors = $embed->batch(['a', 'b', 'c']); // float[][]
+$vec = $embed->one('controller'); / float[]
+$vectors = $embed->batch(['a', 'b', 'c']); / float[][]
-$score = \Nibiru\Module\Ai\Plugin\Embed::cosine($a, $b); // 0..1
-$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); // base64 string
-$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed); // back to float[]
+$score = \Nibiru\Module\Ai\Plugin\Embed::cosine($a, $b); / 0..1
+$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); / base64 string
+$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed); / back to float[]
```
## Patrón: eliminar cadenas similares
```php
@@ -49,8 +49,8 @@ function bestTag(string $text, array $tagVecs, $embed): string {
return $best[0];
}
-echo bestTag('User::isAuthorized', $tagVecs, $embed); // → 'authentication'
-echo bestTag('Pageination::setTable', $tagVecs, $embed); // → 'database' (probably)
+echo bestTag('User::isAuthorized', $tagVecs, $embed); / → 'authentication'
+echo bestTag('Pageination::setTable', $tagVecs, $embed); / → 'database' (probably)
```
## Almacenamiento
@@ -58,7 +58,7 @@ Las incrustaciones son arreglos de flotantes — generalmente 768 flotantes para
Utiliza `Embed::pack()` para codificarlos en base64 como flotantes de 4 bytes:
```php
-$compact = Embed::pack($vec); // ~4 KB → ~5.3 KB base64 string
+$compact = Embed::pack($vec); / ~4 KB → ~5.3 KB base64 string
$vec = Embed::unpack($compact);
```
El complemento RAG utiliza este formato internamente para sus archivos JSON.
diff --git a/docs/src/content/docs/es/ai/module/overview.md b/docs/src/content/docs/es/ai/module/overview.md
index 973e592..9cee227 100644
--- a/docs/src/content/docs/es/ai/module/overview.md
+++ b/docs/src/content/docs/es/ai/module/overview.md
@@ -57,7 +57,7 @@ echo $ai->chat()->ask('Explain MMVC in two sentences.');
// Multi-turn
$chat = $ai->chat();
$chat->user('How do I scaffold a module?');
-$chat->user('And add Graylog hooks?'); // referrs to previous turn
+$chat->user('And add Graylog hooks?'); / referrs to previous turn
echo $chat->complete();
// Override per call
@@ -80,7 +80,7 @@ $score = \Nibiru\Module\Ai\Plugin\Embed::cosine($va, $vb);
```
Almacenamiento compacto:
```php
-$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); // base64 string, 4 bytes/dim
+$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); / base64 string, 4 bytes/dim
$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed);
```
### 3. RAG — ingesta, recuperación, anclaje
@@ -88,7 +88,7 @@ $vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed);
$rag = $ai->rag('product-help');
// One-time ingestion
-$rag->ingestDir(__DIR__ . '/help/'); // walks .md/.txt/.php
+$rag->ingestDir(__DIR__ . '/help/'); / walks .md/.txt/.php
$rag->ingestText('FAQ entry…', ['source' => 'faq-12']);
$rag->ingestFile('/var/data/manual.pdf.txt');
@@ -105,9 +105,9 @@ use Nibiru\Module\Ai\Plugin\Tools;
$ai = new \Nibiru\Module\Ai\Ai();
$agent = $ai->agent()->withTools([
- new Tools\PdoQuery(), // read-only SQL
- new Tools\HttpGet(), // fetch URLs
- new Tools\FileRead(), // read project files
+ new Tools\PdoQuery(), / read-only SQL
+ new Tools\HttpGet(), / fetch URLs
+ new Tools\FileRead(), / read project files
]);
echo $agent->run('How many active users registered last week?');
@@ -154,7 +154,7 @@ La filosofía de diseño:
## Siguiente
-- [Referencia del complemento de chat](/es/ai/modulo/chat/)
-- [Referencia del complemento RAG](/es/ai/modulo/rag/)
-- [Referencia del complemento de agente](/es/ai/modulo/agent/)
-- [Entrenamiento nibiru-coder](/es/ai/modulo/training/)
+- [Referencia del complemento de chat](/es/ai/module/chat/)
+- [Referencia del complemento RAG](/es/ai/module/rag/)
+- [Referencia del complemento de agente](/es/ai/module/agent/)
+- [Entrenamiento nibiru-coder](/es/ai/module/training/)
diff --git a/docs/src/content/docs/es/ai/module/rag.md b/docs/src/content/docs/es/ai/module/rag.md
index a3d85be..8aa3a22 100644
--- a/docs/src/content/docs/es/ai/module/rag.md
+++ b/docs/src/content/docs/es/ai/module/rag.md
@@ -10,9 +10,9 @@ El complemento RAG es la característica clave del módulo de IA para los constr
use Nibiru\Module\Ai\Ai;
$ai = new Ai();
-$rag = $ai->rag('product-help'); // a named collection
+$rag = $ai->rag('product-help'); / a named collection
-$rag->ingestDir(__DIR__ . '/help/'); // walks .md/.txt/.php under help/
+$rag->ingestDir(__DIR__ . '/help/'); / walks .md/.txt/.php under help/
$rag->ingestText('FAQ entry…', ['source' => 'faq-12']);
echo $rag->ask('How do I cancel my subscription?');
@@ -46,20 +46,20 @@ $logs->ingestText($exception->__toString(), ['ts' => time()]);
```
## Referencia de la API
```php
-$rag = $ai->rag('name'); // get/create a named collection
+$rag = $ai->rag('name'); / get/create a named collection
// --- Ingestion ---
-$rag->ingestText($text, $metadata = []); // single chunk
-$count = $rag->ingestFile('path'); // returns chunks added
-$count = $rag->ingestDir('dir', ['md','txt','php']); // recursive
+$rag->ingestText($text, $metadata = []); / single chunk
+$count = $rag->ingestFile('path'); / returns chunks added
+$count = $rag->ingestDir('dir', ['md','txt','php']); / recursive
// --- Querying ---
-$hits = $rag->search('query', $k = null); // [{score, text, metadata}, …]
-$answer = $rag->ask('question', $k = null); // top-K → chat call
+$hits = $rag->search('query', $k = null); / [{score, text, metadata}, …]
+$answer = $rag->ask('question', $k = null); / top-K → chat call
// --- Maintenance ---
-$rag->reset(); // forget everything (deletes file)
-$n = $rag->size(); // number of chunks
+$rag->reset(); / forget everything (deletes file)
+$n = $rag->size(); / number of chunks
```
## Perillas de ajuste
@@ -95,5 +95,5 @@ rag.storage_path = "/../../application/module/ai/cache/rag/"
## ¿Qué sigue?
-- [Plugin de agente →](/es/ai/modulo/agente/) para herramientas, no recuperación.
-- [Entrenamiento nibiru-coder →](/es/ai/modulo/entrenamiento/) para que el chat responda a la mitad en voz del marco.
+- [Plugin de agente →](/es/ai/module/agent/) para herramientas, no recuperación.
+- [Entrenamiento nibiru-coder →](/es/ai/module/training/) para que el chat responda a la mitad en voz del marco.
diff --git a/docs/src/content/docs/es/core/auth.md b/docs/src/content/docs/es/core/auth.md
index 53ad31e..7892b44 100644
--- a/docs/src/content/docs/es/core/auth.md
+++ b/docs/src/content/docs/es/core/auth.md
@@ -114,7 +114,7 @@ public function pageAction() {
View::forwardTo('/login');
return;
}
- // ...
+ / ...
}
```
Para las verificaciones basadas en roles, las aplicaciones de demostración utilizan el complemento `Acl` del mismo módulo:
@@ -178,7 +178,7 @@ public function submitAction() {
http_response_code(419);
return;
}
- // ...handle submission...
+ / ...handle submission...
}
```
Incorpore `` en su formulario.
diff --git a/docs/src/content/docs/es/core/config.md b/docs/src/content/docs/es/core/config.md
index 3fe99c3..ffbe37c 100644
--- a/docs/src/content/docs/es/core/config.md
+++ b/docs/src/content/docs/es/core/config.md
@@ -82,19 +82,19 @@ password_hash = "another-salt-for-AES_DECRYPT"
## Leyendo la configuración
```php
$cfg = \Nibiru\Config::getInstance()->getConfig();
-$cfg['DATABASE']['driver']; // 'pdo'
-$cfg['SETTINGS']['page.url']; // 'https://my-app.local'
+$cfg['DATABASE']['driver']; / 'pdo'
+$cfg['SETTINGS']['page.url']; / 'https://my-app.local'
```
Para configuraciones profundamente anidadas, utilice las constantes tipadas de la interfaz View:
```php
-$cfg[\Nibiru\View::NIBIRU_SETTINGS]['smarty.css']; // ['/public/css/app.css']
+$cfg[\Nibiru\View::NIBIRU_SETTINGS]['smarty.css']; / ['/public/css/app.css']
```
## Configuraciones del módulo
Cada módulo bajo `application/module//settings/` puede llevar sus propios archivos INI. El Registro los detecta automáticamente y los expone a través de:
```php
$users = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
-$users->session_lifetime; // from [USERS] section in users.ini
+$users->session_lifetime; / from [USERS] section in users.ini
```
El Registro prefiere `..ini` sobre `.ini`, por lo que obtienes anulaciones por entorno de forma gratuita.
diff --git a/docs/src/content/docs/es/core/controllers.md b/docs/src/content/docs/es/core/controllers.md
index 0215176..dd6638c 100644
--- a/docs/src/content/docs/es/core/controllers.md
+++ b/docs/src/content/docs/es/core/controllers.md
@@ -56,12 +56,12 @@ View::assign(['products' => $list]);
```
Ayudantes de conveniencia del controlador base:
```php
-$this->getRequest('id', false); // $_REQUEST['id'] ?? false
-$this->getPost('email', ''); // $_POST['email'] ?? ''
-$this->getGet('page', 1); // $_GET['page'] ?? 1
-$this->getServer('REQUEST_URI'); // $_SERVER['REQUEST_URI']
-$this->getFiles('upload'); // $_FILES['upload']
-$this->getSession('auth'); // $_SESSION['auth']
+$this->getRequest('id', false); / $_REQUEST['id'] ?? false
+$this->getPost('email', ''); / $_POST['email'] ?? ''
+$this->getGet('page', 1); / $_GET['page'] ?? 1
+$this->getServer('REQUEST_URI'); / $_SERVER['REQUEST_URI']
+$this->getFiles('upload'); / $_FILES['upload']
+$this->getSession('auth'); / $_SESSION['auth']
```
Estos existen porque `Controller` es amigable con `final`: puedes simularlos en pruebas sustituyendo una clase hija.
@@ -69,8 +69,8 @@ Estos existen porque `Controller` es amigable con `final`: puedes simularlos en
Para redirigir dentro de una acción:
```php
-View::forwardTo('/login'); // 302 to the URL, exits
-View::forwardToJsonHeader(); // sets Content-Type: application/json
+View::forwardTo('/login'); / 302 to the URL, exits
+View::forwardToJsonHeader(); / sets Content-Type: application/json
```
`forwardToJsonHeader()` es el patrón canónico para puntos finales JSON — establece la cabecera, asigna `data`, y devuelve. La capa de vista se encarga del resto.
diff --git a/docs/src/content/docs/es/core/dispatcher.md b/docs/src/content/docs/es/core/dispatcher.md
index 228e867..3eef9c5 100644
--- a/docs/src/content/docs/es/core/dispatcher.md
+++ b/docs/src/content/docs/es/core/dispatcher.md
@@ -30,17 +30,17 @@ public function run() {
if (Config::getInstance()->getConfig()
[self::CONFIG_GENERATOR_SECTION][self::GENERATOR_DATABASE]) {
- new Model(false); // 1. (re)generate models from schema
+ new Model(false); / 1. (re)generate models from schema
}
- Router::getInstance()->route(); // 2. parse the URL
- Auto::loader()->loadModelFiles(); // 3. load model files
- Auto::loader()->loadModules(); // 4. load module classes
+ Router::getInstance()->route(); / 2. parse the URL
+ Auto::loader()->loadModelFiles(); / 3. load model files
+ Auto::loader()->loadModules(); / 4. load module classes
$tpl = Router::getInstance()->tplName();
$controllerFile = __DIR__ . "/../../application/controller/{$tpl}Controller.php";
- if (is_file($controllerFile)) { // 5. controller file exists
+ if (is_file($controllerFile)) { / 5. controller file exists
require_once $controllerFile;
$class = "Nibiru\\{$tpl}Controller";
$controller = new $class();
@@ -49,7 +49,7 @@ public function run() {
$action = $_REQUEST['_action'] . 'Action';
$controller->navigationAction();
if (method_exists($controller, $action)) {
- $controller->$action(); // 6. optional named action
+ $controller->$action(); / 6. optional named action
}
$controller->pageAction();
} else {
@@ -57,9 +57,9 @@ public function run() {
$controller->pageAction();
}
- Display::getInstance()->display(); // 7. render Smarty
+ Display::getInstance()->display(); / 7. render Smarty
} else {
- // 8. soft 404 — render the configured error controller
+ / 8. soft 404 — render the configured error controller
}
}
```
diff --git a/docs/src/content/docs/es/core/forms.md b/docs/src/content/docs/es/core/forms.md
index 7846f3d..d81f2ed 100644
--- a/docs/src/content/docs/es/core/forms.md
+++ b/docs/src/content/docs/es/core/forms.md
@@ -40,8 +40,8 @@ addOpenSpan addCloseSpan
```
### Ciclo de vida
```
-create // reset the static buffer; call before building a new form
-addForm // wrap the buffer in
...
and return as a string
+create / reset the static buffer; call before building a new form
+addForm / wrap the buffer in
...
and return as a string
```
:::caution[La inconsistencia de nombres es intencional, más bien]
`addInputTypePassword` vs `addTypePassword`, `addInputTypeFileupload` vs `addTypeFileUpload` — el prefijo coincide si el elemento es un `` (prefijo Input) o alguna otra etiqueta (prefijo Type). Es incómodo pero estable; la CLI de `./nibiru -c` usa el mismo patrón, por lo que la memoria muscular funciona.
@@ -50,7 +50,7 @@ addForm // wrap the buffer in
...
and return as a string
```php
use Nibiru\Factory\Form;
-Form::create(); // reset the static buffer
+Form::create(); / reset the static buffer
Form::addOpenDiv(['class' => 'form-group']);
Form::addTypeLabel(['for' => 'login', 'value' => 'Username']);
@@ -186,7 +186,7 @@ class formsController extends Controller {
'required' => 'required',
'class' => 'contacts-input form-control',
]);
- // ...more fields...
+ / ...more fields...
$this->form = Form::addForm([
'name' => 'newregister',
'method' => 'post',
diff --git a/docs/src/content/docs/es/core/modules.md b/docs/src/content/docs/es/core/modules.md
index 2b3aaad..8d8293d 100644
--- a/docs/src/content/docs/es/core/modules.md
+++ b/docs/src/content/docs/es/core/modules.md
@@ -147,9 +147,9 @@ allowed.roles[] = "standard"
Léelo desde cualquier lugar:
```php
$cfg = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
-$cfg->session_lifetime; // 7200
-$cfg->password_min_length; // 12
-$cfg->allowed_roles; // [admin, editor, standard]
+$cfg->session_lifetime; / 7200
+$cfg->password_min_length; / 12
+$cfg->allowed_roles; / [admin, editor, standard]
```
Capas de entorno: un archivo llamado `users.production.ini` se prefiere sobre `users.ini` cuando `APPLICATION_ENV=production`.
@@ -162,7 +162,7 @@ $analytics = new \Nibiru\Module\Analytics\Analytics();
$analytics->attach(new \Nibiru\Module\Analytics\Plugin\Matomo());
$analytics->attach(new \Nibiru\Module\Analytics\Plugin\Plausible());
-$analytics->trackPageView(); // internally calls notify()
+$analytics->trackPageView(); / internally calls notify()
```
Cada observador recibe la instancia de análisis en su método `update($subject)` y extrae los datos del evento que le interesan.
@@ -200,7 +200,7 @@ Los nombres son **nombres de carpetas en minúsculas**, exactamente como aparece
Las clases de plugin residen bajo el espacio de nombres **plural** `Plugins`:
```php
// application/module/billing/plugins/invoice.php
-namespace Nibiru\Module\Billing\Plugins; // ← plural
+namespace Nibiru\Module\Billing\Plugins; / ← plural
class Invoice extends \Nibiru\Module\Billing\Billing { /* ... */ }
```
Desacuerda el espacio de nombres y obtendrás fallos en la carga automática. La plantilla de la CLI (`./nibiru -m billing`) genera el espacio de nombres correcto para ti.
@@ -210,7 +210,7 @@ Desacuerda el espacio de nombres y obtendrás fallos en la carga automática. La
No **registras** los archivos INI de tu módulo — el [Registro](/es/core/registry/) los descubre automáticamente recorriendo `application/module//settings/*.ini` después de que `[AUTOLOADER]` carga la clase del módulo. Cada sección `[]` (en mayúsculas) de un INI se vuelve disponible como:
```php
$cfg = \Nibiru\Registry::getInstance()->loadModuleConfigByName('billing');
-$cfg->invoice_prefix; // [BILLING] invoice.prefix → property
+$cfg->invoice_prefix; / [BILLING] invoice.prefix → property
```
El Registro prefiere `..ini` (por ejemplo, `facturación.producción.ini`) cuando `APPLICATION_ENV` coincide.
diff --git a/docs/src/content/docs/es/core/pagination.md b/docs/src/content/docs/es/core/pagination.md
index ca6d864..fdeaa8a 100644
--- a/docs/src/content/docs/es/core/pagination.md
+++ b/docs/src/content/docs/es/core/pagination.md
@@ -14,7 +14,7 @@ class productsController extends Controller
{
public function pageAction() {
$products = new products();
- Pageination::setEntriesPerPage(25); // optional; default from INI
+ Pageination::setEntriesPerPage(25); / optional; default from INI
Pageination::setTable($products);
$rows = Pageination::loadTableAsArray();
diff --git a/docs/src/content/docs/es/core/registry.md b/docs/src/content/docs/es/core/registry.md
index 886e7ae..7649052 100644
--- a/docs/src/content/docs/es/core/registry.md
+++ b/docs/src/content/docs/es/core/registry.md
@@ -20,7 +20,7 @@ Para cada módulo bajo `application/module//settings/`:
$users = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
$users->session_lifetime;
$users->password_min_length;
-$users->allowed_roles; // array
+$users->allowed_roles; / array
```
Dentro del módulo mismo, la convención es envolver esto en un setter:
```php
diff --git a/docs/src/content/docs/es/core/routing.md b/docs/src/content/docs/es/core/routing.md
index 8b85b25..a39496c 100644
--- a/docs/src/content/docs/es/core/routing.md
+++ b/docs/src/content/docs/es/core/routing.md
@@ -40,7 +40,7 @@ Cualquier cosa después del segmento de acción se convierte en una clave `$_REQ
// /users/edit/42 → $_REQUEST['id'] = '42'
public function editAction() {
$id = (int) ($_REQUEST['id'] ?? 0);
- // ...
+ / ...
}
```
Para parámetros no numéricos o nombrados, prefiera cadenas de consulta:
@@ -62,9 +62,9 @@ Cuando una URL coincide con el patrón, los grupos capturados se asignan a las c
## Ayudantes de enrutamiento
```php
-Router::getInstance()->currentPage(); // 'products'
-Router::getInstance()->tplName(); // 'products' (controller stem for templates)
-Router::getInstance()->getController(); // alias for currentPage()
+Router::getInstance()->currentPage(); / 'products'
+Router::getInstance()->tplName(); / 'products' (controller stem for templates)
+Router::getInstance()->getController(); / alias for currentPage()
```
Estos son útiles dentro de los controladores y plantillas:
```smarty
diff --git a/docs/src/content/docs/es/design/components.md b/docs/src/content/docs/es/design/components.md
index 25d27bb..c54bfe5 100644
--- a/docs/src/content/docs/es/design/components.md
+++ b/docs/src/content/docs/es/design/components.md
@@ -7,7 +7,7 @@ description: "Botones, tarjetas, llamadas a la acción, héroe — listos para c
Un rectángulo negro sobre crema. Editorial. Sin gradiente, sin brillo.
```html
-
+Read the docs→
@@ -162,7 +162,7 @@ Cuadrícula asimétrica de dos columnas. Un número editorial grande detrás del
Nibiru is a modular PHP framework for builders who ship.
diff --git a/docs/src/content/docs/es/design/overview.md b/docs/src/content/docs/es/design/overview.md
index 3420622..c954717 100644
--- a/docs/src/content/docs/es/design/overview.md
+++ b/docs/src/content/docs/es/design/overview.md
@@ -48,7 +48,7 @@ Eso es suficiente para estar en marca.
## ¿Qué se documenta aquí?
-- [Paleta](/es/diseno/paleta/) — cada color con su rol.
-- [Tipografía](/es/diseno/tipografia/) — los ejes variables de Bricolage utilizados en serio.
-- [Componentes](/es/diseno/componentes/) — botones, tarjetas, llamadas a la atención, el lanzador Oracle.
-- [Movimiento](/es/diseno/movimiento/) — respirar, desvanecerse, sin flash.
+- [Paleta](/es/design/palette/) — cada color con su rol.
+- [Tipografía](/es/design/typography/) — los ejes variables de Bricolage utilizados en serio.
+- [Componentes](/es/design/components/) — botones, tarjetas, llamadas a la atención, el lanzador Oracle.
+- [Movimiento](/es/design/motion/) — respirar, desvanecerse, sin flash.
diff --git a/docs/src/content/docs/es/index.mdx b/docs/src/content/docs/es/index.mdx
index bd25094..ac28b93 100644
--- a/docs/src/content/docs/es/index.mdx
+++ b/docs/src/content/docs/es/index.mdx
@@ -19,73 +19,25 @@ hero:
variant: minimal
---
-import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components';
+import CometTrail from '../../../components/CometTrail.astro';
+import MmvcStage from '../../../components/MmvcStage.astro';
+import MissionControl from '../../../components/MissionControl.astro';
+import LaunchSequence from '../../../components/LaunchSequence.astro';
+import SpacecraftGrid from '../../../components/SpacecraftGrid.astro';
+import EditorialContent from '../../../components/EditorialContent.astro';
+import LandingFooter from '../../../components/LandingFooter.astro';
+import ToTop from '../../../components/ToTop.astro';
+import LandingScripts from '../../../components/LandingScripts.astro';
-## Una constelación de capacidades
+
+
+
+
+
+
+
+
-
-
- Los módulos envuelven MVC con traits, plugins, interfaces y configuraciones. La segunda **M** está acoplada de forma flexible, con el patrón observador `SplSubject` integrado.
-
-
- Cinco controladores en órbita: `mysql`, `pdo`, `postgres` (ODBC), `psql` (libpq) y `postgresql`. Cambia con solo modificar una clave INI.
-
-
- Vistas dirigidas por plantillas, un ayudante global `View::assign()` y una caché caliente en `templates_c`. Más parciales compartidos, includes de navegación y plantillas de paginación.
-
-
- Más de 28 tipos de campo — text, password, switch, color, range, file upload — compuestos mediante llamadas estáticas a `Form::add…` y renderizados como un único string HTML.
-
-
- `./nibiru` genera módulos, controladores, plugins, migraciones y páginas CMS. Ejecuta migraciones contra `local`, `staging` o `production`.
-
-
- Nibiru se está convirtiendo en el primer framework PHP con un Oráculo basado en RAG entrenado con su propio conocimiento — y un corpus publicado para futuros fine-tunes.
-
-
-
-## Inicio rápido
-
-```bash
-# Clonar
-git clone https://github.com/alllinux/Nibiru mi-app && cd mi-app
-
-# Instalar dependencias PHP (Smarty, PHPMailer, Guzzle, …)
-composer install
-
-# Permisos + arranque de carpetas
-./nibiru -s
-
-# Ejecutar la primera migración
-./nibiru -mi local
-
-# Generar un controlador
-./nibiru -c products
-```
-
-```php
-// application/controller/productsController.php
-namespace Nibiru;
-use Nibiru\Adapter\Controller;
-
-class productsController extends Controller {
- public function pageAction() {
- View::assign([
- 'title' => 'Productos — Nibiru',
- 'products' => [['id' => 1, 'name' => 'Recubrimiento de Oro Marduk']],
- ]);
- }
- public function navigationAction() {
- JsonNavigation::getInstance()->loadJsonNavigationArray();
- }
-}
-```
-
-## A dónde ir después
-
-
-
-
-
-
-
+{/* Loads three.js + the original mockup scene code. MUST be the last node so
+ every #id the scene targets exists in the DOM when the script runs. */}
+
diff --git a/docs/src/content/docs/es/showcase/patterns.md b/docs/src/content/docs/es/showcase/patterns.md
index 44d96de..472e279 100644
--- a/docs/src/content/docs/es/showcase/patterns.md
+++ b/docs/src/content/docs/es/showcase/patterns.md
@@ -61,7 +61,7 @@ Varios rastreadores sin acoplamiento con el controlador.
$analytics = new Analytics();
$analytics->attach(new Plugin\Matomo());
$analytics->attach(new Plugin\Plausible());
-$analytics->trackPageView(); // calls notify() internally
+$analytics->trackPageView(); / calls notify() internally
```
Cada observador extrae solo los campos que le interesan con su `update($subject)`. Agregar un rastreador es un cambio de una línea.
diff --git a/docs/src/content/docs/es/showcase/projects.md b/docs/src/content/docs/es/showcase/projects.md
index b2c9311..8252091 100644
--- a/docs/src/content/docs/es/showcase/projects.md
+++ b/docs/src/content/docs/es/showcase/projects.md
@@ -55,7 +55,7 @@ public function detailAction()
try {
$machine = Machine::init()->getMachine((int) $machineId);
} catch (\Throwable $e) {
- $machine = null; // DB blip → page still renders with fallback.
+ $machine = null; / DB blip → page still renders with fallback.
}
$machineName = $machine['ms_machines_name'] ?? "Maschine #$machineId";
@@ -110,7 +110,7 @@ Inserta una nueva plantilla Smarty en el sistema, el editor sabe de inmediato cu
## ¿Qué realmente es especial, resumido?
-Los cinco diferenciadores a continuación se extraen de los códigos fuente anteriores. Cada uno enlaza a su evidencia en la página [¿Por qué Nibiru](/es/por-que-nibiru/).
+Los cinco diferenciadores a continuación se extraen de los códigos fuente anteriores. Cada uno enlaza a su evidencia en la página [¿Por qué Nibiru](/es/why-nibiru/).
| | ¿Qué hace Nibiru? | ¿Qué hace Laravel/Symfony? |
|---|---|---|
@@ -120,7 +120,7 @@ Los cinco diferenciadores a continuación se extraen de los códigos fuente ante
| Auth | 3 líneas en el constructor del controlador. | Pila de middleware + clases de política + portales. |
| Eventos | `SplSubject` + `SplObserver` de la librería estándar de PHP. | Despachador de eventos personalizado + registro de oyentes + cola. |
-Lee la [desglose completa con referencias de código →](/es/porque-nibiru/)
+Lee la [desglose completa con referencias de código →](/es/why-nibiru/)
---
diff --git a/docs/src/content/docs/es/why-nibiru.md b/docs/src/content/docs/es/why-nibiru.md
index 97978ec..2cc5824 100644
--- a/docs/src/content/docs/es/why-nibiru.md
+++ b/docs/src/content/docs/es/why-nibiru.md
@@ -50,7 +50,7 @@ class Cms implements Interfaces\Cms, SplSubject
use Traits\PageBuilderForm;
use Traits\CmsPageStructureModifier;
use Traits\FormElements;
- // …8 more traits
+ / …8 more traits
}
```
**Efecto neto**: cero inyección de constructores, cero registro de proveedores de servicios, cero llamadas a `bind()` / `singleton()` en un archivo de configuración. Un nuevo desarrollador puede buscar el nombre del trait y ver todos los llamadores.
@@ -108,7 +108,7 @@ El controlador de la API toma un enfoque inverso: una lista blanca de puntos fin
```php
// public endpoints can be listed up-front, auth wraps the rest.
if (in_array($action, ['category', 'machines', 'ollama', 'team'])) {
- // public, skip auth
+ / public, skip auth
} else {
$this->user = new User();
$this->acl = new Acl();
@@ -137,8 +137,8 @@ class Machineryscout implements IModule, \SplSubject
}
public function indexMachines(): void {
- // …do the work…
- $this->notify(); // analytics, cache invalidator, audit log all see it.
+ / …do the work…
+ $this->notify(); / analytics, cache invalidator, audit log all see it.
}
}
```
@@ -154,4 +154,4 @@ Un desarrollador solitario o un pequeño equipo puede construir y *operar* una a
Si prefieres ver tu código, tómalo.
-→ [Lee la presentación →](/es/presentacion/proyectos/)
+→ [Lee la presentación →](/es/showcase/projects/)
diff --git a/docs/src/content/docs/fr/ai/corpus.md b/docs/src/content/docs/fr/ai/corpus.md
index e881871..310aa06 100644
--- a/docs/src/content/docs/fr/ai/corpus.md
+++ b/docs/src/content/docs/fr/ai/corpus.md
@@ -60,7 +60,7 @@ Blocs bruts à utiliser comme données de récupération RAG :
"content": "Modules implementing `SplSubject` can broadcast events…"
}
```
-Ceci est exactement le fichier que l'[Oracle](/ai/oracle/) utilise en interne.
+Ceci est exactement le fichier que l'[Oracle](/fr/ai/oracle/) utilise en interne.
## Comment les morceaux sont dérivés
diff --git a/docs/src/content/docs/fr/ai/module/chat.md b/docs/src/content/docs/fr/ai/module/chat.md
index 5006a55..c210c4d 100644
--- a/docs/src/content/docs/fr/ai/module/chat.md
+++ b/docs/src/content/docs/fr/ai/module/chat.md
@@ -10,19 +10,19 @@ Le plugin de chat est la pièce la plus simple du module IA. Il encapsule l'API
$ai = new \Nibiru\Module\Ai\Ai();
$chat = $ai->chat();
-$chat->system('Be terse.'); // optional system prompt
-$chat->model('qwen2.5-coder:14b'); // override the configured model
-$chat->temperature(0.2); // override config
-$chat->maxTokens(512); // override config
+$chat->system('Be terse.'); / optional system prompt
+$chat->model('qwen2.5-coder:14b'); / override the configured model
+$chat->temperature(0.2); / override config
+$chat->maxTokens(512); / override config
-$chat->user('Hello'); // append a user message
-$chat->assistant('Hi.'); // append an assistant message (rare)
+$chat->user('Hello'); / append a user message
+$chat->assistant('Hi.'); / append an assistant message (rare)
-$reply = $chat->complete(); // run the call, return text
-$reply = $chat->ask('How are you?'); // = ->user(...)->complete()
+$reply = $chat->complete(); / run the call, return text
+$reply = $chat->ask('How are you?'); / = ->user(...)->complete()
-$chat->reset(); // clear messages, keep model + system
-$chat->history(); // [{role, content}, …]
+$chat->reset(); / clear messages, keep model + system
+$chat->history(); / [{role, content}, …]
```
## Un coup unique
```php
@@ -35,10 +35,10 @@ echo (new \Nibiru\Module\Ai\Ai())
$chat = $ai->chat();
$chat->user('Name three Nibiru singletons.');
-$singletons = $chat->complete(); // appended to history
+$singletons = $chat->complete(); / appended to history
$chat->user('What does the second one do?');
-$detail = $chat->complete(); // model has full context
+$detail = $chat->complete(); / model has full context
```
## Remplacement du modèle et du style par appel
```php
diff --git a/docs/src/content/docs/fr/ai/module/embed.md b/docs/src/content/docs/fr/ai/module/embed.md
index 3c78ed8..881a1df 100644
--- a/docs/src/content/docs/fr/ai/module/embed.md
+++ b/docs/src/content/docs/fr/ai/module/embed.md
@@ -9,12 +9,12 @@ Le plugin Embed est un simple wrapper autour de `/api/embeddings` d'Ollama, plus
```php
$embed = (new \Nibiru\Module\Ai\Ai())->embed();
-$vec = $embed->one('controller'); // float[]
-$vectors = $embed->batch(['a', 'b', 'c']); // float[][]
+$vec = $embed->one('controller'); / float[]
+$vectors = $embed->batch(['a', 'b', 'c']); / float[][]
-$score = \Nibiru\Module\Ai\Plugin\Embed::cosine($a, $b); // 0..1
-$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); // base64 string
-$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed); // back to float[]
+$score = \Nibiru\Module\Ai\Plugin\Embed::cosine($a, $b); / 0..1
+$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); / base64 string
+$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed); / back to float[]
```
## Modèle : dédoublonner des chaînes similaires
```php
@@ -49,8 +49,8 @@ function bestTag(string $text, array $tagVecs, $embed): string {
return $best[0];
}
-echo bestTag('User::isAuthorized', $tagVecs, $embed); // → 'authentication'
-echo bestTag('Pageination::setTable', $tagVecs, $embed); // → 'database' (probably)
+echo bestTag('User::isAuthorized', $tagVecs, $embed); / → 'authentication'
+echo bestTag('Pageination::setTable', $tagVecs, $embed); / → 'database' (probably)
```
## Stockage
@@ -58,7 +58,7 @@ Les embeddings sont des tableaux de flottants — généralement 768 flottants p
Utilisez `Embed::pack()` pour les encoder en base64 comme des flottants sur 4 octets :
```php
-$compact = Embed::pack($vec); // ~4 KB → ~5.3 KB base64 string
+$compact = Embed::pack($vec); / ~4 KB → ~5.3 KB base64 string
$vec = Embed::unpack($compact);
```
Le plugin RAG utilise ce format internalement pour ses fichiers JSON.
diff --git a/docs/src/content/docs/fr/ai/module/overview.md b/docs/src/content/docs/fr/ai/module/overview.md
index 3147252..46d9ffc 100644
--- a/docs/src/content/docs/fr/ai/module/overview.md
+++ b/docs/src/content/docs/fr/ai/module/overview.md
@@ -57,7 +57,7 @@ echo $ai->chat()->ask('Explain MMVC in two sentences.');
// Multi-turn
$chat = $ai->chat();
$chat->user('How do I scaffold a module?');
-$chat->user('And add Graylog hooks?'); // referrs to previous turn
+$chat->user('And add Graylog hooks?'); / referrs to previous turn
echo $chat->complete();
// Override per call
@@ -80,7 +80,7 @@ $score = \Nibiru\Module\Ai\Plugin\Embed::cosine($va, $vb);
```
Stockage compact :
```php
-$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); // base64 string, 4 bytes/dim
+$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); / base64 string, 4 bytes/dim
$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed);
```
### 3. RAG — ingérer, récupérer, ancrer
@@ -88,7 +88,7 @@ $vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed);
$rag = $ai->rag('product-help');
// One-time ingestion
-$rag->ingestDir(__DIR__ . '/help/'); // walks .md/.txt/.php
+$rag->ingestDir(__DIR__ . '/help/'); / walks .md/.txt/.php
$rag->ingestText('FAQ entry…', ['source' => 'faq-12']);
$rag->ingestFile('/var/data/manual.pdf.txt');
@@ -105,9 +105,9 @@ use Nibiru\Module\Ai\Plugin\Tools;
$ai = new \Nibiru\Module\Ai\Ai();
$agent = $ai->agent()->withTools([
- new Tools\PdoQuery(), // read-only SQL
- new Tools\HttpGet(), // fetch URLs
- new Tools\FileRead(), // read project files
+ new Tools\PdoQuery(), / read-only SQL
+ new Tools\HttpGet(), / fetch URLs
+ new Tools\FileRead(), / read project files
]);
echo $agent->run('How many active users registered last week?');
@@ -154,7 +154,7 @@ La philosophie de conception :
## Suivant
-- [Référence du module de chat](/fr/ia/module/chat/)
-- [Référence du module RAG](/fr/ia/module/rag/)
-- [Référence du module agent](/fr/ia/module/agent/)
-- [Formation nibiru-coder](/fr/ia/module/training/)
+- [Référence du module de chat](/fr/ai/module/chat/)
+- [Référence du module RAG](/fr/ai/module/rag/)
+- [Référence du module agent](/fr/ai/module/agent/)
+- [Formation nibiru-coder](/fr/ai/module/training/)
diff --git a/docs/src/content/docs/fr/ai/module/rag.md b/docs/src/content/docs/fr/ai/module/rag.md
index 5952408..62f9b47 100644
--- a/docs/src/content/docs/fr/ai/module/rag.md
+++ b/docs/src/content/docs/fr/ai/module/rag.md
@@ -10,9 +10,9 @@ Le plugin RAG est la fonctionnalité clé du module IA pour les constructeurs de
use Nibiru\Module\Ai\Ai;
$ai = new Ai();
-$rag = $ai->rag('product-help'); // a named collection
+$rag = $ai->rag('product-help'); / a named collection
-$rag->ingestDir(__DIR__ . '/help/'); // walks .md/.txt/.php under help/
+$rag->ingestDir(__DIR__ . '/help/'); / walks .md/.txt/.php under help/
$rag->ingestText('FAQ entry…', ['source' => 'faq-12']);
echo $rag->ask('How do I cancel my subscription?');
@@ -46,20 +46,20 @@ $logs->ingestText($exception->__toString(), ['ts' => time()]);
```
## Référence de l'API
```php
-$rag = $ai->rag('name'); // get/create a named collection
+$rag = $ai->rag('name'); / get/create a named collection
// --- Ingestion ---
-$rag->ingestText($text, $metadata = []); // single chunk
-$count = $rag->ingestFile('path'); // returns chunks added
-$count = $rag->ingestDir('dir', ['md','txt','php']); // recursive
+$rag->ingestText($text, $metadata = []); / single chunk
+$count = $rag->ingestFile('path'); / returns chunks added
+$count = $rag->ingestDir('dir', ['md','txt','php']); / recursive
// --- Querying ---
-$hits = $rag->search('query', $k = null); // [{score, text, metadata}, …]
-$answer = $rag->ask('question', $k = null); // top-K → chat call
+$hits = $rag->search('query', $k = null); / [{score, text, metadata}, …]
+$answer = $rag->ask('question', $k = null); / top-K → chat call
// --- Maintenance ---
-$rag->reset(); // forget everything (deletes file)
-$n = $rag->size(); // number of chunks
+$rag->reset(); / forget everything (deletes file)
+$n = $rag->size(); / number of chunks
```
## Réglages
@@ -95,5 +95,5 @@ rag.storage_path = "/../../application/module/ai/cache/rag/"
## ¿Qué sigue?
-- [Plugin agent →](/fr/ia/module/agent/) pour les outils, pas la récupération.
-- [Formation nibiru-coder →](/fr/ia/module/formation/) pour faire répondre le chat à moitié dans la voix du framework.
+- [Plugin agent →](/fr/ai/module/agent/) pour les outils, pas la récupération.
+- [Formation nibiru-coder →](/fr/ai/module/training/) pour faire répondre le chat à moitié dans la voix du framework.
diff --git a/docs/src/content/docs/fr/core/auth.md b/docs/src/content/docs/fr/core/auth.md
index 9f3e99f..a2f473b 100644
--- a/docs/src/content/docs/fr/core/auth.md
+++ b/docs/src/content/docs/fr/core/auth.md
@@ -114,7 +114,7 @@ public function pageAction() {
View::forwardTo('/login');
return;
}
- // ...
+ / ...
}
```
Pour les vérifications basées sur le rôle, les applications de démonstration utilisent le plugin `Acl` du même module :
@@ -178,7 +178,7 @@ public function submitAction() {
http_response_code(419);
return;
}
- // ...handle submission...
+ / ...handle submission...
}
```
Intégrez `` dans votre formulaire.
diff --git a/docs/src/content/docs/fr/core/config.md b/docs/src/content/docs/fr/core/config.md
index 205da36..0cd3bf5 100644
--- a/docs/src/content/docs/fr/core/config.md
+++ b/docs/src/content/docs/fr/core/config.md
@@ -82,19 +82,19 @@ password_hash = "another-salt-for-AES_DECRYPT"
## Lecture des configurations
```php
$cfg = \Nibiru\Config::getInstance()->getConfig();
-$cfg['DATABASE']['driver']; // 'pdo'
-$cfg['SETTINGS']['page.url']; // 'https://my-app.local'
+$cfg['DATABASE']['driver']; / 'pdo'
+$cfg['SETTINGS']['page.url']; / 'https://my-app.local'
```
Pour les configurations profondément imbriquées, utilisez les constantes typées de l'interface View :
```php
-$cfg[\Nibiru\View::NIBIRU_SETTINGS]['smarty.css']; // ['/public/css/app.css']
+$cfg[\Nibiru\View::NIBIRU_SETTINGS]['smarty.css']; / ['/public/css/app.css']
```
## Configurations des modules
Chaque module situé sous `application/module//settings/` peut posséder ses propres fichiers INI. Le Registre les détecte automatiquement et les expose via :
```php
$users = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
-$users->session_lifetime; // from [USERS] section in users.ini
+$users->session_lifetime; / from [USERS] section in users.ini
```
Le Registre préfère `..ini` par rapport à `.ini`, donc vous obtenez des remplacements par environnement gratuitement.
diff --git a/docs/src/content/docs/fr/core/controllers.md b/docs/src/content/docs/fr/core/controllers.md
index 6b010da..37bef86 100644
--- a/docs/src/content/docs/fr/core/controllers.md
+++ b/docs/src/content/docs/fr/core/controllers.md
@@ -56,12 +56,12 @@ View::assign(['products' => $list]);
```
Aides pratiques du contrôleur de base :
```php
-$this->getRequest('id', false); // $_REQUEST['id'] ?? false
-$this->getPost('email', ''); // $_POST['email'] ?? ''
-$this->getGet('page', 1); // $_GET['page'] ?? 1
-$this->getServer('REQUEST_URI'); // $_SERVER['REQUEST_URI']
-$this->getFiles('upload'); // $_FILES['upload']
-$this->getSession('auth'); // $_SESSION['auth']
+$this->getRequest('id', false); / $_REQUEST['id'] ?? false
+$this->getPost('email', ''); / $_POST['email'] ?? ''
+$this->getGet('page', 1); / $_GET['page'] ?? 1
+$this->getServer('REQUEST_URI'); / $_SERVER['REQUEST_URI']
+$this->getFiles('upload'); / $_FILES['upload']
+$this->getSession('auth'); / $_SESSION['auth']
```
Ces éléments existent en raison du fait que `Controller` est compatible avec `final` : vous pouvez les simuler dans les tests en remplaçant par une classe enfant.
@@ -69,8 +69,8 @@ Ces éléments existent en raison du fait que `Controller` est compatible avec `
Pour rediriger à l'intérieur d'une action :
```php
-View::forwardTo('/login'); // 302 to the URL, exits
-View::forwardToJsonHeader(); // sets Content-Type: application/json
+View::forwardTo('/login'); / 302 to the URL, exits
+View::forwardToJsonHeader(); / sets Content-Type: application/json
```
`forwardToJsonHeader()` est le modèle canonique pour les points de terminaison JSON — définissez l'en-tête, attribuez `data`, puis retournez. La couche d'affichage s'occupe du reste.
diff --git a/docs/src/content/docs/fr/core/dispatcher.md b/docs/src/content/docs/fr/core/dispatcher.md
index d26f6f9..916b25f 100644
--- a/docs/src/content/docs/fr/core/dispatcher.md
+++ b/docs/src/content/docs/fr/core/dispatcher.md
@@ -30,17 +30,17 @@ public function run() {
if (Config::getInstance()->getConfig()
[self::CONFIG_GENERATOR_SECTION][self::GENERATOR_DATABASE]) {
- new Model(false); // 1. (re)generate models from schema
+ new Model(false); / 1. (re)generate models from schema
}
- Router::getInstance()->route(); // 2. parse the URL
- Auto::loader()->loadModelFiles(); // 3. load model files
- Auto::loader()->loadModules(); // 4. load module classes
+ Router::getInstance()->route(); / 2. parse the URL
+ Auto::loader()->loadModelFiles(); / 3. load model files
+ Auto::loader()->loadModules(); / 4. load module classes
$tpl = Router::getInstance()->tplName();
$controllerFile = __DIR__ . "/../../application/controller/{$tpl}Controller.php";
- if (is_file($controllerFile)) { // 5. controller file exists
+ if (is_file($controllerFile)) { / 5. controller file exists
require_once $controllerFile;
$class = "Nibiru\\{$tpl}Controller";
$controller = new $class();
@@ -49,7 +49,7 @@ public function run() {
$action = $_REQUEST['_action'] . 'Action';
$controller->navigationAction();
if (method_exists($controller, $action)) {
- $controller->$action(); // 6. optional named action
+ $controller->$action(); / 6. optional named action
}
$controller->pageAction();
} else {
@@ -57,9 +57,9 @@ public function run() {
$controller->pageAction();
}
- Display::getInstance()->display(); // 7. render Smarty
+ Display::getInstance()->display(); / 7. render Smarty
} else {
- // 8. soft 404 — render the configured error controller
+ / 8. soft 404 — render the configured error controller
}
}
```
diff --git a/docs/src/content/docs/fr/core/forms.md b/docs/src/content/docs/fr/core/forms.md
index bb3fdbd..fafe451 100644
--- a/docs/src/content/docs/fr/core/forms.md
+++ b/docs/src/content/docs/fr/core/forms.md
@@ -40,8 +40,8 @@ addOpenSpan addCloseSpan
```
### Cycle de vie
```
-create // reset the static buffer; call before building a new form
-addForm // wrap the buffer in
...
and return as a string
+create / reset the static buffer; call before building a new form
+addForm / wrap the buffer in
...
and return as a string
```
:::caution[L'incréance de nommage est intentionnelle, mais pas complètement]
`addInputTypePassword` vs `addTypePassword`, `addInputTypeFileupload` vs `addTypeFileUpload` — le préfixe correspond à ce que l'élément soit un `` (préfixe Input) ou une autre balise (préfixe Type). C'est un peu inconfortable, mais stable ; les modèles de conception utilisés par la CLI `./nibiru -c` suivent le même modèle, donc l'habitude s'impose.
@@ -51,7 +51,7 @@ addForm // wrap the buffer in
...
and return as a string
```php
use Nibiru\Factory\Form;
-Form::create(); // reset the static buffer
+Form::create(); / reset the static buffer
Form::addOpenDiv(['class' => 'form-group']);
Form::addTypeLabel(['for' => 'login', 'value' => 'Username']);
@@ -187,7 +187,7 @@ class formsController extends Controller {
'required' => 'required',
'class' => 'contacts-input form-control',
]);
- // ...more fields...
+ / ...more fields...
$this->form = Form::addForm([
'name' => 'newregister',
'method' => 'post',
diff --git a/docs/src/content/docs/fr/core/modules.md b/docs/src/content/docs/fr/core/modules.md
index c04395f..69cb6b2 100644
--- a/docs/src/content/docs/fr/core/modules.md
+++ b/docs/src/content/docs/fr/core/modules.md
@@ -147,9 +147,9 @@ allowed.roles[] = "standard"
Lisez-le à partir d'ailleurs :
```php
$cfg = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
-$cfg->session_lifetime; // 7200
-$cfg->password_min_length; // 12
-$cfg->allowed_roles; // [admin, editor, standard]
+$cfg->session_lifetime; / 7200
+$cfg->password_min_length; / 12
+$cfg->allowed_roles; / [admin, editor, standard]
```
Superpositions d'environnement : un fichier nommé `users.production.ini` est préféré par rapport à `users.ini` lorsque `APPLICATION_ENV=production`.
@@ -162,7 +162,7 @@ $analytics = new \Nibiru\Module\Analytics\Analytics();
$analytics->attach(new \Nibiru\Module\Analytics\Plugin\Matomo());
$analytics->attach(new \Nibiru\Module\Analytics\Plugin\Plausible());
-$analytics->trackPageView(); // internally calls notify()
+$analytics->trackPageView(); / internally calls notify()
```
Chaque observateur reçoit l'instance d'analytics via sa méthode `update($subject)` et extrait les données d'événement dont il a besoin.
@@ -200,7 +200,7 @@ Les noms sont des **noms de dossiers en minuscules**, exactement tels qu'ils app
Les classes de plugin se trouvent dans l'espace de noms **pluriel** `Plugins`:
```php
// application/module/billing/plugins/invoice.php
-namespace Nibiru\Module\Billing\Plugins; // ← plural
+namespace Nibiru\Module\Billing\Plugins; / ← plural
class Invoice extends \Nibiru\Module\Billing\Billing { /* ... */ }
```
Ne correspondez pas à l'espace de noms et vous obtiendrez des manquements d'autoload. Le squelette CLI (`./nibiru -m billing`) génère l'espace de noms correct pour vous.
@@ -210,7 +210,7 @@ Ne correspondez pas à l'espace de noms et vous obtiendrez des manquements d'aut
Vous **ne** vous inscrivez pas les fichiers INI de votre module — le [Registry](/en/core/registry/) les découvre automatiquement en parcourant `application/module//settings/*.ini` après que `[AUTOLOADER]` a chargé la classe du module. Chaque section `[]` (en majuscules) d'un INI devient disponible comme :
```php
$cfg = \Nibiru\Registry::getInstance()->loadModuleConfigByName('billing');
-$cfg->invoice_prefix; // [BILLING] invoice.prefix → property
+$cfg->invoice_prefix; / [BILLING] invoice.prefix → property
```
Le Registre préfère `..ini` (par exemple `billing.production.ini`) lorsque `APPLICATION_ENV` correspond.
diff --git a/docs/src/content/docs/fr/core/pagination.md b/docs/src/content/docs/fr/core/pagination.md
index 36d46f2..cb257fb 100644
--- a/docs/src/content/docs/fr/core/pagination.md
+++ b/docs/src/content/docs/fr/core/pagination.md
@@ -14,7 +14,7 @@ class productsController extends Controller
{
public function pageAction() {
$products = new products();
- Pageination::setEntriesPerPage(25); // optional; default from INI
+ Pageination::setEntriesPerPage(25); / optional; default from INI
Pageination::setTable($products);
$rows = Pageination::loadTableAsArray();
diff --git a/docs/src/content/docs/fr/core/registry.md b/docs/src/content/docs/fr/core/registry.md
index da5038b..cf1e9da 100644
--- a/docs/src/content/docs/fr/core/registry.md
+++ b/docs/src/content/docs/fr/core/registry.md
@@ -20,7 +20,7 @@ Pour chaque module sous `application/module//settings/` :
$users = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
$users->session_lifetime;
$users->password_min_length;
-$users->allowed_roles; // array
+$users->allowed_roles; / array
```
À l'intérieur du module lui-même, la convention est d'envelopper cela dans un mutateur :
```php
diff --git a/docs/src/content/docs/fr/core/routing.md b/docs/src/content/docs/fr/core/routing.md
index f0b7af9..5b6e1c2 100644
--- a/docs/src/content/docs/fr/core/routing.md
+++ b/docs/src/content/docs/fr/core/routing.md
@@ -40,7 +40,7 @@ Tout ce qui se trouve après le segment d'action devient une clé `$_REQUEST` pa
// /users/edit/42 → $_REQUEST['id'] = '42'
public function editAction() {
$id = (int) ($_REQUEST['id'] ?? 0);
- // ...
+ / ...
}
```
Pour les paramètres non numériques ou nommés, privilégiez les chaînes de requête :
@@ -62,9 +62,9 @@ Lorsqu'une URL correspond au modèle, les groupes capturés sont attribués aux
## Aide aux routages
```php
-Router::getInstance()->currentPage(); // 'products'
-Router::getInstance()->tplName(); // 'products' (controller stem for templates)
-Router::getInstance()->getController(); // alias for currentPage()
+Router::getInstance()->currentPage(); / 'products'
+Router::getInstance()->tplName(); / 'products' (controller stem for templates)
+Router::getInstance()->getController(); / alias for currentPage()
```
Ces éléments sont utiles dans les contrôleurs et les modèles :
```smarty
diff --git a/docs/src/content/docs/fr/design/components.md b/docs/src/content/docs/fr/design/components.md
index 0425c76..0c9fe73 100644
--- a/docs/src/content/docs/fr/design/components.md
+++ b/docs/src/content/docs/fr/design/components.md
@@ -7,7 +7,7 @@ description: "Boutons, cartes, appels à l’action, héros — prêts à être
Un rectangle noir sur crème. Éditorial. Pas de dégradé, pas d'éclairage.
```html
-
+Read the docs→
@@ -162,7 +162,7 @@ Grille asymétrique à deux colonnes. Un grand numéro éditorial derrière le t
Nibiru is a modular PHP framework for builders who ship.
diff --git a/docs/src/content/docs/fr/index.mdx b/docs/src/content/docs/fr/index.mdx
index bd6add9..816bff3 100644
--- a/docs/src/content/docs/fr/index.mdx
+++ b/docs/src/content/docs/fr/index.mdx
@@ -19,73 +19,25 @@ hero:
variant: minimal
---
-import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components';
+import CometTrail from '../../../components/CometTrail.astro';
+import MmvcStage from '../../../components/MmvcStage.astro';
+import MissionControl from '../../../components/MissionControl.astro';
+import LaunchSequence from '../../../components/LaunchSequence.astro';
+import SpacecraftGrid from '../../../components/SpacecraftGrid.astro';
+import EditorialContent from '../../../components/EditorialContent.astro';
+import LandingFooter from '../../../components/LandingFooter.astro';
+import ToTop from '../../../components/ToTop.astro';
+import LandingScripts from '../../../components/LandingScripts.astro';
-## Une constellation de capacités
+
+
+
+
+
+
+
+
-
-
- Les modules enveloppent le MVC avec traits, plugins, interfaces et paramètres. Le second **M** est faiblement couplé par conception, avec le pattern observer `SplSubject` intégré.
-
-
- Cinq pilotes en orbite : `mysql`, `pdo`, `postgres` (ODBC), `psql` (libpq) et `postgresql`. Basculez en modifiant une seule clé INI.
-
-
- Vues pilotées par templates, un assistant global `View::assign()`, et un cache chaud `templates_c`. Plus partiels partagés, includes de navigation et templates de pagination.
-
-
- Plus de 28 types de champ — text, password, switch, color, range, file upload — composés via des appels statiques `Form::add…` et rendus en une seule chaîne HTML.
-
-
- `./nibiru` génère modules, contrôleurs, plugins, migrations et pages CMS. Il exécute les migrations contre `local`, `staging` ou `production`.
-
-
- Nibiru sera le premier framework PHP avec un Oracle basé sur RAG entraîné sur sa propre connaissance — et un corpus publié pour de futurs fine-tunes.
-
-
-
-## Démarrage rapide
-
-```bash
-# Cloner
-git clone https://github.com/alllinux/Nibiru mon-app && cd mon-app
-
-# Installer les dépendances PHP (Smarty, PHPMailer, Guzzle, …)
-composer install
-
-# Permissions + amorçage des dossiers
-./nibiru -s
-
-# Première migration
-./nibiru -mi local
-
-# Générer un contrôleur
-./nibiru -c products
-```
-
-```php
-// application/controller/productsController.php
-namespace Nibiru;
-use Nibiru\Adapter\Controller;
-
-class productsController extends Controller {
- public function pageAction() {
- View::assign([
- 'title' => 'Produits — Nibiru',
- 'products' => [['id' => 1, 'name' => 'Plaquage d\'or Marduk']],
- ]);
- }
- public function navigationAction() {
- JsonNavigation::getInstance()->loadJsonNavigationArray();
- }
-}
-```
-
-## Où aller ensuite
-
-
-
-
-
-
-
+{/* Loads three.js + the original mockup scene code. MUST be the last node so
+ every #id the scene targets exists in the DOM when the script runs. */}
+
diff --git a/docs/src/content/docs/fr/showcase/patterns.md b/docs/src/content/docs/fr/showcase/patterns.md
index 63f900d..65cff40 100644
--- a/docs/src/content/docs/fr/showcase/patterns.md
+++ b/docs/src/content/docs/fr/showcase/patterns.md
@@ -61,7 +61,7 @@ Plusieurs suivi sans couplage avec le contrôleur.
$analytics = new Analytics();
$analytics->attach(new Plugin\Matomo());
$analytics->attach(new Plugin\Plausible());
-$analytics->trackPageView(); // calls notify() internally
+$analytics->trackPageView(); / calls notify() internally
```
Chaque observateur appelle uniquement les champs dont il s'occupe avec sa méthode `update($subject)`. Ajouter un suivi est une modification d'une seule ligne.
diff --git a/docs/src/content/docs/fr/showcase/projects.md b/docs/src/content/docs/fr/showcase/projects.md
index 976fe04..43a3c75 100644
--- a/docs/src/content/docs/fr/showcase/projects.md
+++ b/docs/src/content/docs/fr/showcase/projects.md
@@ -55,7 +55,7 @@ public function detailAction()
try {
$machine = Machine::init()->getMachine((int) $machineId);
} catch (\Throwable $e) {
- $machine = null; // DB blip → page still renders with fallback.
+ $machine = null; / DB blip → page still renders with fallback.
}
$machineName = $machine['ms_machines_name'] ?? "Maschine #$machineId";
@@ -120,7 +120,7 @@ Les cinq différences ci-dessous sont tirées des bases de code ci-dessus. Chacu
| Authentification | 3 lignes dans le constructeur du contrôleur. | Pile de middlewares + classes de politique + portails. |
| Événements | `SplSubject` + `SplObserver` de la bibliothèque standard PHP. | Dispatcheur d'événements personnalisé + registre d'écouteurs + file d'attente. |
-Lisez le [détail complet avec des références de code →](/fr/pourquoi-nibiru/)
+Lisez le [détail complet avec des références de code →](/fr/why-nibiru/)
---
diff --git a/docs/src/content/docs/fr/why-nibiru.md b/docs/src/content/docs/fr/why-nibiru.md
index 91e468a..f8db021 100644
--- a/docs/src/content/docs/fr/why-nibiru.md
+++ b/docs/src/content/docs/fr/why-nibiru.md
@@ -50,7 +50,7 @@ class Cms implements Interfaces\Cms, SplSubject
use Traits\PageBuilderForm;
use Traits\CmsPageStructureModifier;
use Traits\FormElements;
- // …8 more traits
+ / …8 more traits
}
```
**Effet net**: aucune injection de constructeur, aucune inscription auprès du fournisseur de services, aucun appel à `bind()` / `singleton()` dans un fichier de configuration. Un nouveau développeur peut rechercher le nom du trait et voir tous les appels.
@@ -108,7 +108,7 @@ Le contrôleur API adopte une approche inverse : une liste blanche des points de
```php
// public endpoints can be listed up-front, auth wraps the rest.
if (in_array($action, ['category', 'machines', 'ollama', 'team'])) {
- // public, skip auth
+ / public, skip auth
} else {
$this->user = new User();
$this->acl = new Acl();
@@ -137,8 +137,8 @@ class Machineryscout implements IModule, \SplSubject
}
public function indexMachines(): void {
- // …do the work…
- $this->notify(); // analytics, cache invalidator, audit log all see it.
+ / …do the work…
+ $this->notify(); / analytics, cache invalidator, audit log all see it.
}
}
```
@@ -154,4 +154,4 @@ Un développeur solo ou une petite équipe peut construire et *exploiter* une v
Si vous préférez voir votre code, prenez-le.
-→ [Lisez la présentation →](/fr/presentation/projets/)
+→ [Lisez la présentation →](/fr/showcase/projects/)
diff --git a/docs/src/content/docs/ja/ai/corpus.md b/docs/src/content/docs/ja/ai/corpus.md
index d794c4d..d42bcec 100644
--- a/docs/src/content/docs/ja/ai/corpus.md
+++ b/docs/src/content/docs/ja/ai/corpus.md
@@ -60,7 +60,7 @@ OpenAIのfine-tune、AnthropicのAPI評価、ほとんどのLoRAツール(Axol
"content": "Modules implementing `SplSubject` can broadcast events…"
}
```
-これは[Oracle](/ai/oracle/)が内部で使用している正確なファイルです。
+これは[Oracle](/ja/ai/oracle/)が内部で使用している正確なファイルです。
## チャンクの導出方法
diff --git a/docs/src/content/docs/ja/ai/module/chat.md b/docs/src/content/docs/ja/ai/module/chat.md
index cfab395..f8f5925 100644
--- a/docs/src/content/docs/ja/ai/module/chat.md
+++ b/docs/src/content/docs/ja/ai/module/chat.md
@@ -10,19 +10,19 @@ description: "単一または複数のターンで行われる、任意のOllama
$ai = new \Nibiru\Module\Ai\Ai();
$chat = $ai->chat();
-$chat->system('Be terse.'); // optional system prompt
-$chat->model('qwen2.5-coder:14b'); // override the configured model
-$chat->temperature(0.2); // override config
-$chat->maxTokens(512); // override config
+$chat->system('Be terse.'); / optional system prompt
+$chat->model('qwen2.5-coder:14b'); / override the configured model
+$chat->temperature(0.2); / override config
+$chat->maxTokens(512); / override config
-$chat->user('Hello'); // append a user message
-$chat->assistant('Hi.'); // append an assistant message (rare)
+$chat->user('Hello'); / append a user message
+$chat->assistant('Hi.'); / append an assistant message (rare)
-$reply = $chat->complete(); // run the call, return text
-$reply = $chat->ask('How are you?'); // = ->user(...)->complete()
+$reply = $chat->complete(); / run the call, return text
+$reply = $chat->ask('How are you?'); / = ->user(...)->complete()
-$chat->reset(); // clear messages, keep model + system
-$chat->history(); // [{role, content}, …]
+$chat->reset(); / clear messages, keep model + system
+$chat->history(); / [{role, content}, …]
```
## 一発
```php
@@ -35,10 +35,10 @@ echo (new \Nibiru\Module\Ai\Ai())
$chat = $ai->chat();
$chat->user('Name three Nibiru singletons.');
-$singletons = $chat->complete(); // appended to history
+$singletons = $chat->complete(); / appended to history
$chat->user('What does the second one do?');
-$detail = $chat->complete(); // model has full context
+$detail = $chat->complete(); / model has full context
```
## モデルとスタイルを個別呼び出しごとに上書きする
```php
@@ -65,7 +65,7 @@ chat.provider = "anthropic"
anthropic.api_key = "sk-ant-..."
anthropic.model = "claude-haiku-4-5-20251001"
```
-チャットプラグインはまだフレームワークモジュールにAnthropicトランスポートを含んでいません — 現在、ドキュメントサイトの`scripts/lib/providers.mjs`パターンが参考となっています。([マイルストーン](/ja/ai/milestones/)をご覧ください。)
+チャットプラグインはまだフレームワークモジュールにAnthropicトランスポートを含んでいません — 現在、ドキュメントサイトの`scripts/lib/providers.mjs`パターンが参考となっています。([マイルストーン](/ja/ai/roadmap/)をご覧ください。)
## 実践的なパターン: チャットをアクションとして
```php
diff --git a/docs/src/content/docs/ja/ai/module/embed.md b/docs/src/content/docs/ja/ai/module/embed.md
index 34217cc..5b2eb31 100644
--- a/docs/src/content/docs/ja/ai/module/embed.md
+++ b/docs/src/content/docs/ja/ai/module/embed.md
@@ -9,12 +9,12 @@ Embedプラグインは、Ollamaの`/api/embeddings`に薄いラッパーであ
```php
$embed = (new \Nibiru\Module\Ai\Ai())->embed();
-$vec = $embed->one('controller'); // float[]
-$vectors = $embed->batch(['a', 'b', 'c']); // float[][]
+$vec = $embed->one('controller'); / float[]
+$vectors = $embed->batch(['a', 'b', 'c']); / float[][]
-$score = \Nibiru\Module\Ai\Plugin\Embed::cosine($a, $b); // 0..1
-$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); // base64 string
-$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed); // back to float[]
+$score = \Nibiru\Module\Ai\Plugin\Embed::cosine($a, $b); / 0..1
+$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); / base64 string
+$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed); / back to float[]
```
## パターン: 遠近似の文字列を重複除去する
```php
@@ -49,8 +49,8 @@ function bestTag(string $text, array $tagVecs, $embed): string {
return $best[0];
}
-echo bestTag('User::isAuthorized', $tagVecs, $embed); // → 'authentication'
-echo bestTag('Pageination::setTable', $tagVecs, $embed); // → 'database' (probably)
+echo bestTag('User::isAuthorized', $tagVecs, $embed); / → 'authentication'
+echo bestTag('Pageination::setTable', $tagVecs, $embed); / → 'database' (probably)
```
## ストレージ
@@ -58,7 +58,7 @@ echo bestTag('Pageination::setTable', $tagVecs, $embed); // → 'database' (prob
`Embed::pack()` を使用して、それらを 4 バイトの浮動小数点数として base64 エンコードします。
```php
-$compact = Embed::pack($vec); // ~4 KB → ~5.3 KB base64 string
+$compact = Embed::pack($vec); / ~4 KB → ~5.3 KB base64 string
$vec = Embed::unpack($compact);
```
RAG プラグインは、この形式を使用して内部の JSON ファイルを管理しています。
diff --git a/docs/src/content/docs/ja/ai/module/overview.md b/docs/src/content/docs/ja/ai/module/overview.md
index d91c5fc..5f91ef2 100644
--- a/docs/src/content/docs/ja/ai/module/overview.md
+++ b/docs/src/content/docs/ja/ai/module/overview.md
@@ -57,7 +57,7 @@ echo $ai->chat()->ask('Explain MMVC in two sentences.');
// Multi-turn
$chat = $ai->chat();
$chat->user('How do I scaffold a module?');
-$chat->user('And add Graylog hooks?'); // referrs to previous turn
+$chat->user('And add Graylog hooks?'); / referrs to previous turn
echo $chat->complete();
// Override per call
@@ -80,7 +80,7 @@ $score = \Nibiru\Module\Ai\Plugin\Embed::cosine($va, $vb);
```
コンパクトなストレージ:
```php
-$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); // base64 string, 4 bytes/dim
+$packed = \Nibiru\Module\Ai\Plugin\Embed::pack($vec); / base64 string, 4 bytes/dim
$vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed);
```
### 3. RAG — 収集、検索、基準化
@@ -88,7 +88,7 @@ $vec = \Nibiru\Module\Ai\Plugin\Embed::unpack($packed);
$rag = $ai->rag('product-help');
// One-time ingestion
-$rag->ingestDir(__DIR__ . '/help/'); // walks .md/.txt/.php
+$rag->ingestDir(__DIR__ . '/help/'); / walks .md/.txt/.php
$rag->ingestText('FAQ entry…', ['source' => 'faq-12']);
$rag->ingestFile('/var/data/manual.pdf.txt');
@@ -105,9 +105,9 @@ use Nibiru\Module\Ai\Plugin\Tools;
$ai = new \Nibiru\Module\Ai\Ai();
$agent = $ai->agent()->withTools([
- new Tools\PdoQuery(), // read-only SQL
- new Tools\HttpGet(), // fetch URLs
- new Tools\FileRead(), // read project files
+ new Tools\PdoQuery(), / read-only SQL
+ new Tools\HttpGet(), / fetch URLs
+ new Tools\FileRead(), / read project files
]);
echo $agent->run('How many active users registered last week?');
diff --git a/docs/src/content/docs/ja/ai/module/rag.md b/docs/src/content/docs/ja/ai/module/rag.md
index 7786163..1a90f24 100644
--- a/docs/src/content/docs/ja/ai/module/rag.md
+++ b/docs/src/content/docs/ja/ai/module/rag.md
@@ -10,9 +10,9 @@ RAG プラグインは、製品ビルダーにとって AI モジュールのキ
use Nibiru\Module\Ai\Ai;
$ai = new Ai();
-$rag = $ai->rag('product-help'); // a named collection
+$rag = $ai->rag('product-help'); / a named collection
-$rag->ingestDir(__DIR__ . '/help/'); // walks .md/.txt/.php under help/
+$rag->ingestDir(__DIR__ . '/help/'); / walks .md/.txt/.php under help/
$rag->ingestText('FAQ entry…', ['source' => 'faq-12']);
echo $rag->ask('How do I cancel my subscription?');
@@ -46,20 +46,20 @@ $logs->ingestText($exception->__toString(), ['ts' => time()]);
```
## API リファレンス
```php
-$rag = $ai->rag('name'); // get/create a named collection
+$rag = $ai->rag('name'); / get/create a named collection
// --- Ingestion ---
-$rag->ingestText($text, $metadata = []); // single chunk
-$count = $rag->ingestFile('path'); // returns chunks added
-$count = $rag->ingestDir('dir', ['md','txt','php']); // recursive
+$rag->ingestText($text, $metadata = []); / single chunk
+$count = $rag->ingestFile('path'); / returns chunks added
+$count = $rag->ingestDir('dir', ['md','txt','php']); / recursive
// --- Querying ---
-$hits = $rag->search('query', $k = null); // [{score, text, metadata}, …]
-$answer = $rag->ask('question', $k = null); // top-K → chat call
+$hits = $rag->search('query', $k = null); / [{score, text, metadata}, …]
+$answer = $rag->ask('question', $k = null); / top-K → chat call
// --- Maintenance ---
-$rag->reset(); // forget everything (deletes file)
-$n = $rag->size(); // number of chunks
+$rag->reset(); / forget everything (deletes file)
+$n = $rag->size(); / number of chunks
```
## チューニングの調整項目
diff --git a/docs/src/content/docs/ja/core/auth.md b/docs/src/content/docs/ja/core/auth.md
index a480853..80f5bec 100644
--- a/docs/src/content/docs/ja/core/auth.md
+++ b/docs/src/content/docs/ja/core/auth.md
@@ -114,7 +114,7 @@ public function pageAction() {
View::forwardTo('/login');
return;
}
- // ...
+ / ...
}
```
ロール認識のチェックのために、デモンストレーションアプリケーションは同じモジュールから `Acl` プラグインを使用しています。
@@ -178,7 +178,7 @@ public function submitAction() {
http_response_code(419);
return;
}
- // ...handle submission...
+ / ...handle submission...
}
```
フォームに `` を埋め込んでください。
diff --git a/docs/src/content/docs/ja/core/config.md b/docs/src/content/docs/ja/core/config.md
index b91a0fb..861f672 100644
--- a/docs/src/content/docs/ja/core/config.md
+++ b/docs/src/content/docs/ja/core/config.md
@@ -82,19 +82,19 @@ password_hash = "another-salt-for-AES_DECRYPT"
## 設定の読み込み
```php
$cfg = \Nibiru\Config::getInstance()->getConfig();
-$cfg['DATABASE']['driver']; // 'pdo'
-$cfg['SETTINGS']['page.url']; // 'https://my-app.local'
+$cfg['DATABASE']['driver']; / 'pdo'
+$cfg['SETTINGS']['page.url']; / 'https://my-app.local'
```
深くネストされた設定には、View インターフェースから型付けされた定数を使用してください。
```php
-$cfg[\Nibiru\View::NIBIRU_SETTINGS]['smarty.css']; // ['/public/css/app.css']
+$cfg[\Nibiru\View::NIBIRU_SETTINGS]['smarty.css']; / ['/public/css/app.css']
```
## モジュールの設定
各モジュールの `application/module//settings/` 以下には独自の INI ファイルを配置できます。Registry はそれらを自動的に取り込み、以下の通りに公開します:
```php
$users = \Nibiru\Registry::getInstance()->loadModuleConfigByName('users');
-$users->session_lifetime; // from [USERS] section in users.ini
+$users->session_lifetime; / from [USERS] section in users.ini
```
レジストリは `..ini` を `.ini` よりも優先します。これにより、環境ごとのオーバーライドが無料で利用できます。
diff --git a/docs/src/content/docs/ja/core/controllers.md b/docs/src/content/docs/ja/core/controllers.md
index e93e6a0..7852722 100644
--- a/docs/src/content/docs/ja/core/controllers.md
+++ b/docs/src/content/docs/ja/core/controllers.md
@@ -56,12 +56,12 @@ View::assign(['products' => $list]);
```
ベースコントローラーからの便利ヘルパー:
```php
-$this->getRequest('id', false); // $_REQUEST['id'] ?? false
-$this->getPost('email', ''); // $_POST['email'] ?? ''
-$this->getGet('page', 1); // $_GET['page'] ?? 1
-$this->getServer('REQUEST_URI'); // $_SERVER['REQUEST_URI']
-$this->getFiles('upload'); // $_FILES['upload']
-$this->getSession('auth'); // $_SESSION['auth']
+$this->getRequest('id', false); / $_REQUEST['id'] ?? false
+$this->getPost('email', ''); / $_POST['email'] ?? ''
+$this->getGet('page', 1); / $_GET['page'] ?? 1
+$this->getServer('REQUEST_URI'); / $_SERVER['REQUEST_URI']
+$this->getFiles('upload'); / $_FILES['upload']
+$this->getSession('auth'); / $_SESSION['auth']
```
これらは存在する理由は、`Controller`が`final`に耐えられるように設計されていることです:テストで子クラスを置き換えてモックすることができます。
@@ -69,8 +69,8 @@ $this->getSession('auth'); // $_SESSION['auth']
アクション内でリダイレクトするには:
```php
-View::forwardTo('/login'); // 302 to the URL, exits
-View::forwardToJsonHeader(); // sets Content-Type: application/json
+View::forwardTo('/login'); / 302 to the URL, exits
+View::forwardToJsonHeader(); / sets Content-Type: application/json
```
`forwardToJsonHeader()` は、JSON エンドポイントの標準的なパターンです。ヘッダーを設定し、`data` を割り当ててから返す。その後、表示層が残りの処理を行います。
diff --git a/docs/src/content/docs/ja/core/dispatcher.md b/docs/src/content/docs/ja/core/dispatcher.md
index d185055..b442846 100644
--- a/docs/src/content/docs/ja/core/dispatcher.md
+++ b/docs/src/content/docs/ja/core/dispatcher.md
@@ -30,17 +30,17 @@ public function run() {
if (Config::getInstance()->getConfig()
[self::CONFIG_GENERATOR_SECTION][self::GENERATOR_DATABASE]) {
- new Model(false); // 1. (re)generate models from schema
+ new Model(false); / 1. (re)generate models from schema
}
- Router::getInstance()->route(); // 2. parse the URL
- Auto::loader()->loadModelFiles(); // 3. load model files
- Auto::loader()->loadModules(); // 4. load module classes
+ Router::getInstance()->route(); / 2. parse the URL
+ Auto::loader()->loadModelFiles(); / 3. load model files
+ Auto::loader()->loadModules(); / 4. load module classes
$tpl = Router::getInstance()->tplName();
$controllerFile = __DIR__ . "/../../application/controller/{$tpl}Controller.php";
- if (is_file($controllerFile)) { // 5. controller file exists
+ if (is_file($controllerFile)) { / 5. controller file exists
require_once $controllerFile;
$class = "Nibiru\\{$tpl}Controller";
$controller = new $class();
@@ -49,7 +49,7 @@ public function run() {
$action = $_REQUEST['_action'] . 'Action';
$controller->navigationAction();
if (method_exists($controller, $action)) {
- $controller->$action(); // 6. optional named action
+ $controller->$action(); / 6. optional named action
}
$controller->pageAction();
} else {
@@ -57,9 +57,9 @@ public function run() {
$controller->pageAction();
}
- Display::getInstance()->display(); // 7. render Smarty
+ Display::getInstance()->display(); / 7. render Smarty
} else {
- // 8. soft 404 — render the configured error controller
+ / 8. soft 404 — render the configured error controller
}
}
```
diff --git a/docs/src/content/docs/ja/core/forms.md b/docs/src/content/docs/ja/core/forms.md
index d966dc9..ac19963 100644
--- a/docs/src/content/docs/ja/core/forms.md
+++ b/docs/src/content/docs/ja/core/forms.md
@@ -40,8 +40,8 @@ addOpenSpan addCloseSpan
```
### ライフサイクル
```
-create // reset the static buffer; call before building a new form
-addForm // wrap the buffer in
...
and return as a string
+create / reset the static buffer; call before building a new form
+addForm / wrap the buffer in
...
and return as a string
```
:::caution[名前の不一致は意図的なもの、ある程度]
`addInputTypePassword` vs `addTypePassword`, `addInputTypeFileupload` vs `addTypeFileUpload` — プレフィックスが要素が `` (Input プレフィックス) であるかどうか(Input プレフィックス)か、他のタグ(Type プレフィックス)であるかどうかに一致します。これは奇妙ですが安定しています;CLI の `./nibiru -c` スキャフォールディングは同じパターンを使用しているため、筋肉記憶が働きます。
@@ -51,7 +51,7 @@ addForm // wrap the buffer in