Files
computer-playbook/roles/web-app-wordpress/files/php/ai_engine/endpoint.php
T
kevinveenbirkenbachandClaude Opus 5 dfe7a7fdd4 refactor(roles): sort role scripts into per-language folders
The merged branch moved every role-local script out of files/ into a folder
named for its language (files/python/, files/php/, files/shell/), but the
moves lost their staging and never landed. HEAD still carried the old paths
while the worktree had the new ones.

Move the 24 remaining scripts and update the six places that resolve them:
the mcp-adapter instance/isolation/probe tasks, the litellm key task, the
adapter README and the endpoint-path lint. Every changed line in those
files is a path.

Also drop roles/sys-svc-compose/files/swarm/stack_ready.sh, a stale
duplicate of the copy already tracked under files/shell/swarm/.

The added comments are the branch's own `nocheck: mirrored-unit-test`
directives, which state why a script whose measurement only exists inside
its container cannot have a mirrored unit test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 12:00:59 +02:00

21 lines
650 B
PHP

<?php
/**
* Environment:
* AI_ENGINE_ENV_ID: id of the environment the deploy manages.
*/
// nocheck: mirrored-unit-test - runs through `wp eval-file` and reads mwai_options off
// the booted site; the WordPress runtime it needs is only present inside the container
$wanted = getenv('AI_ENGINE_ENV_ID');
$options = get_option('mwai_options', array());
$envs = (is_array($options) && isset($options['ai_envs']) && is_array($options['ai_envs']))
? $options['ai_envs']
: array();
foreach ($envs as $env) {
if ((isset($env['id']) ? $env['id'] : '') === $wanted) {
echo isset($env['endpoint']) ? $env['endpoint'] : '';
}
}