Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): point add hook at the hook-filtered entries list

Andy Pavia480ed36eb693
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 0d9b4fadd..22d3cb2cb 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -1968,20 +1968,6 @@ textarea.cu-input {
justify-content: flex-end;
}
-/* Per-agent Guardrails tab: add-built-in control row + removable hook chip. */
-.cu-guardrails-add-row {
- display: flex;
- flex-wrap: wrap;
- gap: var(--cu-space-2);
- align-items: center;
-}
-
-.cu-guardrails-ref-chip {
- display: inline-flex;
- align-items: center;
- gap: var(--cu-space-1);
-}
-
.cu-expandable-row__name,
.cu-installed-plugin__name {
color: var(--cu-text);
diff --git a/control-ui/components/HostGuardrailsSection/index.tsx b/control-ui/components/HostGuardrailsSection/index.tsx
index d501d73c8..b3fe1c91a 100644
--- a/control-ui/components/HostGuardrailsSection/index.tsx
+++ b/control-ui/components/HostGuardrailsSection/index.tsx
@@ -5,10 +5,18 @@ import { useRouter } from 'next/navigation'
import { useConfirmDialog } from '@components/ConfirmDialog'
import { useToast } from '@components/Toast'
import { IconX } from '@components/icons'
+import { GUARDRAIL_ENTRY_TYPE } from '@constants/marketplaceEntryTypes'
import { CONTROL_ROUTES } from '@constants/routes'
import { GUARDRAIL_PHASES, GUARDRAIL_PHASE_LABELS } from './constants'
import type { GuardrailHookRow, HostGuardrails, HostGuardrailsSectionProps } from './types'
+// Add hook lands on the org marketplace entries list, narrowed to guardrail
+// hooks — the unfiltered list mixes in every connector and plugin the org has
+// published, which is not what someone adding a hook is looking for.
+const ADD_HOOK_ROUTE = CONTROL_ROUTES.marketplace.orgEntriesFiltered({
+ type: GUARDRAIL_ENTRY_TYPE,
+})
+
// Every field this section does not edit rides along untouched — dropping
// `builtins` or `limits` here would silently wipe them from the Host spec.
function withHooks(
@@ -89,7 +97,7 @@ export function HostGuardrailsSection({
<button
type="button"
className="cu-btn cu-btn--primary cu-btn--sm"
- onClick={() => router.push(CONTROL_ROUTES.marketplace.orgEntries)}
+ onClick={() => router.push(ADD_HOOK_ROUTE)}
disabled={disabled}
>
Add hook
diff --git a/control-ui/components/__tests__/HostGuardrailsSection.test.tsx b/control-ui/components/__tests__/HostGuardrailsSection.test.tsx
index 9202662c7..c10bc11c5 100644
--- a/control-ui/components/__tests__/HostGuardrailsSection.test.tsx
+++ b/control-ui/components/__tests__/HostGuardrailsSection.test.tsx
@@ -50,7 +50,7 @@ describe('HostGuardrailsSection', () => {
expect(screen.queryByText(/no guardrail hooks on this agent/i)).toBeNull()
})
- it('Add hook goes to the org marketplace entries list', async () => {
+ it('Add hook goes to the org marketplace entries list, filtered to hooks', async () => {
render(
<HostGuardrailsSection
busy={false}
@@ -62,7 +62,7 @@ describe('HostGuardrailsSection', () => {
fireEvent.click(await screen.findByRole('button', { name: 'Add hook' }))
- expect(navigation.push).toHaveBeenCalledWith('/marketplace/org/entries')
+ expect(navigation.push).toHaveBeenCalledWith('/marketplace/org/entries?type=llm-hook')
})
it('clicking a hook opens its guardrail detail page', async () => {
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 314c50b2c..c6b258943 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.445",
+ "version": "0.1.446",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.445",
+ "version": "0.1.446",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-ui/package.json b/control-ui/package.json
index b26a1c932..73e7bf984 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.445",
+ "version": "0.1.446",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",