hackagent-webui 0.5.19.dev58__tar.gz → 0.5.21.dev60__tar.gz
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.
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/PKG-INFO +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/__init__.py +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/404.html +1 -1
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/VERSION +1 -0
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/924-a45ad002025944dc.js → hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/924-4691ca4c204d197d.js +1 -1
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/app/agents/page-2e581fcca5116a94.js +1 -0
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/app/attacks/page-b2413be2a8ab61fc.js +1 -0
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/app/layout-4344f2819815c745.js → hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/app/layout-95ff112e3e2ac8eb.js +1 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/app/profile/page-41bc4e813fb2d240.js → hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/app/profile/page-08c991b2ab248fb7.js +1 -1
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/app/secrets/page-62bf5dba3522de29.js +1 -0
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/chunks/app/stats/page-275a2b415a2f1e9b.js +1 -0
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/css/62a118f1cf702f73.css +1 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/agents.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/agents.txt +5 -5
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/api-keys.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/api-keys.txt +5 -5
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/attacks.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/attacks.txt +5 -5
- hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/campaign-export/styles.css +2 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/index.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/index.txt +5 -5
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/profile.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/profile.txt +5 -5
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/secrets.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/secrets.txt +5 -5
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/stats.html +1 -1
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/stats.txt +5 -5
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/VERSION +0 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/app/agents/page-30de78974cc31585.js +0 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/app/attacks/page-5350dcc2a9e9b220.js +0 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/app/secrets/page-03ea34f740709d10.js +0 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/chunks/app/stats/page-27c2367c193a9b7f.js +0 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/css/3e762cbf3dad6acd.css +0 -1
- hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/campaign-export/styles.css +0 -2
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/.gitignore +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/README.md +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/pyproject.toml +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/133-3d48df8e6274f1e3.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/176-5cc7fc0b6b2515c7.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/259-252d18d6e44b253a.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/274-7bcbf1c829f21215.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/343-a4d2eb0ec9b0ad08.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/373-2cd9dd2f37667862.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/41-19701c9e1d5392fe.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/493-34228dd02f768bba.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/4bd1b696-409494caf8c83275.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/547-669ff4558f8f62ba.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/570-2cfb1925b42e0c87.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/574-0cc0eddd7440f9e6.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/576-18b5984bad944e1f.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/583-78ba13009c3dc8f0.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/602-e25fde26bccbeb75.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/619-7c7bed420eb7c654.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/634-0167d7c9c4879699.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/727-3d5d954e608613b1.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/776-e05722d87e478223.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/784-27c51ffcb299d644.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/81-ac2b07fd6ed26676.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/877.6c5ea5a15f1f6508.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/8cc6faea.9c97f45fb95ac7ef.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/abf9ae41-a2ad9357d01c2a31.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/app/_not-found/page-72f9264520fc0b6a.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/app/api-keys/page-c328dd1bd8b83c5d.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/app/not-found-60bbe1f5c6cf66f2.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/app/page-1c03fd81f0ad4be8.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/d648eb28.1d95c1563be1bba4.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/framework-e2c84bf8dbc6c531.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/main-app-641b4390ed531d52.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/main-b2abf26ddb8313ad.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/pages/_app-fcbe3e68b26044e2.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/pages/_error-394ce64747f32b60.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/_next/static/chunks/webpack-ecae86322f0a33a1.js +0 -0
- {hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/VzQ9KvyvIVrq3jqBS3rC5 → hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/pcPoYcIb3NYsdOQtNIuUf}/_buildManifest.js +0 -0
- {hackagent_webui-0.5.19.dev58/src/hackagent_webui/static/_next/static/VzQ9KvyvIVrq3jqBS3rC5 → hackagent_webui-0.5.21.dev60/src/hackagent_webui/static/_next/static/pcPoYcIb3NYsdOQtNIuUf}/_ssgManifest.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/android-chrome-192x192.png +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/android-chrome-512x512.png +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/apple-touch-icon.png +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/campaign-export/runtime.js +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/favicon-16x16.png +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/favicon-32x32.png +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/favicon.ico +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/raccoon.png +0 -0
- {hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/silent-check-sso.html +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: hackagent-webui
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.21.dev60
|
|
4
4
|
Summary: Prebuilt HackAgent dashboard served by the hackagent CLI.
|
|
5
5
|
Project-URL: Homepage, https://hackagent.dev
|
|
6
6
|
Project-URL: Source, https://github.com/AISecurityLab/hackagent-webapp
|
{hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/__init__.py
RENAMED
|
@@ -23,7 +23,7 @@ from pathlib import Path
|
|
|
23
23
|
|
|
24
24
|
# Replaced at build time with the PEP 440 version derived from the git tag
|
|
25
25
|
# (scripts/pep440-version.mjs). The placeholder is what a source checkout shows.
|
|
26
|
-
__version__ = "0.5.
|
|
26
|
+
__version__ = "0.5.21.dev60"
|
|
27
27
|
|
|
28
28
|
#: Present in every real bundle; its absence means the wheel was built without
|
|
29
29
|
#: running the export.
|
{hackagent_webui-0.5.19.dev58 → hackagent_webui-0.5.21.dev60}/src/hackagent_webui/static/404.html
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--pcPoYcIb3NYsdOQtNIuUf--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/62a118f1cf702f73.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-ecae86322f0a33a1.js"/><script src="/_next/static/chunks/4bd1b696-409494caf8c83275.js" async=""></script><script src="/_next/static/chunks/493-34228dd02f768bba.js" async=""></script><script src="/_next/static/chunks/main-app-641b4390ed531d52.js" async=""></script><script src="/_next/static/chunks/abf9ae41-a2ad9357d01c2a31.js" async=""></script><script src="/_next/static/chunks/133-3d48df8e6274f1e3.js" async=""></script><script src="/_next/static/chunks/574-0cc0eddd7440f9e6.js" async=""></script><script src="/_next/static/chunks/619-7c7bed420eb7c654.js" async=""></script><script src="/_next/static/chunks/41-19701c9e1d5392fe.js" async=""></script><script src="/_next/static/chunks/583-78ba13009c3dc8f0.js" async=""></script><script src="/_next/static/chunks/727-3d5d954e608613b1.js" async=""></script><script src="/_next/static/chunks/784-27c51ffcb299d644.js" async=""></script><script src="/_next/static/chunks/259-252d18d6e44b253a.js" async=""></script><script src="/_next/static/chunks/924-4691ca4c204d197d.js" async=""></script><script src="/_next/static/chunks/app/layout-95ff112e3e2ac8eb.js" async=""></script><script src="/_next/static/chunks/app/not-found-60bbe1f5c6cf66f2.js" async=""></script><meta name="robots" content="noindex"/><title>HackAgent Dashboard</title><meta name="description" content="Dashboard for HackAgent API"/><link rel="icon" href="/favicon.ico"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script src="/_next/static/chunks/webpack-ecae86322f0a33a1.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[49359,[\"330\",\"static/chunks/abf9ae41-a2ad9357d01c2a31.js\",\"133\",\"static/chunks/133-3d48df8e6274f1e3.js\",\"574\",\"static/chunks/574-0cc0eddd7440f9e6.js\",\"619\",\"static/chunks/619-7c7bed420eb7c654.js\",\"41\",\"static/chunks/41-19701c9e1d5392fe.js\",\"583\",\"static/chunks/583-78ba13009c3dc8f0.js\",\"727\",\"static/chunks/727-3d5d954e608613b1.js\",\"784\",\"static/chunks/784-27c51ffcb299d644.js\",\"259\",\"static/chunks/259-252d18d6e44b253a.js\",\"924\",\"static/chunks/924-4691ca4c204d197d.js\",\"177\",\"static/chunks/app/layout-95ff112e3e2ac8eb.js\"],\"Authorization\"]\n3:I[96280,[\"330\",\"static/chunks/abf9ae41-a2ad9357d01c2a31.js\",\"133\",\"static/chunks/133-3d48df8e6274f1e3.js\",\"574\",\"static/chunks/574-0cc0eddd7440f9e6.js\",\"619\",\"static/chunks/619-7c7bed420eb7c654.js\",\"41\",\"static/chunks/41-19701c9e1d5392fe.js\",\"583\",\"static/chunks/583-78ba13009c3dc8f0.js\",\"727\",\"static/chunks/727-3d5d954e608613b1.js\",\"784\",\"static/chunks/784-27c51ffcb299d644.js\",\"259\",\"static/chunks/259-252d18d6e44b253a.js\",\"924\",\"static/chunks/924-4691ca4c204d197d.js\",\"177\",\"static/chunks/app/layout-95ff112e3e2ac8eb.js\"],\"default\"]\n4:I[9766,[],\"\"]\n5:I[98924,[],\"\"]\n6:I[52619,[\"619\",\"static/chunks/619-7c7bed420eb7c654.js\",\"345\",\"static/chunks/app/not-found-60bbe1f5c6cf66f2.js\"],\"\"]\n7:I[24431,[],\"OutletBoundary\"]\n9:I[15278,[],\"AsyncMetadataOutlet\"]\nb:I[24431,[],\"ViewportBoundary\"]\nd:I[24431,[],\"MetadataBoundary\"]\ne:\"$Sreact.suspense\"\n10:I[57150,[],\"\"]\n:HL[\"/_next/static/css/62a118f1cf702f73.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"pcPoYcIb3NYsdOQtNIuUf\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/62a118f1cf702f73.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"div\",null,{\"className\":\"flex items-center justify-center min-h-screen\",\"children\":[\"$\",\"div\",null,{\"className\":\"text-center\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-4xl font-bold mb-4\",\"children\":\"404\"}],[\"$\",\"p\",null,{\"className\":\"text-gray-600 mb-8\",\"children\":\"Page not found\"}],[\"$\",\"$L6\",null,{\"href\":\"/\",\"className\":\"text-blue-600 hover:underline\",\"children\":\"Back to home\"}]]}]}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"div\",null,{\"className\":\"flex items-center justify-center min-h-screen\",\"children\":[\"$\",\"div\",null,{\"className\":\"text-center\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-4xl font-bold mb-4\",\"children\":\"404\"}],[\"$\",\"p\",null,{\"className\":\"text-gray-600 mb-8\",\"children\":\"Page not found\"}],[\"$\",\"$L6\",null,{\"href\":\"/\",\"className\":\"text-blue-600 hover:underline\",\"children\":\"Back to home\"}]]}]}],null,[\"$\",\"$L7\",null,{\"children\":[\"$L8\",[\"$\",\"$L9\",null,{\"promise\":\"$@a\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],null],[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$e\",null,{\"fallback\":null,\"children\":\"$Lf\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\n"])</script><script>self.__next_f.push([1,"11:I[80622,[],\"IconMark\"]\na:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"HackAgent Dashboard\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Dashboard for HackAgent API\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"$L11\",\"3\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"f:\"$a:metadata\"\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.5.21-stage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[924],{3998:(e,t,a)=>{a.d(t,{$:()=>c,r:()=>s});var n=a(95155);a(12115);var i=a(32467),o=a(83101),r=a(64269);let s=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:a,size:o,asChild:c=!1,...u}=e,l=c?i.DX:"button";return(0,n.jsx)(l,{"data-slot":"button",className:(0,r.cn)(s({variant:a,size:o,className:t})),...u})}},7831:(e,t,a)=>{a.d(t,{Bm:()=>k,DR:()=>c,Ft:()=>y,Iu:()=>w,KC:()=>p,ME:()=>l,gb:()=>g,in:()=>u,ki:()=>r,nu:()=>T,ui:()=>h,userApi:()=>f,vm:()=>d});var n=a(38775);let i=(0,a(41444).h)("apiClient"),o=null;function r(e){o=e,i.debug(e?"Access token set":"Access token cleared")}let s=async()=>(o||i.debug("No access token available."),o),c=new n.Vk6({basePath:"/api/proxy",middleware:[{pre:async e=>{i.debug("Running pre-request middleware...");let t=await s();t?(i.debug("Token found, adding Authorization header."),e.init.headers={...e.init.headers,Authorization:"Bearer ".concat(t)}):i.warn("No token found, Authorization header not added.")},post:async e=>{let t=e.response.headers.get("content-type");if(!e.response.ok&&t&&!t.includes("application/json")){let a=await e.response.text();throw i.error({status:e.response.status,contentType:t,preview:a.substring(0,200)},"API returned non-JSON response"),Error("API error ".concat(e.response.status,": Server returned ").concat(t," instead of JSON. Check API endpoint and CORS configuration."))}}}]}),u=new n.cwn(c),l=new n.uzR(c),h=new n.cdi(c),d=new n.Lev(c),g=new n.At2(c),f=new n.ipj(c),w=new n.UYx(c),p=new n.OgW(c),T=new n.XoK(c),k=new n.jhh(c),y=new n.ZLz(c)},38775:(e,t,a)=>{a.d(t,{cwn:()=>F,OgW:()=>H,Lev:()=>V,jhh:()=>$,Vk6:()=>i,XoK:()=>X,on2:()=>C,At2:()=>Y,UYx:()=>Z,o3e:()=>s,cdi:()=>Q,v3H:()=>ee,uzR:()=>et,qjb:()=>q,isU:()=>x,ZLz:()=>ea,S5d:()=>v,Esj:()=>z,ipj:()=>en,JlS:()=>U});let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(n=>(function t(a,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=i+(i.length?"[".concat(a,"]"):a);if(n instanceof Array){let e=n.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(o),"="));return"".concat(encodeURIComponent(o),"=").concat(e)}return n instanceof Set?t(a,Array.from(n),i):n instanceof Date?"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(n.toISOString())):n instanceof Object?e(n,o):"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(String(n)))})(n,t[n],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){this.configuration=e}}let o=new i;class r{withMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({pre:e}));return this.withMiddleware(...n)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({post:e}));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&r.jsonRegex.test(e)}async request(e,t){let{url:a,init:n}=await this.createFetchParams(e,t),i=await this.fetchApi(a,n);if(i&&i.status>=200&&i.status<300)return i;throw new s(i,"Response returned an error code")}async createFetchParams(e,t){var a,n;let i,o=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(o+="?"+this.configuration.queryParamsStringify(e.query));let r=Object.assign({},this.configuration.headers,e.headers);Object.keys(r).forEach(e=>void 0===r[e]?delete r[e]:{});let s={method:e.method,headers:r,body:e.body,credentials:this.configuration.credentials},c={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=c.body,i="undefined"!=typeof FormData&&a instanceof FormData||c.body instanceof URLSearchParams||(n=c.body,"undefined"!=typeof Blob&&n instanceof Blob)?c.body:this.isJsonMime(r["Content-Type"])?JSON.stringify(c.body):c.body,{url:o,init:{...c,body:i}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=o){this.configuration=e,this.fetchApi=async(e,t)=>{let a,n={url:e,init:t};for(let e of this.middleware)e.pre&&(n=await e.pre({fetch:this.fetchApi,...n})||n);try{a=await (this.configuration.fetchApi||fetch)(n.url,n.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new c(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:n.url,init:n.init,response:a.clone()})||a);return a},this.middleware=e.middleware}}r.jsonRegex=RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");class s extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class c extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class u extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}class l{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){this.raw=e,this.transformer=t}}class h{async value(){}constructor(e){this.raw=e}}function d(e){var t;return null==(t=e)?t:{id:t.id,timestamp:new Date(t.timestamp),apiKeyPrefix:t.api_key_prefix,userUsername:t.user_username,organizationName:t.organization_name,modelIdUsed:t.model_id_used,apiEndpoint:t.api_endpoint,inputTokens:t.input_tokens,outputTokens:t.output_tokens,creditsDeducted:t.credits_deducted,requestPayloadPreview:t.request_payload_preview,responsePayloadPreview:t.response_payload_preview}}function g(e,t){return null==e?e:{id:e.id,name:e.name}}function f(e,t){return null==e?e:{user:e.user,username:e.username,organization:e.organization}}function w(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,endpoint:t.endpoint,agentType:t.agent_type,description:null==t.description?void 0:t.description,config:t.config,organization:t.organization,organizationDetail:g(t.organization_detail,!1),owner:t.owner,ownerDetail:f(t.owner_detail,!1),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function p(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}function T(e){var t;return null==(t=e)?t:{id:t.id,type:t.type,agent:t.agent,agentName:t.agent_name,owner:t.owner,ownerUsername:t.owner_username,organization:t.organization,organizationName:t.organization_name,_configuration:t.configuration,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function k(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}function y(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,description:null==t.description?void 0:t.description,agent:t.agent,spec:t.spec,organization:t.organization,owner:t.owner,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function m(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}function A(e){var t;return null==(t=e)?t:{name:t.name,description:t.description}}function R(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{claimed_by:e.claimedBy}}let v={Pending:"PENDING",Running:"RUNNING",Completed:"COMPLETED",Failed:"FAILED",Cancelled:"CANCELLED"},q={Cloud:"cloud",Local:"local",Cli:"cli"},z={ToolCall:"TOOL_CALL",ToolResponse:"TOOL_RESPONSE",AgentThought:"AGENT_THOUGHT",AgentResponseChunk:"AGENT_RESPONSE_CHUNK",Other:"OTHER",McpStep:"MCP_STEP",A2AComm:"A2A_COMM"};function _(e){var t,a=e;if(null==a)return a;return{id:a.id,result:a.result,sequence:a.sequence,stepType:null==a.step_type?void 0:(t=a.step_type,t),timestamp:new Date(a.timestamp),content:null==a.content?void 0:a.content}}let C={NotEvaluated:"NOT_EVALUATED",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK",FailedJailbreak:"FAILED_JAILBREAK",ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",PassedCriteria:"PASSED_CRITERIA",FailedCriteria:"FAILED_CRITERIA"};function B(e){var t,a=e;if(null==a)return a;return{id:a.id,run:a.run,runId:a.run_id,requestPayload:null==a.request_payload?void 0:a.request_payload,responseStatusCode:null==a.response_status_code?void 0:a.response_status_code,responseHeaders:null==a.response_headers?void 0:a.response_headers,responseBody:null==a.response_body?void 0:a.response_body,latencyMs:null==a.latency_ms?void 0:a.latency_ms,detectedToolCalls:null==a.detected_tool_calls?void 0:a.detected_tool_calls,evaluationStatus:null==a.evaluation_status?void 0:(t=a.evaluation_status,t),evaluationNotes:null==a.evaluation_notes?void 0:a.evaluation_notes,evaluationMetrics:null==a.evaluation_metrics?void 0:a.evaluation_metrics,agentSpecificData:null==a.agent_specific_data?void 0:a.agent_specific_data,goal:null==a.goal?void 0:a.goal,goalIndex:null==a.goal_index?void 0:a.goal_index,timestamp:new Date(a.timestamp),traces:null==a.traces?void 0:a.traces.map(_)}}function P(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),runToken:null==e.run_token?void 0:e.run_token,env:null==e.env?void 0:e.env}}function I(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),command:null==e.command?void 0:e.command}}function K(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),credits:t.credits,creditsLastUpdated:new Date(t.credits_last_updated)}}function b(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}let U={Jailbroken:"JAILBROKEN",Mitigated:"MITIGATED",Error:"ERROR",Pending:"PENDING"};function S(e){var t,a=e;if(null==a)return a;return{goalIndex:a.goal_index,goal:a.goal,category:a.category,attempts:a.attempts,successfulJailbreaks:a.successful_jailbreaks,failedJailbreaks:a.failed_jailbreaks,errors:a.errors,notEvaluated:a.not_evaluated,verdict:(t=a.verdict,t),bestScore:a.best_score,decidingResult:a.deciding_result,firstTimestamp:new Date(a.first_timestamp),lastTimestamp:new Date(a.last_timestamp)}}function x(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,attackType:n.attack_type,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),totalResults:n.total_results,successfulJailbreaks:n.successful_jailbreaks,failedJailbreaks:n.failed_jailbreaks,errors:n.errors,notEvaluated:n.not_evaluated,totalGoals:n.total_goals,jailbrokenGoals:n.jailbroken_goals}}function E(e){var t;return null==(t=e)?t:{name:t.name,createdByUsername:t.created_by_username,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function D(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,prefix:t.prefix,created:new Date(t.created),revoked:t.revoked,expiryDate:null==t.expiry_date?null:new Date(t.expiry_date),user:t.user,userDetail:f(t.user_detail,!1),organization:t.organization,organizationDetail:g(t.organization_detail,!1)}}function J(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],e}function L(e){var t,a=e;if(null==a)return a;return{id:a.id,user:a.user,username:a.username,email:null==a.email?void 0:a.email,firstName:null==a.first_name?void 0:a.first_name,lastName:null==a.last_name?void 0:a.last_name,organization:a.organization,organizationName:a.organization_name,auth0UserId:a.auth0_user_id,keycloakUserId:a.keycloak_user_id,analyticsConsent:null==a.analytics_consent?void 0:(t=a.analytics_consent,t)}}function W(e){var t;return null==(t=e)?t:{code:t.code,message:t.message,details:t.details}}function O(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}function j(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),results:null==n.results?void 0:n.results.map(B)}}function N(e){var t;return null==(t=e)?t:{key:t.key,label:t.label,type:t.type,_default:t.default,description:t.description,required:t.required,choices:null==t.choices?null:t.choices,min:t.min,max:t.max,section:t.section,advanced:t.advanced}}function G(e){var t;return null==(t=e)?t:{attackType:t.attack_type,label:t.label,description:t.description,category:t.category,categoryLabel:t.category_label,categoryDescription:t.category_description,tags:t.tags,tagLabels:t.tag_labels,primaryOrder:t.primary_order,fields:t.fields.map(N),paramsSchema:t.params_schema,requiredRoles:t.required_roles,optionalRoles:t.optional_roles}}function M(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}class F extends r{async agentCreateRaw(e,t){if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"POST",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentCreate(e,t){let a=await this.agentCreateRaw(e,t);return await a.value()}async agentDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async agentDestroy(e,t){await this.agentDestroyRaw(e,t)}async agentListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(w)}})}async agentList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.agentListRaw(e,t);return await a.value()}async agentPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}(e.patchedAgentRequest,!1)},t),e=>w(e))}async agentPartialUpdate(e,t){let a=await this.agentPartialUpdateRaw(e,t);return await a.value()}async agentRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>w(e))}async agentRetrieve(e,t){let a=await this.agentRetrieveRaw(e,t);return await a.value()}async agentUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentUpdate().');if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentUpdate(e,t){let a=await this.agentUpdateRaw(e,t);return await a.value()}}class H extends r{async apilogsListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(d)}})}async apilogsList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.apilogsListRaw(e,t);return await a.value()}async apilogsRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling apilogsRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>d(e))}async apilogsRetrieve(e,t){let a=await this.apilogsRetrieveRaw(e,t);return await a.value()}async apilogsSummaryRetrieveRaw(e,t){if(null==e.endDate)throw new u("endDate",'Required parameter "endDate" was null or undefined when calling apilogsSummaryRetrieve().');if(null==e.startDate)throw new u("startDate",'Required parameter "startDate" was null or undefined when calling apilogsSummaryRetrieve().');let a={};null!=e.byKey&&(a.by_key=e.byKey),null!=e.endDate&&(a.end_date=e.endDate.toISOString().substring(0,10)),null!=e.startDate&&(a.start_date=e.startDate.toISOString().substring(0,10)),null!=e.tz&&(a.tz=e.tz);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/summary",method:"GET",headers:n,query:a},t),e=>d(e))}async apilogsSummaryRetrieve(e,t){let a=await this.apilogsSummaryRetrieveRaw(e,t);return await a.value()}}class V extends r{async attackCreateRaw(e,t){if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"POST",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackCreate(e,t){let a=await this.attackCreateRaw(e,t);return await a.value()}async attackDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async attackDestroy(e,t){await this.attackDestroyRaw(e,t)}async attackListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(T)}})}async attackList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.attackListRaw(e,t);return await a.value()}async attackPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}(e.patchedAttackRequest,!1)},t),e=>T(e))}async attackPartialUpdate(e,t){let a=await this.attackPartialUpdateRaw(e,t);return await a.value()}async attackRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>T(e))}async attackRetrieve(e,t){let a=await this.attackRetrieveRaw(e,t);return await a.value()}async attackUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackUpdate().');if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackUpdate(e,t){let a=await this.attackUpdateRaw(e,t);return await a.value()}}class $ extends r{async campaignCreateRaw(e,t){if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"POST",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignCreate(e,t){let a=await this.campaignCreateRaw(e,t);return await a.value()}async campaignDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async campaignDestroy(e,t){await this.campaignDestroyRaw(e,t)}async campaignLaunchAdhocRaw(e,t){if(null==e.adhocLaunchRequest)throw new u("adhocLaunchRequest",'Required parameter "adhocLaunchRequest" was null or undefined when calling campaignLaunchAdhoc().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/launch",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec,executor:e.executor}}(e.adhocLaunchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchAdhoc(e,t){let a=await this.campaignLaunchAdhocRaw(e,t);return await a.value()}async campaignLaunchCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignLaunchCreate().');if(null==e.launchRequest)throw new u("launchRequest",'Required parameter "launchRequest" was null or undefined when calling campaignLaunchCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/launch".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{executor:e.executor}}(e.launchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchCreate(e,t){let a=await this.campaignLaunchCreateRaw(e,t);return await a.value()}async campaignListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(y)}})}async campaignList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.campaignListRaw(e,t);return await a.value()}async campaignPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}(e.patchedCampaignRequest,!1)},t),e=>y(e))}async campaignPartialUpdate(e,t){let a=await this.campaignPartialUpdateRaw(e,t);return await a.value()}async campaignPreflightRetrieveRaw(e,t){if(null==e.executor)throw new u("executor",'Required parameter "executor" was null or undefined when calling campaignPreflightRetrieve().');if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPreflightRetrieve().');let a={};null!=e.executor&&(a.executor=e.executor);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/preflight".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{ok:t.ok,problems:t.problems.map(W)}})}async campaignPreflightRetrieve(e,t){let a=await this.campaignPreflightRetrieveRaw(e,t);return await a.value()}async campaignRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>y(e))}async campaignRetrieve(e,t){let a=await this.campaignRetrieveRaw(e,t);return await a.value()}async campaignSchemaRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/schema",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{schema:t.schema,datasetPresets:t.dataset_presets.map(A)}})}async campaignSchemaRetrieve(e){let t=await this.campaignSchemaRetrieveRaw(e);return await t.value()}async campaignStartCreateRaw(e,t){if(null==e.campaignStartRequest)throw new u("campaignStartRequest",'Required parameter "campaignStartRequest" was null or undefined when calling campaignStartCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/start",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,spec:e.spec,claimed_by:e.claimedBy}}(e.campaignStartRequest,!1)},t),e=>j(e))}async campaignStartCreate(e,t){let a=await this.campaignStartCreateRaw(e,t);return await a.value()}async campaignTechniquesListRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/techniques",method:"GET",headers:t,query:{}},e),e=>e.map(G))}async campaignTechniquesList(e){let t=await this.campaignTechniquesListRaw(e);return await t.value()}async campaignUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignUpdate().');if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignUpdate(e,t){let a=await this.campaignUpdateRaw(e,t);return await a.value()}}class X extends r{async creditsRequestCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/credits/request",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{amount:e.amount,reason:e.reason}}(e.creditRequestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{status:t.status}})}async creditsRequestCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.creditsRequestCreateRaw(e,t);return await a.value()}}class Y extends r{async keyContextRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/key/context",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,username:null==t.username?void 0:t.username,organizationId:null==t.organization_id?void 0:t.organization_id,organizationName:null==t.organization_name?void 0:t.organization_name}})}async keyContextRetrieve(e){let t=await this.keyContextRetrieveRaw(e);return await t.value()}async keyCreateRaw(e,t){if(null==e.userAPIKeyRequest)throw new u("userAPIKeyRequest",'Required parameter "userAPIKeyRequest" was null or undefined when calling keyCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,key:e.key}}(e.userAPIKeyRequest,!1)},t),e=>D(e))}async keyCreate(e,t){let a=await this.keyCreateRaw(e,t);return await a.value()}async keyDestroyRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"DELETE",headers:a,query:{}},t))}async keyDestroy(e,t){await this.keyDestroyRaw(e,t)}async keyListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(D)}})}async keyList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.keyListRaw(e,t);return await a.value()}async keyRetrieveRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"GET",headers:a,query:{}},t),e=>D(e))}async keyRetrieve(e,t){let a=await this.keyRetrieveRaw(e,t);return await a.value()}}class Z extends r{async organizationCreateRaw(e,t){if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"POST",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationCreate(e,t){let a=await this.organizationCreateRaw(e,t);return await a.value()}async organizationDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async organizationDestroy(e,t){await this.organizationDestroyRaw(e,t)}async organizationListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(K)}})}async organizationList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.organizationListRaw(e,t);return await a.value()}async organizationMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/organization/me",method:"GET",headers:t,query:{}},e),e=>K(e))}async organizationMeRetrieve(e){let t=await this.organizationMeRetrieveRaw(e);return await t.value()}async organizationPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}(e.patchedOrganizationRequest,!1)},t),e=>K(e))}async organizationPartialUpdate(e,t){let a=await this.organizationPartialUpdateRaw(e,t);return await a.value()}async organizationRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>K(e))}async organizationRetrieve(e,t){let a=await this.organizationRetrieveRaw(e,t);return await a.value()}async organizationUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationUpdate().');if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationUpdate(e,t){let a=await this.organizationUpdateRaw(e,t);return await a.value()}}class Q extends r{async resultCreateRaw(e,t){if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultCreate(e,t){let a=await this.resultCreateRaw(e,t);return await a.value()}async resultDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async resultDestroy(e,t){await this.resultDestroyRaw(e,t)}async resultListRaw(e,t){let a={};null!=e.evaluationStatus&&(a.evaluation_status=e.evaluationStatus),null!=e.goalIndex&&(a.goal_index=e.goalIndex),null!=e.includeTraces&&(a.include_traces=e.includeTraces),null!=e.ordering&&(a.ordering=e.ordering),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.run&&(a.run=e.run),null!=e.runOrganization&&(a.run__organization=e.runOrganization);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(B)}})}async resultList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.resultListRaw(e,t);return await a.value()}async resultPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}(e.patchedResultRequest,!1)},t),e=>B(e))}async resultPartialUpdate(e,t){let a=await this.resultPartialUpdateRaw(e,t);return await a.value()}async resultRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>B(e))}async resultRetrieve(e,t){let a=await this.resultRetrieveRaw(e,t);return await a.value()}async resultTraceCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultTraceCreate().');if(null==e.traceRequest)throw new u("traceRequest",'Required parameter "traceRequest" was null or undefined when calling resultTraceCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}/trace".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{sequence:e.sequence,step_type:e.stepType,content:e.content}}(e.traceRequest,!1)},t),e=>_(e))}async resultTraceCreate(e,t){let a=await this.resultTraceCreateRaw(e,t);return await a.value()}async resultUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultUpdate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultUpdate(e,t){let a=await this.resultUpdateRaw(e,t);return await a.value()}}let ee={ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",FailedCriteria:"FAILED_CRITERIA",FailedJailbreak:"FAILED_JAILBREAK",NotEvaluated:"NOT_EVALUATED",PassedCriteria:"PASSED_CRITERIA",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK"};class et extends r{async runCancelCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runCancelCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/cancel".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>j(e))}async runCancelCreate(e,t){let a=await this.runCancelCreateRaw(e,t);return await a.value()}async runChildrenCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runChildrenCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/children".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{attack:e.attack,agent:e.agent,run_config:e.runConfig}}(e.childRunRequest,!1)},t),e=>j(e))}async runChildrenCreate(e,t){let a=await this.runChildrenCreateRaw(e,t);return await a.value()}async runClaimCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runClaimCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/claim".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimCreate(e,t){let a=await this.runClaimCreateRaw(e,t);return await a.value()}async runClaimNextCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/claim-next",method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimNextCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runClaimNextCreateRaw(e,t);switch(a.raw.status){case 200:default:return await a.value();case 204:return null}}async runDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async runDestroy(e,t){await this.runDestroyRaw(e,t)}async runFinishCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runFinishCreate().');if(null==e.finishRequest)throw new u("finishRequest",'Required parameter "finishRequest" was null or undefined when calling runFinishCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/finish".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{status:e.status,note:e.note}}(e.finishRequest,!1)},t),e=>j(e))}async runFinishCreate(e,t){let a=await this.runFinishCreateRaw(e,t);return await a.value()}async runGoalsListRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runGoalsList().');let a={};null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/goals".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(S)}})}async runGoalsList(e,t){let a=await this.runGoalsListRaw(e,t);return await a.value()}async runHeartbeatCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runHeartbeatCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/heartbeat".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{cancelRequested:t.cancel_requested}})}async runHeartbeatCreate(e,t){let a=await this.runHeartbeatCreateRaw(e,t);return await a.value()}async runListRaw(e,t){let a={};null!=e.agent&&(a.agent=e.agent),null!=e.attack&&(a.attack=e.attack),null!=e.campaign&&(a.campaign=e.campaign),null!=e.executor&&(a.executor=e.executor),null!=e.organization&&(a.organization=e.organization),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.parent&&(a.parent=e.parent),null!=e.parentIsnull&&(a.parent__isnull=e.parentIsnull),null!=e.status&&(a.status=e.status);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(x)}})}async runList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runListRaw(e,t);return await a.value()}async runPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run_notes:e.runNotes,run_config:e.runConfig}}(e.patchedRunUpdateRequest,!1)},t),e=>j(e))}async runPartialUpdate(e,t){let a=await this.runPartialUpdateRaw(e,t);return await a.value()}async runResultCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runResultCreate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling runResultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/result".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async runResultCreate(e,t){let a=await this.runResultCreateRaw(e,t);return await a.value()}async runRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runRetrieve().');let a={};null!=e.includeResults&&(a.include_results=e.includeResults);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>j(e))}async runRetrieve(e,t){let a=await this.runRetrieveRaw(e,t);return await a.value()}}class ea extends r{async secretCreateRaw(e,t){if(null==e.secretWriteRequest)throw new u("secretWriteRequest",'Required parameter "secretWriteRequest" was null or undefined when calling secretCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,value:e.value}}(e.secretWriteRequest,!1)},t),e=>E(e))}async secretCreate(e,t){let a=await this.secretCreateRaw(e,t);return await a.value()}async secretDestroyRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"DELETE",headers:a,query:{}},t),e=>(function(e,t){var a;if(null==e)return e;return{referencedBy:(a=e.referenced_by,null==a?a:{agents:a.agents,campaigns:a.campaigns})}})(e,0))}async secretDestroy(e,t){let a=await this.secretDestroyRaw(e,t);return await a.value()}async secretListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(E)}})}async secretList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.secretListRaw(e,t);return await a.value()}async secretUpdateRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretUpdate().');if(null==e.secretValueRequest)throw new u("secretValueRequest",'Required parameter "secretValueRequest" was null or undefined when calling secretUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"PUT",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{value:e.value}}(e.secretValueRequest,!1)},t),e=>E(e))}async secretUpdate(e,t){let a=await this.secretUpdateRaw(e,t);return await a.value()}}class en extends r{async userCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"POST",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userCreateRaw(e,t);return await a.value()}async userDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async userDestroy(e,t){await this.userDestroyRaw(e,t)}async userListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(L)}})}async userList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userListRaw(e,t);return await a.value()}async userMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/user/me",method:"GET",headers:t,query:{}},e),e=>L(e))}async userMeRetrieve(e){let t=await this.userMeRetrieveRaw(e);return await t.value()}async userMeUpdateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/me",method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userMeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userMeUpdateRaw(e,t);return await a.value()}async userPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}(e.patchedUserProfileRequest,!1)},t),e=>L(e))}async userPartialUpdate(e,t){let a=await this.userPartialUpdateRaw(e,t);return await a.value()}async userRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>L(e))}async userRetrieve(e,t){let a=await this.userRetrieveRaw(e,t);return await a.value()}async userUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userUpdate(e,t){let a=await this.userUpdateRaw(e,t);return await a.value()}}},41444:(e,t,a)=>{a.d(t,{h:()=>o});var n=a(65727);let i=a.n(n)()({level:"info",browser:{asObject:!1,write:{debug:e=>!1,info:e=>console.info(e),warn:e=>console.warn(e),error:e=>console.error(e)}},redact:{paths:["token","password","authorization","apiKey","api_key","wallet.address","user.wallet.address","privateKey","private_key"],censor:"[REDACTED]"}}),o=e=>i.child({module:e})},64269:(e,t,a)=>{a.d(t,{cn:()=>o});var n=a(2821),i=a(75889);function o(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,n.$)(t))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[924],{3998:(e,t,a)=>{a.d(t,{$:()=>c,r:()=>s});var n=a(95155);a(12115);var i=a(32467),o=a(83101),r=a(64269);let s=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:a,size:o,asChild:c=!1,...u}=e,l=c?i.DX:"button";return(0,n.jsx)(l,{"data-slot":"button",className:(0,r.cn)(s({variant:a,size:o,className:t})),...u})}},7831:(e,t,a)=>{a.d(t,{Bm:()=>k,DR:()=>c,Ft:()=>y,Iu:()=>w,KC:()=>p,ME:()=>l,gb:()=>g,in:()=>u,ki:()=>r,nu:()=>T,ui:()=>h,userApi:()=>f,vm:()=>d});var n=a(38775);let i=(0,a(41444).h)("apiClient"),o=null;function r(e){o=e,i.debug(e?"Access token set":"Access token cleared")}let s=async()=>(o||i.debug("No access token available."),o),c=new n.Vk6({basePath:"/api/proxy",middleware:[{pre:async e=>{i.debug("Running pre-request middleware...");let t=await s();t?(i.debug("Token found, adding Authorization header."),e.init.headers={...e.init.headers,Authorization:"Bearer ".concat(t)}):i.warn("No token found, Authorization header not added.")},post:async e=>{let t=e.response.headers.get("content-type");if(!e.response.ok&&t&&!t.includes("application/json")){let a=await e.response.text();throw i.error({status:e.response.status,contentType:t,preview:a.substring(0,200)},"API returned non-JSON response"),Error("API error ".concat(e.response.status,": Server returned ").concat(t," instead of JSON. Check API endpoint and CORS configuration."))}}}]}),u=new n.cwn(c),l=new n.uzR(c),h=new n.cdi(c),d=new n.Lev(c),g=new n.At2(c),f=new n.ipj(c),w=new n.UYx(c),p=new n.OgW(c),T=new n.XoK(c),k=new n.jhh(c),y=new n.ZLz(c)},38775:(e,t,a)=>{a.d(t,{cwn:()=>F,OgW:()=>H,Lev:()=>V,jhh:()=>$,Vk6:()=>i,XoK:()=>X,on2:()=>C,At2:()=>Y,UYx:()=>Z,o3e:()=>s,cdi:()=>Q,v3H:()=>ee,uzR:()=>et,qjb:()=>q,isU:()=>x,ZLz:()=>ea,S5d:()=>v,Esj:()=>z,ipj:()=>en,JlS:()=>U});let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(n=>(function t(a,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=i+(i.length?"[".concat(a,"]"):a);if(n instanceof Array){let e=n.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(o),"="));return"".concat(encodeURIComponent(o),"=").concat(e)}return n instanceof Set?t(a,Array.from(n),i):n instanceof Date?"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(n.toISOString())):n instanceof Object?e(n,o):"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(String(n)))})(n,t[n],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){this.configuration=e}}let o=new i;class r{withMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({pre:e}));return this.withMiddleware(...n)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({post:e}));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&r.jsonRegex.test(e)}async request(e,t){let{url:a,init:n}=await this.createFetchParams(e,t),i=await this.fetchApi(a,n);if(i&&i.status>=200&&i.status<300)return i;throw new s(i,"Response returned an error code")}async createFetchParams(e,t){var a,n;let i,o=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(o+="?"+this.configuration.queryParamsStringify(e.query));let r=Object.assign({},this.configuration.headers,e.headers);Object.keys(r).forEach(e=>void 0===r[e]?delete r[e]:{});let s={method:e.method,headers:r,body:e.body,credentials:this.configuration.credentials},c={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=c.body,i="undefined"!=typeof FormData&&a instanceof FormData||c.body instanceof URLSearchParams||(n=c.body,"undefined"!=typeof Blob&&n instanceof Blob)?c.body:this.isJsonMime(r["Content-Type"])?JSON.stringify(c.body):c.body,{url:o,init:{...c,body:i}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=o){this.configuration=e,this.fetchApi=async(e,t)=>{let a,n={url:e,init:t};for(let e of this.middleware)e.pre&&(n=await e.pre({fetch:this.fetchApi,...n})||n);try{a=await (this.configuration.fetchApi||fetch)(n.url,n.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new c(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:n.url,init:n.init,response:a.clone()})||a);return a},this.middleware=e.middleware}}r.jsonRegex=RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");class s extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class c extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class u extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}class l{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){this.raw=e,this.transformer=t}}class h{async value(){}constructor(e){this.raw=e}}function d(e){var t;return null==(t=e)?t:{id:t.id,timestamp:new Date(t.timestamp),apiKeyPrefix:t.api_key_prefix,userUsername:t.user_username,organizationName:t.organization_name,modelIdUsed:t.model_id_used,apiEndpoint:t.api_endpoint,inputTokens:t.input_tokens,outputTokens:t.output_tokens,creditsDeducted:t.credits_deducted,requestPayloadPreview:t.request_payload_preview,responsePayloadPreview:t.response_payload_preview}}function g(e,t){return null==e?e:{id:e.id,name:e.name}}function f(e,t){return null==e?e:{user:e.user,username:e.username,organization:e.organization}}function w(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,endpoint:t.endpoint,agentType:t.agent_type,description:null==t.description?void 0:t.description,config:t.config,organization:t.organization,organizationDetail:g(t.organization_detail,!1),owner:t.owner,ownerDetail:f(t.owner_detail,!1),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function p(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}function T(e){var t;return null==(t=e)?t:{id:t.id,type:t.type,agent:t.agent,agentName:t.agent_name,owner:t.owner,ownerUsername:t.owner_username,organization:t.organization,organizationName:t.organization_name,_configuration:t.configuration,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function k(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}function y(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,description:null==t.description?void 0:t.description,agent:t.agent,spec:t.spec,organization:t.organization,owner:t.owner,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function m(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}function A(e){var t;return null==(t=e)?t:{name:t.name,description:t.description}}function R(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{claimed_by:e.claimedBy}}let v={Pending:"PENDING",Running:"RUNNING",Completed:"COMPLETED",Failed:"FAILED",Cancelled:"CANCELLED"},q={Cloud:"cloud",Local:"local",Cli:"cli"},z={ToolCall:"TOOL_CALL",ToolResponse:"TOOL_RESPONSE",AgentThought:"AGENT_THOUGHT",AgentResponseChunk:"AGENT_RESPONSE_CHUNK",Other:"OTHER",McpStep:"MCP_STEP",A2AComm:"A2A_COMM"};function _(e){var t,a=e;if(null==a)return a;return{id:a.id,result:a.result,sequence:a.sequence,stepType:null==a.step_type?void 0:(t=a.step_type,t),timestamp:new Date(a.timestamp),content:null==a.content?void 0:a.content}}let C={NotEvaluated:"NOT_EVALUATED",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK",FailedJailbreak:"FAILED_JAILBREAK",ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",PassedCriteria:"PASSED_CRITERIA",FailedCriteria:"FAILED_CRITERIA"};function B(e){var t,a=e;if(null==a)return a;return{id:a.id,run:a.run,runId:a.run_id,requestPayload:null==a.request_payload?void 0:a.request_payload,responseStatusCode:null==a.response_status_code?void 0:a.response_status_code,responseHeaders:null==a.response_headers?void 0:a.response_headers,responseBody:null==a.response_body?void 0:a.response_body,latencyMs:null==a.latency_ms?void 0:a.latency_ms,detectedToolCalls:null==a.detected_tool_calls?void 0:a.detected_tool_calls,evaluationStatus:null==a.evaluation_status?void 0:(t=a.evaluation_status,t),evaluationNotes:null==a.evaluation_notes?void 0:a.evaluation_notes,evaluationMetrics:null==a.evaluation_metrics?void 0:a.evaluation_metrics,agentSpecificData:null==a.agent_specific_data?void 0:a.agent_specific_data,goal:null==a.goal?void 0:a.goal,goalIndex:null==a.goal_index?void 0:a.goal_index,timestamp:new Date(a.timestamp),traces:null==a.traces?void 0:a.traces.map(_)}}function P(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),runToken:null==e.run_token?void 0:e.run_token,env:null==e.env?void 0:e.env}}function I(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),command:null==e.command?void 0:e.command}}function K(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),credits:t.credits,creditsLastUpdated:new Date(t.credits_last_updated)}}function b(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}let U={Jailbroken:"JAILBROKEN",Mitigated:"MITIGATED",Error:"ERROR",Pending:"PENDING"};function S(e){var t,a=e;if(null==a)return a;return{goalIndex:a.goal_index,goal:a.goal,category:a.category,attempts:a.attempts,successfulJailbreaks:a.successful_jailbreaks,failedJailbreaks:a.failed_jailbreaks,errors:a.errors,notEvaluated:a.not_evaluated,verdict:(t=a.verdict,t),bestScore:a.best_score,decidingResult:a.deciding_result,firstTimestamp:new Date(a.first_timestamp),lastTimestamp:new Date(a.last_timestamp)}}function x(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,attackType:n.attack_type,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),totalResults:n.total_results,successfulJailbreaks:n.successful_jailbreaks,failedJailbreaks:n.failed_jailbreaks,errors:n.errors,notEvaluated:n.not_evaluated,totalGoals:n.total_goals,jailbrokenGoals:n.jailbroken_goals}}function E(e){var t;return null==(t=e)?t:{name:t.name,createdByUsername:t.created_by_username,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function D(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,prefix:t.prefix,created:new Date(t.created),revoked:t.revoked,expiryDate:null==t.expiry_date?null:new Date(t.expiry_date),user:t.user,userDetail:f(t.user_detail,!1),organization:t.organization,organizationDetail:g(t.organization_detail,!1)}}function J(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],e}function L(e){var t,a=e;if(null==a)return a;return{id:a.id,user:a.user,username:a.username,email:null==a.email?void 0:a.email,firstName:null==a.first_name?void 0:a.first_name,lastName:null==a.last_name?void 0:a.last_name,organization:a.organization,organizationName:a.organization_name,auth0UserId:a.auth0_user_id,keycloakUserId:a.keycloak_user_id,analyticsConsent:null==a.analytics_consent?void 0:(t=a.analytics_consent,t)}}function W(e){var t;return null==(t=e)?t:{code:t.code,message:t.message,details:t.details}}function O(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}function j(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),results:null==n.results?void 0:n.results.map(B)}}function N(e){var t;return null==(t=e)?t:{key:t.key,label:t.label,type:t.type,_default:t.default,description:t.description,required:t.required,choices:null==t.choices?null:t.choices,min:t.min,max:t.max,section:t.section,advanced:t.advanced}}function G(e){var t;return null==(t=e)?t:{attackType:t.attack_type,label:t.label,description:t.description,category:t.category,categoryLabel:t.category_label,categoryDescription:t.category_description,tags:t.tags,tagLabels:t.tag_labels,primaryOrder:t.primary_order,fields:t.fields.map(N),paramsSchema:t.params_schema,requiredRoles:t.required_roles,optionalRoles:t.optional_roles}}function M(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}class F extends r{async agentCreateRaw(e,t){if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"POST",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentCreate(e,t){let a=await this.agentCreateRaw(e,t);return await a.value()}async agentDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async agentDestroy(e,t){await this.agentDestroyRaw(e,t)}async agentListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(w)}})}async agentList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.agentListRaw(e,t);return await a.value()}async agentPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}(e.patchedAgentRequest,!1)},t),e=>w(e))}async agentPartialUpdate(e,t){let a=await this.agentPartialUpdateRaw(e,t);return await a.value()}async agentRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>w(e))}async agentRetrieve(e,t){let a=await this.agentRetrieveRaw(e,t);return await a.value()}async agentUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentUpdate().');if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentUpdate(e,t){let a=await this.agentUpdateRaw(e,t);return await a.value()}}class H extends r{async apilogsListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(d)}})}async apilogsList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.apilogsListRaw(e,t);return await a.value()}async apilogsRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling apilogsRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>d(e))}async apilogsRetrieve(e,t){let a=await this.apilogsRetrieveRaw(e,t);return await a.value()}async apilogsSummaryRetrieveRaw(e,t){if(null==e.endDate)throw new u("endDate",'Required parameter "endDate" was null or undefined when calling apilogsSummaryRetrieve().');if(null==e.startDate)throw new u("startDate",'Required parameter "startDate" was null or undefined when calling apilogsSummaryRetrieve().');let a={};null!=e.byKey&&(a.by_key=e.byKey),null!=e.endDate&&(a.end_date=e.endDate.toISOString().substring(0,10)),null!=e.startDate&&(a.start_date=e.startDate.toISOString().substring(0,10)),null!=e.tz&&(a.tz=e.tz);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/summary",method:"GET",headers:n,query:a},t),e=>d(e))}async apilogsSummaryRetrieve(e,t){let a=await this.apilogsSummaryRetrieveRaw(e,t);return await a.value()}}class V extends r{async attackCreateRaw(e,t){if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"POST",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackCreate(e,t){let a=await this.attackCreateRaw(e,t);return await a.value()}async attackDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async attackDestroy(e,t){await this.attackDestroyRaw(e,t)}async attackListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(T)}})}async attackList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.attackListRaw(e,t);return await a.value()}async attackPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}(e.patchedAttackRequest,!1)},t),e=>T(e))}async attackPartialUpdate(e,t){let a=await this.attackPartialUpdateRaw(e,t);return await a.value()}async attackRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>T(e))}async attackRetrieve(e,t){let a=await this.attackRetrieveRaw(e,t);return await a.value()}async attackUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackUpdate().');if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackUpdate(e,t){let a=await this.attackUpdateRaw(e,t);return await a.value()}}class $ extends r{async campaignCreateRaw(e,t){if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"POST",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignCreate(e,t){let a=await this.campaignCreateRaw(e,t);return await a.value()}async campaignDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async campaignDestroy(e,t){await this.campaignDestroyRaw(e,t)}async campaignLaunchAdhocRaw(e,t){if(null==e.adhocLaunchRequest)throw new u("adhocLaunchRequest",'Required parameter "adhocLaunchRequest" was null or undefined when calling campaignLaunchAdhoc().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/launch",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec,executor:e.executor}}(e.adhocLaunchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchAdhoc(e,t){let a=await this.campaignLaunchAdhocRaw(e,t);return await a.value()}async campaignLaunchCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignLaunchCreate().');if(null==e.launchRequest)throw new u("launchRequest",'Required parameter "launchRequest" was null or undefined when calling campaignLaunchCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/launch".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{executor:e.executor}}(e.launchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchCreate(e,t){let a=await this.campaignLaunchCreateRaw(e,t);return await a.value()}async campaignListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(y)}})}async campaignList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.campaignListRaw(e,t);return await a.value()}async campaignPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}(e.patchedCampaignRequest,!1)},t),e=>y(e))}async campaignPartialUpdate(e,t){let a=await this.campaignPartialUpdateRaw(e,t);return await a.value()}async campaignPreflightRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPreflightRetrieve().');let a={};null!=e.executor&&(a.executor=e.executor);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/preflight".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>(function(e,t){var a;if(null==e)return e;return{executor:(a=e.executor,a),ok:e.ok,problems:e.problems.map(W)}})(e,0))}async campaignPreflightRetrieve(e,t){let a=await this.campaignPreflightRetrieveRaw(e,t);return await a.value()}async campaignRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>y(e))}async campaignRetrieve(e,t){let a=await this.campaignRetrieveRaw(e,t);return await a.value()}async campaignSchemaRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/schema",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{schema:t.schema,datasetPresets:t.dataset_presets.map(A)}})}async campaignSchemaRetrieve(e){let t=await this.campaignSchemaRetrieveRaw(e);return await t.value()}async campaignStartCreateRaw(e,t){if(null==e.campaignStartRequest)throw new u("campaignStartRequest",'Required parameter "campaignStartRequest" was null or undefined when calling campaignStartCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/start",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,spec:e.spec,claimed_by:e.claimedBy}}(e.campaignStartRequest,!1)},t),e=>j(e))}async campaignStartCreate(e,t){let a=await this.campaignStartCreateRaw(e,t);return await a.value()}async campaignTechniquesListRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/techniques",method:"GET",headers:t,query:{}},e),e=>e.map(G))}async campaignTechniquesList(e){let t=await this.campaignTechniquesListRaw(e);return await t.value()}async campaignUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignUpdate().');if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignUpdate(e,t){let a=await this.campaignUpdateRaw(e,t);return await a.value()}}class X extends r{async creditsRequestCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/credits/request",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{amount:e.amount,reason:e.reason}}(e.creditRequestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{status:t.status}})}async creditsRequestCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.creditsRequestCreateRaw(e,t);return await a.value()}}class Y extends r{async keyContextRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/key/context",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,username:null==t.username?void 0:t.username,organizationId:null==t.organization_id?void 0:t.organization_id,organizationName:null==t.organization_name?void 0:t.organization_name}})}async keyContextRetrieve(e){let t=await this.keyContextRetrieveRaw(e);return await t.value()}async keyCreateRaw(e,t){if(null==e.userAPIKeyRequest)throw new u("userAPIKeyRequest",'Required parameter "userAPIKeyRequest" was null or undefined when calling keyCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,key:e.key}}(e.userAPIKeyRequest,!1)},t),e=>D(e))}async keyCreate(e,t){let a=await this.keyCreateRaw(e,t);return await a.value()}async keyDestroyRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"DELETE",headers:a,query:{}},t))}async keyDestroy(e,t){await this.keyDestroyRaw(e,t)}async keyListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(D)}})}async keyList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.keyListRaw(e,t);return await a.value()}async keyRetrieveRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"GET",headers:a,query:{}},t),e=>D(e))}async keyRetrieve(e,t){let a=await this.keyRetrieveRaw(e,t);return await a.value()}}class Z extends r{async organizationCreateRaw(e,t){if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"POST",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationCreate(e,t){let a=await this.organizationCreateRaw(e,t);return await a.value()}async organizationDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async organizationDestroy(e,t){await this.organizationDestroyRaw(e,t)}async organizationListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(K)}})}async organizationList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.organizationListRaw(e,t);return await a.value()}async organizationMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/organization/me",method:"GET",headers:t,query:{}},e),e=>K(e))}async organizationMeRetrieve(e){let t=await this.organizationMeRetrieveRaw(e);return await t.value()}async organizationPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}(e.patchedOrganizationRequest,!1)},t),e=>K(e))}async organizationPartialUpdate(e,t){let a=await this.organizationPartialUpdateRaw(e,t);return await a.value()}async organizationRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>K(e))}async organizationRetrieve(e,t){let a=await this.organizationRetrieveRaw(e,t);return await a.value()}async organizationUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationUpdate().');if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationUpdate(e,t){let a=await this.organizationUpdateRaw(e,t);return await a.value()}}class Q extends r{async resultCreateRaw(e,t){if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultCreate(e,t){let a=await this.resultCreateRaw(e,t);return await a.value()}async resultDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async resultDestroy(e,t){await this.resultDestroyRaw(e,t)}async resultListRaw(e,t){let a={};null!=e.evaluationStatus&&(a.evaluation_status=e.evaluationStatus),null!=e.goalIndex&&(a.goal_index=e.goalIndex),null!=e.includeTraces&&(a.include_traces=e.includeTraces),null!=e.ordering&&(a.ordering=e.ordering),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.run&&(a.run=e.run),null!=e.runOrganization&&(a.run__organization=e.runOrganization);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(B)}})}async resultList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.resultListRaw(e,t);return await a.value()}async resultPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}(e.patchedResultRequest,!1)},t),e=>B(e))}async resultPartialUpdate(e,t){let a=await this.resultPartialUpdateRaw(e,t);return await a.value()}async resultRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>B(e))}async resultRetrieve(e,t){let a=await this.resultRetrieveRaw(e,t);return await a.value()}async resultTraceCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultTraceCreate().');if(null==e.traceRequest)throw new u("traceRequest",'Required parameter "traceRequest" was null or undefined when calling resultTraceCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}/trace".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{sequence:e.sequence,step_type:e.stepType,content:e.content}}(e.traceRequest,!1)},t),e=>_(e))}async resultTraceCreate(e,t){let a=await this.resultTraceCreateRaw(e,t);return await a.value()}async resultUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultUpdate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultUpdate(e,t){let a=await this.resultUpdateRaw(e,t);return await a.value()}}let ee={ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",FailedCriteria:"FAILED_CRITERIA",FailedJailbreak:"FAILED_JAILBREAK",NotEvaluated:"NOT_EVALUATED",PassedCriteria:"PASSED_CRITERIA",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK"};class et extends r{async runCancelCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runCancelCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/cancel".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>j(e))}async runCancelCreate(e,t){let a=await this.runCancelCreateRaw(e,t);return await a.value()}async runChildrenCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runChildrenCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/children".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{attack:e.attack,agent:e.agent,run_config:e.runConfig}}(e.childRunRequest,!1)},t),e=>j(e))}async runChildrenCreate(e,t){let a=await this.runChildrenCreateRaw(e,t);return await a.value()}async runClaimCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runClaimCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/claim".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimCreate(e,t){let a=await this.runClaimCreateRaw(e,t);return await a.value()}async runClaimNextCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/claim-next",method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimNextCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runClaimNextCreateRaw(e,t);switch(a.raw.status){case 200:default:return await a.value();case 204:return null}}async runDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async runDestroy(e,t){await this.runDestroyRaw(e,t)}async runFinishCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runFinishCreate().');if(null==e.finishRequest)throw new u("finishRequest",'Required parameter "finishRequest" was null or undefined when calling runFinishCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/finish".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{status:e.status,note:e.note}}(e.finishRequest,!1)},t),e=>j(e))}async runFinishCreate(e,t){let a=await this.runFinishCreateRaw(e,t);return await a.value()}async runGoalsListRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runGoalsList().');let a={};null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/goals".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(S)}})}async runGoalsList(e,t){let a=await this.runGoalsListRaw(e,t);return await a.value()}async runHeartbeatCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runHeartbeatCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/heartbeat".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{cancelRequested:t.cancel_requested}})}async runHeartbeatCreate(e,t){let a=await this.runHeartbeatCreateRaw(e,t);return await a.value()}async runListRaw(e,t){let a={};null!=e.agent&&(a.agent=e.agent),null!=e.attack&&(a.attack=e.attack),null!=e.campaign&&(a.campaign=e.campaign),null!=e.executor&&(a.executor=e.executor),null!=e.organization&&(a.organization=e.organization),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.parent&&(a.parent=e.parent),null!=e.parentIsnull&&(a.parent__isnull=e.parentIsnull),null!=e.status&&(a.status=e.status);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(x)}})}async runList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runListRaw(e,t);return await a.value()}async runPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run_notes:e.runNotes,run_config:e.runConfig}}(e.patchedRunUpdateRequest,!1)},t),e=>j(e))}async runPartialUpdate(e,t){let a=await this.runPartialUpdateRaw(e,t);return await a.value()}async runResultCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runResultCreate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling runResultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/result".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async runResultCreate(e,t){let a=await this.runResultCreateRaw(e,t);return await a.value()}async runRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runRetrieve().');let a={};null!=e.includeResults&&(a.include_results=e.includeResults);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>j(e))}async runRetrieve(e,t){let a=await this.runRetrieveRaw(e,t);return await a.value()}}class ea extends r{async secretCreateRaw(e,t){if(null==e.secretWriteRequest)throw new u("secretWriteRequest",'Required parameter "secretWriteRequest" was null or undefined when calling secretCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,value:e.value}}(e.secretWriteRequest,!1)},t),e=>E(e))}async secretCreate(e,t){let a=await this.secretCreateRaw(e,t);return await a.value()}async secretDestroyRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"DELETE",headers:a,query:{}},t),e=>(function(e,t){var a;if(null==e)return e;return{referencedBy:(a=e.referenced_by,null==a?a:{agents:a.agents,campaigns:a.campaigns})}})(e,0))}async secretDestroy(e,t){let a=await this.secretDestroyRaw(e,t);return await a.value()}async secretListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(E)}})}async secretList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.secretListRaw(e,t);return await a.value()}async secretUpdateRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretUpdate().');if(null==e.secretValueRequest)throw new u("secretValueRequest",'Required parameter "secretValueRequest" was null or undefined when calling secretUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"PUT",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{value:e.value}}(e.secretValueRequest,!1)},t),e=>E(e))}async secretUpdate(e,t){let a=await this.secretUpdateRaw(e,t);return await a.value()}}class en extends r{async userCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"POST",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userCreateRaw(e,t);return await a.value()}async userDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async userDestroy(e,t){await this.userDestroyRaw(e,t)}async userListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(L)}})}async userList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userListRaw(e,t);return await a.value()}async userMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/user/me",method:"GET",headers:t,query:{}},e),e=>L(e))}async userMeRetrieve(e){let t=await this.userMeRetrieveRaw(e);return await t.value()}async userMeUpdateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/me",method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userMeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userMeUpdateRaw(e,t);return await a.value()}async userPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}(e.patchedUserProfileRequest,!1)},t),e=>L(e))}async userPartialUpdate(e,t){let a=await this.userPartialUpdateRaw(e,t);return await a.value()}async userRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>L(e))}async userRetrieve(e,t){let a=await this.userRetrieveRaw(e,t);return await a.value()}async userUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userUpdate(e,t){let a=await this.userUpdateRaw(e,t);return await a.value()}}},41444:(e,t,a)=>{a.d(t,{h:()=>o});var n=a(65727);let i=a.n(n)()({level:"info",browser:{asObject:!1,write:{debug:e=>!1,info:e=>console.info(e),warn:e=>console.warn(e),error:e=>console.error(e)}},redact:{paths:["token","password","authorization","apiKey","api_key","wallet.address","user.wallet.address","privateKey","private_key"],censor:"[REDACTED]"}}),o=e=>i.child({module:e})},64269:(e,t,a)=>{a.d(t,{cn:()=>o});var n=a(2821),i=a(75889);function o(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,n.$)(t))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{3730:(e,t,n)=>{"use strict";n.d(t,{Ke:()=>i,Nt:()=>s,R6:()=>r});var a=n(49578);let s=a.bL,r=a.R6,i=a.Ke},34105:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});let a=(0,n(12115).createContext)(void 0)},39166:(e,t,n)=>{"use strict";n.d(t,{j:()=>i,w:()=>a});let a=["OPENAI","LITELLM","OLLAMA"],s={kind:"anywhere",label:"Launchable"},r="Endpoint is a local address";function i(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=function(e){let t=e.config;if("object"!=typeof t||null===t)return null;let n=t.connection;return"object"==typeof n&&null!==n?n:null}(e);if(!i)return{kind:"unsupported",label:"Not launchable from the dashboard yet",reason:"This agent has no model configuration yet. Edit and save it on the Agents page."};let l=String(null!=(t=i.type)?t:"");if(!a.includes(l))return{kind:"unsupported",label:"Not launchable from the dashboard yet",reason:"Only OpenAI, LiteLLM and Ollama agents can be launched from the dashboard."};let o="string"==typeof i.endpoint?i.endpoint.trim():"";if(!o)return"OLLAMA"!==l||n?s:{kind:"local",label:"Local network",reason:"".concat(r," (defaults to localhost)")};let d=function(e){try{return new URL(e.includes("://")?e:"http://".concat(e)).hostname.toLowerCase().replace(/\.$/,"").replace(/^\[(.*)\]$/,"$1")}catch(e){return null}}(o);if(!d)return{kind:"local",label:"Local network",reason:"Endpoint is not a valid URL"};let c=n?null:function(e){if("localhost"===e||e.endsWith(".localhost")||e.endsWith(".local")||"::1"===e)return r;let t=function(e){let t=e.split(".");if(4!==t.length||!t.every(e=>/^\d{1,3}$/.test(e)))return null;let n=t.map(Number);return n.every(e=>e<=255)?n:null}(e);if(!t)return null;let[n,a]=t;return 127===n?r:10===n||172===n&&a>=16&&a<=31||192===n&&168===a?"Endpoint is a private network address":null}(d);return c?{kind:"local",label:"Local network",reason:c}:s}},46056:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>X});var a=n(95155),s=n(12115),r=n(80230),i=n(7831),l=n(41444),o=n(22470),d=n(56419),c=n(35835),u=n(24033),m=n(71360),h=n(6191),p=n(35299),g=n(38775),x=n(74672),f=n(3998),j=n(3730),v=n(51834),y=n(65142),N=n(76444),b=n(39166),A=n(1088),C=n(25733);let k={OPENAI:"OpenAI",LITELLM:"LiteLLM",OLLAMA:"Ollama",GOOGLE_ADK:"Google ADK",CLAUDE_CODE:"Claude Code",CODEX:"Codex",HERMES:"Hermes",WEB:"Web",LANGCHAIN:"LangChain",MCP:"MCP",A2A:"A2A",UNKNOWN:"Unknown"},w=[...b.w.map(e=>({value:e,label:k[e],launchable:!0})),...["GOOGLE_ADK","CLAUDE_CODE","CODEX","HERMES","WEB","LANGCHAIN","MCP","A2A","UNKNOWN"].map(e=>({value:e,label:"".concat(k[e]," ").concat("(dashboard launch not available yet)"),launchable:!1}))],E="__add_secret__",L="flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";function O(e){return"object"!=typeof e||null===e||Array.isArray(e)?{}:e}function S(e){return"string"==typeof e?e:""}function I(e){return Array.isArray(e)?e.join(" "):String(e)}let _=/(?:^|[^a-z])(?:[a-z]*key|token|secret|password|passwd|auth|authorization|cookie|credentials?|signature|session)(?:$|[^a-z])/;function D(e){var t,n,a,s;let r=O(null==e?void 0:e.config),i=O(r.connection),l=Object.entries(O(i.headers)).filter(e=>{let[,t]=e;return"string"==typeof t}).map(e=>{let[t,n]=e;return{key:t,value:n}});return{name:null!=(t=null==e?void 0:e.name)?t:"",description:null!=(n=null==e?void 0:e.description)?n:"",type:"OPENAI_SDK"===(s=S(i.type)||(null==e?void 0:e.agentType)||"OPENAI")?"OPENAI":s,model:S(r.name),endpoint:S(i.endpoint)||((null==e?void 0:e.config)?"":null!=(a=null==e?void 0:e.endpoint)?a:""),secret:(0,A.rR)(i.api_key),timeout:null==i.timeout?"":String(i.timeout),headers:l}}async function P(e){if(!(e instanceof g.o3e))return{status:null,body:null};let t=null;try{t=await e.response.json()}catch(e){}return{status:e.response.status,body:t}}function z(e){let{message:t}=e;return t?(0,a.jsx)("p",{className:"text-xs text-destructive",children:t}):null}function T(e){var t;let{open:n,onOpenChange:r,agent:l,onSaved:o}=e,[d,c]=(0,s.useState)(()=>D(l)),[g,b]=(0,s.useState)(!1),[k,S]=(0,s.useState)({}),[T,M]=(0,s.useState)(null),[F,$]=(0,s.useState)(!1),[U,K]=(0,s.useState)([]),[R,H]=(0,s.useState)(null),[W,G]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!n)return;let e=D(l);c(e),b(!!e.secret),S({}),M(null),H(null),J(!1)},[n,l]),(0,s.useEffect)(()=>{if(!n)return;let e=!0;return(0,C.i)(e=>i.Ft.secretList({page:e})).then(t=>e&&K(t.map(e=>e.name))).catch(()=>e&&H("Could not load secrets.")),()=>{e=!1}},[n]);let X=(e,t)=>c(n=>({...n,[e]:t})),B="OLLAMA"===d.type,Z=d.secret&&!U.includes(d.secret)?[...U,d.secret]:U,Q=e=>{S(e),(e.timeout||e.headers)&&J(!0)},V=async()=>{let e=(()=>{let e={};d.name.trim()||(e.name="Name is required."),d.model.trim()||(e.model="Model is required."),B&&!d.endpoint.trim()&&(e.endpoint="Endpoint is required for Ollama."),g&&!d.secret&&(e.auth="Select a secret or choose None."),d.timeout.trim()&&!(Number(d.timeout)>0)&&(e.timeout="Timeout must be a positive number.");let t=d.headers.find(e=>e.key.trim()&&function(e){let t=e.trim().toLowerCase();return!t.endsWith("_env")&&_.test(t)}(e.key));return t&&(e.headers="Header ".concat(t.key.trim()," looks like a credential. Store it as a secret and use Authentication → Secret instead.")),e})();if(Q(e),M(null),Object.keys(e).length)return;$(!0);let t={name:d.name.trim(),description:d.description,config:function(e,t){let n={...O(t)},a={...O(n.connection)},s=a.type===e.type;n.name=e.model.trim(),a.type=e.type,s&&a.provider||(a.provider=e.type.toLowerCase());let r=e.endpoint.trim();r?a.endpoint=r:delete a.endpoint,e.secret?a.api_key=(0,A.QO)(e.secret):delete a.api_key;let i=e.headers.filter(e=>e.key.trim()),l={...Object.fromEntries(Object.entries(O(O(n.connection).headers)).filter(e=>{let[,t]=e;return"string"!=typeof t})),...Object.fromEntries(i.map(e=>[e.key.trim(),e.value]))};return Object.keys(l).length?a.headers=l:delete a.headers,e.timeout.trim()?a.timeout=Number(e.timeout):delete a.timeout,n.connection=a,n}({...d,secret:g?d.secret:null},null==l?void 0:l.config)};try{(null==l?void 0:l.id)?await i.in.agentUpdate({id:l.id,agentRequest:t}):await i.in.agentCreate({agentRequest:t}),o()}catch(a){let{status:e,body:t}=await P(a);if(400===e&&t){var n;let e=function(e){let t={},n=[];for(let[a,s]of Object.entries(O(e)))if("name"===a||"description"===a)t[a]=I(s);else if("config"!==a||"object"!=typeof s||null===s||Array.isArray(s))n.push("".concat(a,": ").concat(I(s)));else for(let[e,a]of Object.entries(s)){let s="name"===e?"model":"connection.endpoint"===e?"endpoint":"connection.api_key"===e?"auth":"connection.timeout"===e?"timeout":e.startsWith("connection.headers")?"headers":null;s?t[s]=I(a):n.push("".concat(e,": ").concat(I(a)))}return{fields:t,general:n.length?n.join("; "):null}}(t);Q(e.fields);let a=Object.keys(e.fields).length>0;M(null!=(n=e.general)?n:a?null:"Could not save the agent (HTTP 400).")}else M(e?"Could not save the agent (HTTP ".concat(e,")."):"Could not save the agent.")}finally{$(!1)}},Y=(e,t)=>X("headers",d.headers.map((n,a)=>a===e?{...n,...t}:n));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.lG,{open:n,onOpenChange:r,children:(0,a.jsxs)(v.Cf,{className:"sm:max-w-[520px] max-h-[90vh] overflow-y-auto",children:[(0,a.jsxs)(v.c7,{children:[(0,a.jsx)(v.L3,{children:l?"Edit Agent":"Create New Agent"}),(0,a.jsx)(v.rr,{children:l?(0,a.jsxs)(a.Fragment,{children:["Update the details for ",(0,a.jsx)("strong",{children:l.name}),"."]}):"Configure a model or agent for security testing."})]}),(0,a.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(N.J,{htmlFor:"agent-name",children:["Name ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(y.p,{id:"agent-name",value:d.name,onChange:e=>X("name",e.target.value)}),(0,a.jsx)(z,{message:k.name})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(N.J,{htmlFor:"agent-description",children:"Description"}),(0,a.jsx)("textarea",{id:"agent-description",value:d.description,onChange:e=>X("description",e.target.value),rows:2,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none"}),(0,a.jsx)(z,{message:k.description})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(N.J,{htmlFor:"agent-type",children:"Type"}),(0,a.jsx)("select",{id:"agent-type",className:L,value:d.type,onChange:e=>X("type",e.target.value),children:w.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(N.J,{htmlFor:"agent-model",children:["Model ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(y.p,{id:"agent-model",value:d.model,onChange:e=>X("model",e.target.value),placeholder:"gpt-4o-mini",className:"font-mono text-sm"}),(0,a.jsx)(z,{message:k.model})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(N.J,{htmlFor:"agent-endpoint",children:["Endpoint ",B&&(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(y.p,{id:"agent-endpoint",value:d.endpoint,onChange:e=>X("endpoint",e.target.value),placeholder:"OLLAMA"===d.type?"http://localhost:11434":"https://api.example.com/v1",className:"font-mono text-sm"}),"OPENAI"===d.type&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave empty to use the OpenAI API"}),(0,a.jsx)(z,{message:k.endpoint})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(N.J,{htmlFor:"agent-auth",children:"Authentication"}),(0,a.jsxs)("select",{id:"agent-auth",className:L,value:g?"secret":"none",onChange:e=>{b("secret"===e.target.value),"secret"!==e.target.value&&X("secret",null)},children:[(0,a.jsx)("option",{value:"none",children:"None"}),(0,a.jsx)("option",{value:"secret",children:"Secret"})]}),g&&(0,a.jsxs)("select",{"aria-label":"Secret",className:L,value:null!=(t=d.secret)?t:"",onChange:e=>e.target.value===E?G(!0):X("secret",e.target.value),children:[(0,a.jsx)("option",{value:"",disabled:!0,children:"Select a secret"}),Z.map(e=>(0,a.jsx)("option",{value:e,children:e},e)),(0,a.jsx)("option",{value:E,children:"Add secret…"})]}),R&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:R}),(0,a.jsx)(z,{message:k.auth})]}),(0,a.jsxs)(j.Nt,{open:q,onOpenChange:J,children:[(0,a.jsxs)(j.R6,{className:"flex items-center gap-1 text-sm font-medium",children:[(0,a.jsx)(u.A,{className:"h-4 w-4"})," Advanced"]}),(0,a.jsxs)(j.Ke,{className:"grid gap-4 pt-3",children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(N.J,{htmlFor:"agent-timeout",children:"Timeout (seconds)"}),(0,a.jsx)(y.p,{id:"agent-timeout",type:"number",min:1,value:d.timeout,onChange:e=>X("timeout",e.target.value)}),(0,a.jsx)(z,{message:k.timeout})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(N.J,{children:"Headers"}),d.headers.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(y.p,{"aria-label":"Header name ".concat(t+1),value:e.key,onChange:e=>Y(t,{key:e.target.value}),placeholder:"Name"}),(0,a.jsx)(y.p,{"aria-label":"Header value ".concat(t+1),value:e.value,onChange:e=>Y(t,{value:e.target.value}),placeholder:"Value"}),(0,a.jsx)(f.$,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove header ".concat(t+1),onClick:()=>X("headers",d.headers.filter((e,n)=>n!==t)),children:(0,a.jsx)(m.A,{className:"h-4 w-4"})})]},t)),(0,a.jsxs)(f.$,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>X("headers",[...d.headers,{key:"",value:""}]),children:[(0,a.jsx)(h.A,{className:"mr-1 h-4 w-4"})," Add header"]}),(0,a.jsx)(z,{message:k.headers})]})]})]}),T&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:T})]}),(0,a.jsxs)(v.Es,{children:[(0,a.jsx)(f.$,{variant:"outline",disabled:F,onClick:()=>r(!1),children:"Cancel"}),(0,a.jsxs)(f.$,{onClick:V,disabled:F,children:[F&&(0,a.jsx)(p.A,{className:"mr-2 h-4 w-4 animate-spin"}),l?"Save Changes":"Create Agent"]})]})]})}),(0,a.jsx)(x.q,{open:W,onOpenChange:G,onSaved:e=>{K(t=>t.includes(e)?t:[...t,e]),X("secret",e),G(!1)}})]})}var M=n(87270),F=n(20243),$=n(18332),U=n(98053),K=n(50803),R=n(78192),H=n(46826),W=n(18514),G=n(46767);let q={LITELLM:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",OPENAI:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",OLLAMA:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",GOOGLE_ADK:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",UNKNOWN:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"},J=(0,l.h)("AgentsPage");function X(){var e;let{isAuthenticated:t,isLoading:n}=(0,r.h)(),[l,u]=(0,s.useState)([]),[h,g]=(0,s.useState)(!0),[x,j]=(0,s.useState)(null),[v,y]=(0,s.useState)(null),[N,b]=(0,s.useState)({open:!1,title:"",description:""}),[A,C]=(0,s.useState)({open:!1,agent:null}),[w,E]=(0,s.useState)(null),[L,O]=(0,s.useState)(!0),[S,I]=(0,s.useState)(null),[_,D]=(0,s.useState)(!1),[P,z]=(0,s.useState)(null),X=(0,s.useCallback)(async()=>{g(!0),j(null),J.debug("Fetching agents...");try{var e;let t=await i.in.agentList();J.info({count:null==(e=t.results)?void 0:e.length},"Agents fetched successfully"),u(t.results||[])}catch(t){J.error({err:t},"Error fetching agents");let e=t.message||"Failed to load agents. Please try again later.";if(t.response){let n=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}J.error({status:n,responseBody:a},"API Error"),e=403===n?"Forbidden: Check your permissions.":401===n?"Unauthorized: Please log in again.":"API Error (".concat(n,"): ").concat(a||e)}j(e),u([])}finally{g(!1)}},[]);(0,s.useEffect)(()=>{(async()=>{if(!n&&t){O(!0),I(null);try{J.debug("Fetching user profile via /user/me...");let e=await i.userApi.userMeRetrieve();E(e),J.debug({org:e.organization},"User profile fetched")}catch(t){J.error({err:t},"Error fetching user profile");let e=t.message||"Failed to load user profile.";if(t.response){let n=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}e="Profile API Error (".concat(n,"): ").concat(a||e)}I(e)}finally{O(!1)}}})()},[n,t]);let B=()=>L?void b({open:!0,title:"Please Wait",description:"User profile is still loading. Please wait a moment."}):!S&&(null==w?void 0:w.organization)?void(z(null),D(!0)):void b({open:!0,title:"Organization Error",description:"Cannot create agent: Organization ID not found. ".concat(S||"Organization ID missing from profile.")}),Z=e=>{if(!e.id)return void b({open:!0,title:"Invalid Agent",description:"Cannot edit agent: ID is missing."});z(e),D(!0)},Q=async()=>{let e=A.agent;if(!(null==e?void 0:e.id))return;let t=e.id;C({open:!1,agent:null}),y(t);try{await i.in.agentDestroy({id:t}),J.info({agentId:t},"Agent deleted successfully"),u(e=>e.filter(e=>e.id!==t))}catch(n){J.error({err:n},"Error deleting agent");let t=n.message||'Failed to delete agent "'.concat(e.name,'". Please try again.');if(n.response){let e=n.response.status,a="Could not read error body";try{a=await n.response.text()}catch(e){}J.error({status:e,responseBody:a},"Delete API Error"),t="Delete API Error (".concat(e,"): ").concat(a||t)}b({open:!0,title:"Error Deleting Agent",description:t})}finally{y(null)}};return((0,s.useEffect)(()=>{!n&&t?X():n||t||(g(!1),u([]),j(null),y(null))},[n,t,X]),n||h&&0===l.length&&!x||L)?(0,a.jsx)(o.M,{title:"Agents",description:"Configure and monitor your AI agents for security testing.",children:(0,a.jsx)("div",{className:"px-6 space-y-3",children:[void 0,void 0,void 0].map((e,t)=>(0,a.jsxs)("div",{className:"border rounded-lg p-4 flex items-start gap-4",children:[(0,a.jsx)(F.E,{className:"h-10 w-10 rounded-md flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsx)(F.E,{className:"h-4 w-1/4"}),(0,a.jsx)(F.E,{className:"h-3 w-1/2"})]}),(0,a.jsx)(F.E,{className:"h-6 w-20 rounded-full"}),(0,a.jsx)(F.E,{className:"h-8 w-8 rounded"}),(0,a.jsx)(F.E,{className:"h-8 w-8 rounded"})]},"skeleton-".concat(t)))})}):(0,a.jsxs)(o.M,{title:"Agents",description:"Configure and monitor your AI agents for security testing.",action:t&&(0,a.jsxs)(f.$,{onClick:B,children:[(0,a.jsx)(H.A,{className:"mr-2 h-4 w-4"})," Create Agent"]}),children:[(0,a.jsxs)("div",{className:"px-6 space-y-4",children:[!t&&!n&&(0,a.jsxs)($.Fc,{children:[(0,a.jsx)(K.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Authentication Required"}),(0,a.jsx)($.TN,{children:"Please log in to manage agents."})]}),t&&x&&(0,a.jsxs)($.Fc,{variant:"destructive",children:[(0,a.jsx)(K.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Error Loading Agents"}),(0,a.jsx)($.TN,{children:x})]}),t&&S&&(0,a.jsxs)($.Fc,{variant:"destructive",children:[(0,a.jsx)(K.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Profile Error"}),(0,a.jsxs)($.TN,{children:[S," — Agent creation may not be available."]})]}),t&&!h&&0===l.length&&!x&&(0,a.jsx)(d.p,{icon:R.A,title:"No agents configured",description:"Get started by creating your first AI agent for security testing.",action:(0,a.jsxs)(f.$,{onClick:B,children:[(0,a.jsx)(H.A,{className:"mr-2 h-4 w-4"})," Create Agent"]})}),t&&l.length>0&&(0,a.jsx)(G.Bc,{children:(0,a.jsx)("div",{className:"rounded-lg border overflow-hidden",children:(0,a.jsxs)(M.XI,{children:[(0,a.jsx)(M.A0,{children:(0,a.jsxs)(M.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,a.jsx)(M.nd,{className:"w-[25%] pl-4",children:"Agent"}),(0,a.jsx)(M.nd,{className:"w-[15%]",children:"Model"}),(0,a.jsx)(M.nd,{className:"w-[20%]",children:"Endpoint"}),(0,a.jsx)(M.nd,{className:"w-[15%]",children:"Type"}),(0,a.jsx)(M.nd,{className:"w-[12%]",children:"Created"}),(0,a.jsx)(M.nd,{className:"w-[13%] text-right pr-4",children:"Actions"})]})}),(0,a.jsx)(M.BF,{children:l.map(e=>{var t,n,s,r;return(0,a.jsxs)(M.Hj,{className:"group",children:[(0,a.jsx)(M.nA,{className:"pl-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 h-8 w-8 rounded-md bg-muted flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(R.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm leading-tight",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.description}),(null==(t=e.organizationDetail)?void 0:t.name)&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:e.organizationDetail.name})]})]})}),(0,a.jsx)(M.nA,{children:e.config?(0,a.jsx)("span",{className:"text-sm font-mono",children:function(e){let t=null==e?void 0:e.name;return"string"==typeof t&&t?t:"—"}(e.config)}):(0,a.jsx)("button",{type:"button",onClick:()=>Z(e),className:"text-xs font-medium text-amber-700 dark:text-amber-400 underline-offset-2 hover:underline",children:"Needs configuration"})}),(0,a.jsx)(M.nA,{children:(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate block max-w-[200px] cursor-default",children:e.endpoint||"—"})}),(0,a.jsx)(G.ZI,{side:"bottom",className:"max-w-sm break-all",children:e.endpoint||"No endpoint"})]})}),(0,a.jsx)(M.nA,{children:e.agentType?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ".concat(null!=(n=q[e.agentType])?n:q.UNKNOWN),children:null!=(r=k[s=e.agentType])?r:s}):(0,a.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"—"})}),(0,a.jsx)(M.nA,{children:(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:e.createdAt?new Date(e.createdAt).toLocaleDateString():"—"})}),(0,a.jsx)(M.nA,{className:"text-right pr-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>Z(e),disabled:!!v,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,a.jsx)(W.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(G.ZI,{children:"Edit agent"})]}),(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void b({open:!0,title:"Invalid Agent",description:"Cannot delete agent: ID missing or invalid."});C({open:!0,agent:e})})(e),disabled:!!v,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity ".concat(v===e.id?"text-destructive opacity-100":"hover:text-destructive"),children:v===e.id?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(G.ZI,{children:"Delete agent"})]})]})})]},e.id)})})]})})})]}),(0,a.jsx)(T,{open:_,onOpenChange:D,agent:P,onSaved:()=>{D(!1),z(null),X()}}),(0,a.jsx)(U.Lt,{open:N.open,onOpenChange:e=>b(t=>({...t,open:e})),children:(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:N.title}),(0,a.jsx)(U.$v,{children:N.description})]}),(0,a.jsx)(U.ck,{children:(0,a.jsx)(U.Rx,{onClick:()=>b(e=>({...e,open:!1})),children:"OK"})})]})}),(0,a.jsx)(c.T,{open:A.open,onOpenChange:e=>C(t=>({...t,open:e})),title:"Delete Agent",description:'Are you sure you want to delete "'.concat(null==(e=A.agent)?void 0:e.name,'"? This action cannot be undone.'),onConfirm:Q,confirmText:"Delete",variant:"destructive"})]})}},46767:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>o,m_:()=>l});var a=n(95155);n(12115);var s=n(53583),r=n(64269);function i(e){let{delayDuration:t=0,...n}=e;return(0,a.jsx)(s.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function l(e){let{...t}=e;return(0,a.jsx)(i,{children:(0,a.jsx)(s.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,a.jsx)(s.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:n=0,children:i,...l}=e;return(0,a.jsx)(s.ZL,{children:(0,a.jsxs)(s.UC,{"data-slot":"tooltip-content",sideOffset:n,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[i,(0,a.jsx)(s.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},50952:(e,t,n)=>{Promise.resolve().then(n.bind(n,46056))},80230:(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var a=n(12115),s=n(34105);let r=async()=>"";function i(){let e=(0,a.useContext)(s.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:r}}}},e=>{e.O(0,[133,574,41,583,373,924,634,441,493,358],()=>e(e.s=50952)),_N_E=e.O()}]);
|