@miller-tech/uap 1.89.0 → 1.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/guided-setup.d.ts.map +1 -1
- package/dist/cli/guided-setup.js +118 -2
- package/dist/cli/guided-setup.js.map +1 -1
- package/dist/cli/react.d.ts.map +1 -1
- package/dist/cli/react.js +19 -0
- package/dist/cli/react.js.map +1 -1
- package/dist/cli/wizard-config.d.ts +45 -0
- package/dist/cli/wizard-config.d.ts.map +1 -1
- package/dist/cli/wizard-config.js +101 -1
- package/dist/cli/wizard-config.js.map +1 -1
- package/dist/types/config.d.ts +180 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +46 -0
- package/dist/types/config.js.map +1 -1
- package/package.json +1 -1
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
- package/tools/agents/scripts/anthropic_proxy.py +60 -0
- package/tools/agents/scripts/confidence_escalation.py +36 -7
- package/tools/agents/tests/test_anthropic_proxy_streaming.py +28 -0
- package/tools/agents/tests/test_confidence_escalation.py +37 -0
- package/tools/agents/tests/test_proxy_env_loader.py +59 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Tests for the .uap/proxy.env loader (recipe/escalation/delivery env wiring)."""
|
|
2
|
+
import importlib.util
|
|
3
|
+
import os
|
|
4
|
+
import tempfile
|
|
5
|
+
import unittest
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _load_proxy_module():
|
|
10
|
+
proxy_path = Path(__file__).resolve().parents[1] / "scripts" / "anthropic_proxy.py"
|
|
11
|
+
spec = importlib.util.spec_from_file_location("anthropic_proxy", proxy_path)
|
|
12
|
+
module = importlib.util.module_from_spec(spec)
|
|
13
|
+
spec.loader.exec_module(module)
|
|
14
|
+
return module
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
proxy = _load_proxy_module()
|
|
18
|
+
|
|
19
|
+
KEYS = ("PROXY_RECIPE", "PROXY_ESCALATE_MODEL", "UAP_DELIVER_LOCAL_MODE", "QUOTED",
|
|
20
|
+
"EXISTING_KEY", "UAP_PROXY_ENV_FILE")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ProxyEnvLoaderTest(unittest.TestCase):
|
|
24
|
+
def tearDown(self):
|
|
25
|
+
for k in KEYS:
|
|
26
|
+
os.environ.pop(k, None)
|
|
27
|
+
|
|
28
|
+
def test_loads_keys_without_overriding_existing(self):
|
|
29
|
+
d = tempfile.mkdtemp()
|
|
30
|
+
env_file = Path(d) / "proxy.env"
|
|
31
|
+
env_file.write_text(
|
|
32
|
+
"# comment line\n"
|
|
33
|
+
"PROXY_RECIPE=fusion\n"
|
|
34
|
+
"PROXY_ESCALATE_MODEL=claude-opus-4-8\n"
|
|
35
|
+
"UAP_DELIVER_LOCAL_MODE=deliver\n"
|
|
36
|
+
'QUOTED="value with spaces"\n'
|
|
37
|
+
"\n"
|
|
38
|
+
"EXISTING_KEY=from_file\n"
|
|
39
|
+
)
|
|
40
|
+
for k in KEYS:
|
|
41
|
+
os.environ.pop(k, None)
|
|
42
|
+
os.environ["EXISTING_KEY"] = "from_env" # must NOT be overridden
|
|
43
|
+
os.environ["UAP_PROXY_ENV_FILE"] = str(env_file)
|
|
44
|
+
|
|
45
|
+
proxy._load_proxy_env_file()
|
|
46
|
+
|
|
47
|
+
self.assertEqual(os.environ["PROXY_RECIPE"], "fusion")
|
|
48
|
+
self.assertEqual(os.environ["PROXY_ESCALATE_MODEL"], "claude-opus-4-8")
|
|
49
|
+
self.assertEqual(os.environ["UAP_DELIVER_LOCAL_MODE"], "deliver")
|
|
50
|
+
self.assertEqual(os.environ["QUOTED"], "value with spaces")
|
|
51
|
+
self.assertEqual(os.environ["EXISTING_KEY"], "from_env")
|
|
52
|
+
|
|
53
|
+
def test_missing_file_is_noop(self):
|
|
54
|
+
os.environ["UAP_PROXY_ENV_FILE"] = "/nonexistent/does/not/exist.env"
|
|
55
|
+
proxy._load_proxy_env_file() # must not raise
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
if __name__ == "__main__":
|
|
59
|
+
unittest.main()
|