Add a scope-aware assistant dock to the scheduler right panel

This commit is contained in:
Gmer4Lfe
2026-08-05 19:56:02 -04:00
parent 60994c7667
commit 185abdb442
4 changed files with 233 additions and 4 deletions
+18 -2
View File
@@ -82,8 +82,8 @@ if (PHP_SAPI !== 'cli') {
require_once dirname(__DIR__) . '/include/ai.php';
[$jobFile, $question, $historyJson, $kind, $think, $profile] =
array_slice($argv, 1, 6) + array_fill(0, 6, '');
[$jobFile, $question, $historyJson, $kind, $think, $profile, $scope] =
array_slice($argv, 1, 7) + array_fill(0, 7, '');
if ($jobFile === '' || $question === '') exit(1);
if (!preg_match('#/[0-9a-f]{32}\.json$#', $jobFile)) exit(1);
@@ -240,6 +240,22 @@ if ($profile === 'chat') {
// has already been decided — so it should frame everything that follows rather than read as one
// more retrieved document. Marked as operator-authored so the model treats it as fact about the
// installation rather than as a source to cite.
// Where the operator is standing in the WebGUI. Sent by the scheduler page, absent from the AI
// tab, which has no location to speak of. It is what lets "what does this do" resolve — without
// it the model has to guess which of 120 settings "this" means, and it will guess confidently.
//
// Stated as context, never as an instruction to trust: the file named here is where to look
// first, not proof that the answer is in it. That distinction is the whole point of the
// fallback — a setting the operator expects in master.conf may actually live in the host conf,
// and saying so is more useful than failing to find it.
if ($scope !== '') {
$system .= "WHERE THE OPERATOR IS RIGHT NOW\n"
. "They have " . $scope . " open in the WebGUI. Read bare references — \"this "
. "setting\", \"this script\", \"here\" — as meaning that unless they clearly mean "
. "something else. Look there first. If what they are asking about is genuinely "
. "somewhere else, answer anyway and tell them plainly where it actually is.\n\n";
}
$mem = vv_ai_memory_read();
if ($mem['exists'] && trim($mem['text']) !== '') {
$system .= "WHAT YOU ALREADY KNOW ABOUT THIS OPERATOR AND INSTALLATION\n"