Skip to content

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

TypeScript

fix(marketplace): mark installed llm-hook entries as installed

Andy Pavia485114a755ca
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 31b8ca7a5..9b40bbd85 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.436",
+ "version": "0.1.437",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.436",
+ "version": "0.1.437",
"dependencies": {
"@clerum/image-policy": "file:../packages/image-policy",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-api/package.json b/control-api/package.json
index c73ab25e9..513de4d55 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.436",
+ "version": "0.1.437",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/routes/admin/registry.ts b/control-api/src/routes/admin/registry.ts
index 50b998b7b..fca5c2ec9 100644
--- a/control-api/src/routes/admin/registry.ts
+++ b/control-api/src/routes/admin/registry.ts
@@ -729,18 +729,24 @@ export async function getInstalledRegistryState(gateway?: K8sGateway): Promise<{
catalogKeys: string[]
serverNames: string[]
recipeKeys: string[]
+ hookKeys: string[]
}> {
- if (!gateway) return { catalogKeys: [], serverNames: [], recipeKeys: [] }
+ if (!gateway) return { catalogKeys: [], serverNames: [], recipeKeys: [], hookKeys: [] }
- const [servers, recipes] = await Promise.all([
+ const [servers, recipes, hooks] = await Promise.all([
gateway.listResource('mcpservers', config.mcpServersNamespace),
// Matches /admin/recipes and the WorkflowRecipe namespace invariant:
// parent WorkflowRecipe CRDs live only in sandbox-recipes.
gateway.listResource('workflowrecipes', config.sandboxNamespace),
+ // Installed guardrail hooks (LlmHook CRs) live in the llm-hooks namespace
+ // and carry the same catalog-id/version annotations the install-hook saga
+ // stamps, so the marketplace can render them as installed (§8.5).
+ gateway.listResource('llmhooks', config.llmHooksNamespace),
])
const catalogKeys = new Set<string>()
const serverNames = new Set<string>()
const recipeKeys = new Set<string>()
+ const hookKeys = new Set<string>()
// catalog-id / catalog-version live in ANNOTATIONS (org-scoped names contain
// '@' and '/', illegal as label values). Fall back to labels so resources
@@ -774,10 +780,24 @@ export async function getInstalledRegistryState(gateway?: K8sGateway): Promise<{
if (catalogId && catalogVersion) recipeKeys.add(`${catalogId}@${catalogVersion}`)
}
+ for (const hook of hooks as Array<{
+ metadata?: {
+ deletionTimestamp?: string
+ labels?: Record<string, string>
+ annotations?: Record<string, string>
+ }
+ }>) {
+ if (hook.metadata?.deletionTimestamp) continue
+ const catalogId = getCatalogId(hook.metadata)
+ const catalogVersion = getCatalogVersion(hook.metadata)
+ if (catalogId && catalogVersion) hookKeys.add(`${catalogId}@${catalogVersion}`)
+ }
+
return {
catalogKeys: [...catalogKeys].sort((a, b) => a.localeCompare(b)),
serverNames: [...serverNames].sort((a, b) => a.localeCompare(b)),
recipeKeys: [...recipeKeys].sort((a, b) => a.localeCompare(b)),
+ hookKeys: [...hookKeys].sort((a, b) => a.localeCompare(b)),
}
}
diff --git a/control-ui/components/PublisherView/OwnedEntries.tsx b/control-ui/components/PublisherView/OwnedEntries.tsx
index 2238d8ec9..65ccfe813 100644
--- a/control-ui/components/PublisherView/OwnedEntries.tsx
+++ b/control-ui/components/PublisherView/OwnedEntries.tsx
@@ -120,6 +120,7 @@ export function OwnedEntries({
const [installedCatalogKeys, setInstalledCatalogKeys] = useState<Set<string>>(new Set())
const [installedServerNames, setInstalledServerNames] = useState<Set<string>>(new Set())
const [installedRecipeKeys, setInstalledRecipeKeys] = useState<Set<string>>(new Set())
+ const [installedHookKeys, setInstalledHookKeys] = useState<Set<string>>(new Set())
const load = useCallback(async () => {
setLoading(true)
@@ -134,6 +135,7 @@ export function OwnedEntries({
setInstalledCatalogKeys(new Set(catalog.installed.catalogKeys))
setInstalledServerNames(new Set(catalog.installed.serverNames))
setInstalledRecipeKeys(new Set(catalog.installed.recipeKeys))
+ setInstalledHookKeys(new Set(catalog.installed.hookKeys ?? []))
}
} catch {
setError(true)
@@ -181,6 +183,7 @@ export function OwnedEntries({
if (kind === 'mcp-server') {
return installedCatalogKeys.has(key) || installedServerNames.has(e.name)
}
+ if (kind === 'llm-hook') return installedHookKeys.has(key)
return installedRecipeKeys.has(key)
}
diff --git a/control-ui/lib/api.ts b/control-ui/lib/api.ts
index 00d69f6e5..ed5fe51c0 100644
--- a/control-ui/lib/api.ts
+++ b/control-ui/lib/api.ts
@@ -2790,6 +2790,7 @@ export type RegistryInstalledState = {
catalogKeys: string[]
serverNames: string[]
recipeKeys: string[]
+ hookKeys?: string[]
}
export type RegistryCatalogResponse = RegistryEntryListResponse & {
categories: string[]
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 8e700c39e..f7fab9862 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.394",
+ "version": "0.1.395",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.394",
+ "version": "0.1.395",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index 215e8522f..c056b04f4 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.394",
+ "version": "0.1.395",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",