-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathext_localconf.php
More file actions
126 lines (112 loc) · 5.76 KB
/
Copy pathext_localconf.php
File metadata and controls
126 lines (112 loc) · 5.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/*
* Copyright (c) 2025-2026 Netresearch DTT GmbH
* SPDX-License-Identifier: GPL-2.0-or-later
*/
declare(strict_types=1);
use Netresearch\NrLlm\Domain\Enum\BackendUserGrant;
use Netresearch\NrLlm\Form\Element\ModelIdElement;
use Netresearch\NrLlm\Form\FieldWizard\ModelConstraintsWizard;
use Netresearch\NrLlm\Hook\ProviderEndpointNormalizationHook;
use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend;
defined('TYPO3') || die();
(static function (): void {
// Cache configuration (also in Configuration/Caching.php for TYPO3 v14+)
// No backend specified — TYPO3 uses the instance's default cache backend,
// which respects Redis/Valkey/Memcached if configured by the admin.
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['nrllm_responses'] ??= [
'frontend' => VariableFrontend::class,
'options' => [
'defaultLifetime' => 3600,
],
'groups' => ['nrllm'],
];
// Short-lived reachability cache (overview provider dots).
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['nrllm_reachability'] ??= [
'frontend' => VariableFrontend::class,
'options' => [
'defaultLifetime' => 60,
],
'groups' => ['nrllm'],
];
// Per-provider circuit breaker state (ADR-063). The store writes its own
// per-entry lifetime; this default applies only to entries written without.
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['nrllm_circuit'] ??= [
'frontend' => VariableFrontend::class,
'options' => [
'defaultLifetime' => 300,
],
'groups' => ['nrllm'],
];
// Short-lived provider health snapshot (ADR-063).
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['nrllm_health'] ??= [
'frontend' => VariableFrontend::class,
'options' => [
'defaultLifetime' => 60,
],
'groups' => ['nrllm'],
];
// Request idempotency store (ADR-063). The middleware writes its own
// per-entry TTL (the idempotency window).
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['nrllm_idempotency'] ??= [
'frontend' => VariableFrontend::class,
'options' => [
'defaultLifetime' => 86400,
],
'groups' => ['nrllm'],
];
// Register custom TCA renderType for model_id field with API fetch
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1741427200] = [
'nodeName' => 'modelIdWithFetch',
'priority' => 40,
'class' => ModelIdElement::class,
];
// Register field wizard for model constraint detection on configuration form
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1741427201] = [
'nodeName' => 'modelConstraintsWizard',
'priority' => 40,
'class' => ModelConstraintsWizard::class,
];
// Normalize tx_nrllm_provider.endpoint_url to the adapter's canonical base URL
// when a provider is created/edited through the TCA record editor, so the
// manual write path stores a working base URL just like the Setup Wizard (#300).
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
= ProviderEndpointNormalizationHook::class;
// Dedicated dashboard widget group for the agentic / governance / telemetry
// widgets, so they do not scatter into the built-in 'general' group. Inert
// without typo3/cms-dashboard installed (the array is simply never read).
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dashboard']['widgetGroups']['nrllm'] ??= [
'title' => 'LLL:EXT:nr_llm/Resources/Private/Language/locallang_dashboard.xlf:widgetGroup.nrllm.title',
];
// Capability grants for human backend users (ADR-130): assigned per
// backend GROUP through the be_groups access lists, checked via
// BackendUserAuthentication::check('custom_options', ...). Item keys must
// not contain ':', '|' or ',' — TYPO3 strips those when rendering the
// select, so a colon-namespaced key would be stored mangled and silently
// deny (see BackendUserGrant).
// @phpstan-ignore-next-line $GLOBALS access returns mixed at each nesting level
$GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions']['tx_nrllm_grants'] = [
'header' => 'LLL:EXT:nr_llm/Resources/Private/Language/locallang.xlf:grants.header',
'items' => [
BackendUserGrant::TASKS_USE->value => [
'LLL:EXT:nr_llm/Resources/Private/Language/locallang.xlf:grants.tasksUse',
'module-nrllm',
'LLL:EXT:nr_llm/Resources/Private/Language/locallang.xlf:grants.tasksUse.description',
],
BackendUserGrant::AGENT_APPROVE->value => [
'LLL:EXT:nr_llm/Resources/Private/Language/locallang.xlf:grants.agentApprove',
'module-nrllm',
'LLL:EXT:nr_llm/Resources/Private/Language/locallang.xlf:grants.agentApprove.description',
],
],
];
})();