Add built-in read-only Langfuse trace domain

This commit is contained in:
gitea committed 2026-10-10 09:57:20 +08:00
1 parent e2410e6923
commit 45011c8333
31 files changed
+2823 -47

No files matched your search

+105
View File
@@ -1170,6 +1170,111 @@ export const HELP_REGISTRY: AreaHelp[] = [
}
]
},
{
area: "langfuse",
title: "Langfuse trace inspection (read-only)",
description:
"Inspect Langfuse traces/sessions with the built-in read-only credentials: cache once, then outline → search → observation IO. No tenant or user config required.",
commands: [
{
name: "check",
summary: "Check connectivity of the built-in Langfuse read-only credentials",
usage: ["seal-use langfuse check"]
},
{
name: "cache-refresh",
summary: "Fetch one full trace into the local cache for offline inspection",
usage: ["seal-use langfuse cache-refresh <traceId> [--trace-id <traceId>]"],
options: [{ flag: "--trace-id <id>", description: "Trace id when not given as a positional" }]
},
{
name: "outline",
summary: "Read a compact observation tree with sizes, usage, cost, and optional IO previews",
usage: ["seal-use langfuse outline <traceId> [--include-io-preview] [--max-preview-chars <n>] [--full]"],
options: [
{ flag: "--include-io-preview", description: "Include short input/output previews on the trace and observations" },
{ flag: "--max-preview-chars <n>", description: "Preview length per field, 20-5000 (default 160)" },
{ flag: "--full", description: "Return full IO instead of previews (large output)" },
{ flag: "--refresh-if-missing", description: "Fetch the trace when it is not cached yet" }
]
},
{
name: "search",
summary: "Ranked keyword search inside one cached trace (qrep)",
usage: ["seal-use langfuse search <traceId> --query <term1,term2> [--fields input,output] [--max-results <n>]"],
options: [
{ flag: "--query <terms>", description: "Comma-separated terms; earliest best match wins per field" },
{ flag: "--fields <fields>", description: "Comma-separated fields: name,input,output,metadata,userId,sessionId" },
{ flag: "--observation-types <types>", description: "Comma-separated observation type filter (e.g. GENERATION,SPAN)" },
{ flag: "--metadata <json>", description: "Exact metadata filter as a JSON object" },
{ flag: "--max-results <n>", description: "Maximum ranked results, 1-30 (default 10)" },
{ flag: "--context-chars <n>", description: "Context around each match, 20-500 (default 120)" },
{ flag: "--session-id <id>", description: "Only match when the trace belongs to this session" },
{ flag: "--refresh-if-missing", description: "Fetch the trace when it is not cached yet" }
]
},
{
name: "observation",
summary: "Read focused input/output/metadata of one observation",
usage: ["seal-use langfuse observation <traceId> <observationId> [--fields input,output] [--max-chars <n>]"],
options: [
{ flag: "--fields <fields>", description: "Comma-separated fields to read: input,output,metadata (default input,output)" },
{ flag: "--max-chars <n>", description: "Per-field character cap, 100-30000 (default 8000)" },
{ flag: "--json-path <path>", description: "Read one nested value, e.g. items[0].name" },
{ flag: "--full", description: "Raise the cap to 500000 chars (large output)" },
{ flag: "--refresh-if-missing", description: "Fetch the trace when it is not cached yet" }
]
},
{
name: "session",
summary: "Read a compact session outline with trace summaries",
usage: ["seal-use langfuse session <sessionId> [--trace-limit <n>]"],
options: [{ flag: "--trace-limit <n>", description: "Maximum traces to summarize, 1-200 (default 50)" }]
},
{
name: "observations",
summary: "Filter cached observations by name/type/metadata without loading IO",
usage: ["seal-use langfuse observations <traceId> [--name-contains <text>] [--type <type>]"],
options: [
{ flag: "--name-contains <text>", description: "Substring match on observation name" },
{ flag: "--type <type>", description: "Exact observation type filter" },
{ flag: "--metadata-key <key>", description: "Only observations whose metadata has this key" },
{ flag: "--has-input", description: "Only observations with non-empty input" },
{ flag: "--has-output", description: "Only observations with non-empty output" },
{ flag: "--max-results <n>", description: "Maximum summaries, 1-200 (default 50)" },
{ flag: "--refresh-if-missing", description: "Fetch the trace when it is not cached yet" }
]
},
{
name: "url",
summary: "Build the Langfuse UI deep link for one trace",
usage: ["seal-use langfuse url <traceId>"]
},
{
name: "attachment-flow",
summary: "Trace text evidence of a file id/name through attachment and review stages",
usage: ["seal-use langfuse attachment-flow <traceId> [--file-id <id>] [--file-name <name>]"],
options: [
{ flag: "--file-id <id>", description: "File id to look for (at least one hint required)" },
{ flag: "--file-name <name>", description: "File name to look for (at least one hint required)" },
{ flag: "--content-hints <hints>", description: "Comma-separated extra content hints" },
{ flag: "--context-chars <n>", description: "Context around each match, 20-500 (default 120)" },
{ flag: "--refresh-if-missing", description: "Fetch the trace when it is not cached yet" }
]
},
{
name: "rule-flow",
summary: "Trace text evidence of one rule through matching, parsing, and review stages",
usage: ["seal-use langfuse rule-flow <traceId> --rule <规则内容>"],
options: [
{ flag: "--rule <text>", description: "Rule text to trace (required)" },
{ flag: "--rule-hints <hints>", description: "Comma-separated extra rule hints" },
{ flag: "--context-chars <n>", description: "Context around each match, 20-500 (default 300)" },
{ flag: "--refresh-if-missing", description: "Fetch the trace when it is not cached yet" }
]
}
]
},
{
area: "mcp",
title: "Model Context Protocol (MCP) server",