@tellagen/mcp-server 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -3
- package/SKILL.md +143 -19
- package/contracts/mcp-protocol.json +64 -3
- package/contracts/runbooks/manifest.json +24 -14
- package/contracts/runbooks/v2/client-protocol.json +65 -2
- package/contracts/runbooks/v2/client-writes.guidance.json +16 -1
- package/contracts/runbooks/v2/fixtures/filesystem-pressure.json +22 -31
- package/contracts/runbooks/v2/fixtures/timeline-event-blocks-rejected.json +15 -1
- package/contracts/runbooks/v2/investigation-window.guidance.json +45 -0
- package/contracts/runbooks/v2/question-checks.guidance.json +49 -0
- package/contracts/runbooks/v2/result-summary.guidance.json +53 -5
- package/contracts/runbooks/v2/timeline-event-blocks.schema.json +66 -3
- package/contracts/tellagen-runbook-contracts.json +3 -3
- package/dist/active-run.d.ts +6 -0
- package/dist/active-run.js +14 -0
- package/dist/active-run.js.map +1 -1
- package/dist/cli/doctor.d.ts +19 -0
- package/dist/cli/doctor.js +179 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/kubernetes.d.ts +47 -0
- package/dist/cli/kubernetes.js +369 -0
- package/dist/cli/kubernetes.js.map +1 -0
- package/dist/cli/main.js +10 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/diagnosis-structure.d.ts +380 -102
- package/dist/diagnosis-structure.js +334 -14
- package/dist/diagnosis-structure.js.map +1 -1
- package/dist/doctor/checks.d.ts +42 -0
- package/dist/doctor/checks.js +181 -0
- package/dist/doctor/checks.js.map +1 -0
- package/dist/doctor/config-files.d.ts +49 -0
- package/dist/doctor/config-files.js +121 -0
- package/dist/doctor/config-files.js.map +1 -0
- package/dist/doctor/k8s-read-only.d.ts +16 -0
- package/dist/doctor/k8s-read-only.js +89 -0
- package/dist/doctor/k8s-read-only.js.map +1 -0
- package/dist/doctor/real-fs.d.ts +3 -0
- package/dist/doctor/real-fs.js +36 -0
- package/dist/doctor/real-fs.js.map +1 -0
- package/dist/doctor/toml.d.ts +13 -0
- package/dist/doctor/toml.js +205 -0
- package/dist/doctor/toml.js.map +1 -0
- package/dist/figures.d.ts +520 -101
- package/dist/figures.js +341 -7
- package/dist/figures.js.map +1 -1
- package/dist/heartbeat.d.ts +3 -0
- package/dist/heartbeat.js +32 -1
- package/dist/heartbeat.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/k8s-safety.d.ts +42 -0
- package/dist/k8s-safety.js +33 -0
- package/dist/k8s-safety.js.map +1 -0
- package/dist/listen-config.d.ts +5 -5
- package/dist/listen-probe.d.ts +14 -1
- package/dist/listen-probe.js +83 -5
- package/dist/listen-probe.js.map +1 -1
- package/dist/listen-settings.d.ts +8 -0
- package/dist/listen-settings.js +29 -0
- package/dist/listen-settings.js.map +1 -1
- package/dist/listener.d.ts +11 -0
- package/dist/listener.js +60 -16
- package/dist/listener.js.map +1 -1
- package/dist/log-lines.d.ts +118 -0
- package/dist/log-lines.js +534 -0
- package/dist/log-lines.js.map +1 -0
- package/dist/redact.d.ts +21 -0
- package/dist/redact.js +212 -5
- package/dist/redact.js.map +1 -1
- package/dist/run-events.js +13 -1
- package/dist/run-events.js.map +1 -1
- package/dist/run-requests.d.ts +16 -0
- package/dist/run-requests.js +56 -0
- package/dist/run-requests.js.map +1 -0
- package/dist/run-window.d.ts +59 -0
- package/dist/run-window.js +141 -0
- package/dist/run-window.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +11 -9
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +37 -0
- package/dist/session.js +59 -0
- package/dist/session.js.map +1 -1
- package/dist/tool-report.d.ts +2 -0
- package/dist/tool-report.js +3 -0
- package/dist/tool-report.js.map +1 -0
- package/dist/tools/amendments.d.ts +13 -0
- package/dist/tools/amendments.js +206 -0
- package/dist/tools/amendments.js.map +1 -0
- package/dist/tools/catalog.js +4 -0
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/diagnostics.js +131 -3
- package/dist/tools/diagnostics.js.map +1 -1
- package/dist/tools/figures.d.ts +2 -2
- package/dist/tools/figures.js +37 -9
- package/dist/tools/figures.js.map +1 -1
- package/dist/tools/findings.d.ts +136 -0
- package/dist/tools/findings.js +68 -7
- package/dist/tools/findings.js.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/investigations.d.ts +3223 -5
- package/dist/tools/investigations.js +202 -50
- package/dist/tools/investigations.js.map +1 -1
- package/dist/tools/next.d.ts +16 -0
- package/dist/tools/next.js +49 -1
- package/dist/tools/next.js.map +1 -1
- package/dist/tools/postmortem-runbooks.d.ts +20 -20
- package/dist/tools/requests.d.ts +3 -0
- package/dist/tools/requests.js +62 -0
- package/dist/tools/requests.js.map +1 -0
- package/dist/tools/resume.js +14 -1
- package/dist/tools/resume.js.map +1 -1
- package/dist/tools/source-links.d.ts +7 -0
- package/dist/tools/source-links.js +32 -5
- package/dist/tools/source-links.js.map +1 -1
- package/dist/tools/timeline.js +24 -2
- package/dist/tools/timeline.js.map +1 -1
- package/dist/version.d.ts +4 -2
- package/dist/version.js +6 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { resolveAmendRunId } from "../active-run.js";
|
|
4
|
+
import { httpDefaults } from "../client.js";
|
|
5
|
+
import { TellagenAPIError, formatError } from "../errors.js";
|
|
6
|
+
import { DIAGNOSIS_CHANGES_CAPABILITY, RUN_AMENDMENTS_CAPABILITY, coverageEntrySchema, gapQuestionNotice, stripFindingChangeLinks, stripFindingEvidenceStructure, supportsCapability, supportsDiagnosisChanges, supportsDiagnosisStructure, supportsRunAmendments, unsupportedNotice, } from "../diagnosis-structure.js";
|
|
7
|
+
import { QUESTION_CHECKS_CAPABILITY } from "../run-window.js";
|
|
8
|
+
import { checkScreenshotSizes, evidenceRefSchema, findingCheckSchema, findingChecksProblem, hasScreenshots, MAX_FINDING_CHECKS, screenshotSchema, } from "./findings.js";
|
|
9
|
+
import { adaptResultSummary, resultSummarySchema } from "./investigations.js";
|
|
10
|
+
/** What Tellagen takes in one amendment. */
|
|
11
|
+
export const MAX_AMEND_FINDINGS = 10;
|
|
12
|
+
export const MAX_AMEND_SCREENSHOTS = 20;
|
|
13
|
+
/** How often a conflicting amendment is sent again with the same key. */
|
|
14
|
+
export const amendRetries = { attempts: 4, delayMs: 1000 };
|
|
15
|
+
const amendFindingSchema = z.object({
|
|
16
|
+
finding_type: z
|
|
17
|
+
.enum(["observation", "correlation", "hypothesis", "evidence", "recommendation", "negative", "gap"])
|
|
18
|
+
.describe("Type of finding, as in tellagen_post_finding."),
|
|
19
|
+
role: z.enum(["confirms", "supports", "contradicts", "gap"]).optional(),
|
|
20
|
+
claim: z.string().min(1).describe("One-sentence finding statement. For a gap finding, one real question that ends with a question mark."),
|
|
21
|
+
evidence_summary: z.string().min(1).describe("Detailed explanation with supporting data: the body of the finding."),
|
|
22
|
+
checks: z
|
|
23
|
+
.array(findingCheckSchema)
|
|
24
|
+
.min(1)
|
|
25
|
+
.max(MAX_FINDING_CHECKS)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Gap findings only: one to three yes or no checks, each {source, question}. Sent only when this Tellagen lists question_checks_v1."),
|
|
28
|
+
confidence: z.number().min(0).max(1),
|
|
29
|
+
confidence_reason: z.string().min(1),
|
|
30
|
+
evidence_refs: z.array(evidenceRefSchema).optional(),
|
|
31
|
+
screenshots: z.array(screenshotSchema).optional(),
|
|
32
|
+
potential_root_cause: z.boolean().optional().describe("True on the finding that carries a new cause, with root_cause_status proposed."),
|
|
33
|
+
root_cause_status: z.literal("proposed").optional().describe("Only proposed: a person accepts or rejects a cause in Tellagen."),
|
|
34
|
+
});
|
|
35
|
+
/** The key of an amendment: a hash of what is sent, so a repeat of the same call is the same amendment. */
|
|
36
|
+
export function amendmentIdempotencyKey(runId, body) {
|
|
37
|
+
const hash = createHash("sha256").update(JSON.stringify([runId, body])).digest("hex");
|
|
38
|
+
return `mcp-amend-${hash.slice(0, 48)}`;
|
|
39
|
+
}
|
|
40
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
41
|
+
export function registerAmendmentTools(server, client) {
|
|
42
|
+
server.registerTool("tellagen_amend_investigation", {
|
|
43
|
+
description: "Add proof to a finished diagnosis as a new version of it. Use it when a run is finished and you have more: a source that was not read became readable (the person fixed a connector, granted access or pasted the file), or you found proof after you completed. Read the source, then send reason (one line, at most 200 characters), the new findings, and the coverage entries that changed (the source that is now checked, or a source that still could not be read with its reason). Send result_summary only when the headline or the causal path changes: it is the whole new result, and a changed headline is a new version. The earlier version stays. The run is the finished run this session remembers; pass investigation_run_id for a run this session completed, because Tellagen takes additions only from the client session that ran it. A run takes additions for a limited time after it completes; the answer of a write to a finished run says until when. A repeat of the same call returns the first answer and stores nothing twice. A new cause is a finding with potential_root_cause true and root_cause_status proposed; a person accepts or rejects it in Tellagen. Only when this Tellagen lists run_amendments_v1.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
investigation_run_id: z
|
|
46
|
+
.string()
|
|
47
|
+
.min(1)
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("The finished run. Leave it out to use the run this session completed."),
|
|
50
|
+
request_id: z
|
|
51
|
+
.number()
|
|
52
|
+
.int()
|
|
53
|
+
.positive()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Only when you answer a request of a responder that you took (tellagen_pick_up_run_request, or a heartbeat gave it to you): its id. The request then ends with this version."),
|
|
56
|
+
reason: z.string().trim().min(1).max(200).describe("One line that says what the amendment adds, for example: Read the Slack thread after the token was fixed."),
|
|
57
|
+
findings: z.array(amendFindingSchema).max(MAX_AMEND_FINDINGS).optional().describe("New findings. They cannot cite each other or the amendment in result_summary yet; send a second amendment for that."),
|
|
58
|
+
coverage: z
|
|
59
|
+
.array(coverageEntrySchema)
|
|
60
|
+
.max(8)
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("The sources whose state changes: send its id and its source for an entry you change, or a new entry with its source. A source you read is checked; one you could not read stays gap or not_configured with a reason."),
|
|
63
|
+
result_summary: resultSummarySchema
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("The whole new result, only when the headline or the causal path changes. Without it the result on show stays, with the coverage changes applied."),
|
|
66
|
+
},
|
|
67
|
+
}, async ({ investigation_run_id: givenRunId, request_id, reason, findings, coverage, result_summary }) => {
|
|
68
|
+
let runId;
|
|
69
|
+
try {
|
|
70
|
+
runId = resolveAmendRunId(client, givenRunId ?? (request_id ? client.session.takenRequest(request_id)?.runId : undefined));
|
|
71
|
+
if (!(await supportsRunAmendments(client, runId))) {
|
|
72
|
+
return {
|
|
73
|
+
content: [
|
|
74
|
+
{
|
|
75
|
+
type: "text",
|
|
76
|
+
text: JSON.stringify({
|
|
77
|
+
error: true,
|
|
78
|
+
code: "amendments_not_supported",
|
|
79
|
+
message: `This Tellagen is too old to take additions to a finished run (it does not list ${RUN_AMENDMENTS_CAPABILITY}). Nothing was sent. Tell the person what you found in your own answer, and ask them to update Tellagen.`,
|
|
80
|
+
}),
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
isError: true,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const screenshotCount = (findings ?? []).reduce((n, f) => n + (f.screenshots?.length ?? 0) + (f.evidence_refs ?? []).reduce((m, r) => m + (r.screenshots?.length ?? 0), 0), 0);
|
|
87
|
+
if (screenshotCount > MAX_AMEND_SCREENSHOTS) {
|
|
88
|
+
return {
|
|
89
|
+
content: [{ type: "text", text: `An amendment takes at most ${MAX_AMEND_SCREENSHOTS} screenshots in all; this one has ${screenshotCount}. Nothing was sent. Send fewer, or split it into two amendments.` }],
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const notices = [];
|
|
94
|
+
const sentFindings = [];
|
|
95
|
+
for (const [index, finding] of (findings ?? []).entries()) {
|
|
96
|
+
const problem = findingChecksProblem(finding.finding_type, finding.role, finding.checks);
|
|
97
|
+
if (problem) {
|
|
98
|
+
return { content: [{ type: "text", text: `findings[${index}]: ${problem}` }], isError: true };
|
|
99
|
+
}
|
|
100
|
+
checkScreenshotSizes(finding.screenshots, finding.evidence_refs);
|
|
101
|
+
const out = {
|
|
102
|
+
finding_type: finding.finding_type,
|
|
103
|
+
claim: finding.claim,
|
|
104
|
+
evidence_summary: finding.evidence_summary,
|
|
105
|
+
confidence: finding.confidence,
|
|
106
|
+
confidence_reason: finding.confidence_reason,
|
|
107
|
+
evidence_refs: finding.evidence_refs ?? [],
|
|
108
|
+
};
|
|
109
|
+
if (finding.role !== undefined)
|
|
110
|
+
out.role = finding.role;
|
|
111
|
+
if (finding.screenshots !== undefined)
|
|
112
|
+
out.screenshots = finding.screenshots;
|
|
113
|
+
if (finding.potential_root_cause !== undefined)
|
|
114
|
+
out.potential_root_cause = finding.potential_root_cause;
|
|
115
|
+
if (finding.root_cause_status !== undefined)
|
|
116
|
+
out.root_cause_status = finding.root_cause_status;
|
|
117
|
+
if (finding.checks !== undefined) {
|
|
118
|
+
if (await supportsCapability(client, runId, QUESTION_CHECKS_CAPABILITY))
|
|
119
|
+
out.checks = finding.checks;
|
|
120
|
+
else
|
|
121
|
+
notices.push(`findings[${index}]: this Tellagen does not list ${QUESTION_CHECKS_CAPABILITY}, so the checks were not sent.`);
|
|
122
|
+
}
|
|
123
|
+
const question = gapQuestionNotice(finding.finding_type, finding.role, finding.claim);
|
|
124
|
+
if (question)
|
|
125
|
+
notices.push(`findings[${index}]: ${question}`);
|
|
126
|
+
const structure = stripFindingEvidenceStructure(out.evidence_refs);
|
|
127
|
+
if (structure.removed.length > 0 && !(await supportsDiagnosisStructure(client, runId))) {
|
|
128
|
+
out.evidence_refs = structure.refs;
|
|
129
|
+
notices.push(unsupportedNotice(structure.removed));
|
|
130
|
+
}
|
|
131
|
+
const links = stripFindingChangeLinks(out.evidence_refs);
|
|
132
|
+
if (links.removed.length > 0 && !(await supportsDiagnosisChanges(client, runId))) {
|
|
133
|
+
out.evidence_refs = links.refs;
|
|
134
|
+
notices.push(unsupportedNotice(links.removed, DIAGNOSIS_CHANGES_CAPABILITY));
|
|
135
|
+
}
|
|
136
|
+
sentFindings.push(out);
|
|
137
|
+
}
|
|
138
|
+
const body = { reason };
|
|
139
|
+
if (request_id !== undefined)
|
|
140
|
+
body.request_id = request_id;
|
|
141
|
+
if (sentFindings.length > 0)
|
|
142
|
+
body.findings = sentFindings;
|
|
143
|
+
if (coverage !== undefined)
|
|
144
|
+
body.coverage = coverage;
|
|
145
|
+
if (result_summary !== undefined) {
|
|
146
|
+
const adapted = await adaptResultSummary(client, runId, result_summary);
|
|
147
|
+
body.result_summary = adapted.summary;
|
|
148
|
+
notices.push(...adapted.notices);
|
|
149
|
+
}
|
|
150
|
+
const screenshots = (findings ?? []).some((f) => hasScreenshots(f.screenshots, f.evidence_refs));
|
|
151
|
+
const key = amendmentIdempotencyKey(runId, body);
|
|
152
|
+
const path = `/api/v1/investigation-runs/${encodeURIComponent(runId)}/amendments`;
|
|
153
|
+
const data = await postAmendment(client, path, body, key, screenshots);
|
|
154
|
+
const run = typeof data.run === "object" && data.run !== null ? data.run : undefined;
|
|
155
|
+
const until = typeof run?.amend_until === "string" ? run.amend_until : undefined;
|
|
156
|
+
client.session.rememberAmendable(runId, until);
|
|
157
|
+
if (request_id !== undefined)
|
|
158
|
+
client.session.forgetRequest(request_id);
|
|
159
|
+
const out = { ...data };
|
|
160
|
+
if (notices.length > 0)
|
|
161
|
+
out.mcp_notice = notices.join(" ");
|
|
162
|
+
return { content: [{ type: "text", text: JSON.stringify(out) }] };
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
if (err instanceof TellagenAPIError) {
|
|
166
|
+
// A window that closed, or a run that never completed, takes no more additions: forget that run only.
|
|
167
|
+
if (err.code === "run_not_amendable" && runId)
|
|
168
|
+
client.session.forgetAmendable(runId);
|
|
169
|
+
if (err.code === "run_request_not_available" && request_id) {
|
|
170
|
+
client.session.forgetRequest(request_id);
|
|
171
|
+
return {
|
|
172
|
+
content: [{ type: "text", text: formatError(new TellagenAPIError(err.status, err.code, "That request is not yours any more: another client took it, or its time is over. Drop it. Nothing was added.", err.payload)) }],
|
|
173
|
+
isError: true,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (err.code === "run_taken_over") {
|
|
177
|
+
return {
|
|
178
|
+
content: [{ type: "text", text: formatError(new TellagenAPIError(err.status, err.code, "Tellagen takes additions to a run only from the client session that ran it, and this session did not. Do not retry. Tell the person what you found in your answer, and that the client that ran it, or a person in Tellagen, can add it.", { ...(err.payload ?? {}), amendment: true })) }],
|
|
179
|
+
isError: true,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { content: [{ type: "text", text: formatError(err) }], isError: true };
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Sends the amendment. A conflict (another amendment is being written) is sent
|
|
189
|
+
* again with the same key, so the run never gets two versions of one request.
|
|
190
|
+
*/
|
|
191
|
+
async function postAmendment(client, path, body, key, screenshots) {
|
|
192
|
+
for (let attempt = 1;; attempt++) {
|
|
193
|
+
try {
|
|
194
|
+
return await client.post(path, body, {
|
|
195
|
+
idempotencyKey: key,
|
|
196
|
+
timeoutMs: screenshots ? httpDefaults.uploadTimeoutMs : undefined,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
if (!(err instanceof TellagenAPIError) || err.code !== "run_amendment_conflict" || attempt >= amendRetries.attempts)
|
|
201
|
+
throw err;
|
|
202
|
+
await sleep(amendRetries.delayMs * 2 ** (attempt - 1));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=amendments.js.map
|
|
@@ -0,0 +1 @@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CAAC,IAAI,KAAK,wBAAwB,IAAI,OAAO,IAAI,YAAY,CAAC,QAAQ;gBAAE,MAAM,GAAG,CAAC;YAC/H,MAAM,KAAK,CAAC,YAAY,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/tools/catalog.js
CHANGED
|
@@ -30,6 +30,9 @@ export const TOOL_CATALOG = [
|
|
|
30
30
|
{ name: "tellagen_get_investigation_coverage", toolset: "diagnosis", effect: "read" },
|
|
31
31
|
{ name: "tellagen_post_timeline_event", toolset: "diagnosis", effect: "add" },
|
|
32
32
|
{ name: "tellagen_complete_investigation", toolset: "diagnosis", effect: "change" },
|
|
33
|
+
{ name: "tellagen_amend_investigation", toolset: "diagnosis", effect: "add", idempotent: true },
|
|
34
|
+
{ name: "tellagen_pick_up_run_request", toolset: "diagnosis", effect: "add" },
|
|
35
|
+
{ name: "tellagen_end_run_request", toolset: "diagnosis", effect: "change", idempotent: true },
|
|
33
36
|
// incidents
|
|
34
37
|
{ name: "tellagen_list_incidents", toolset: "incidents", effect: "read" },
|
|
35
38
|
{ name: "tellagen_get_incident", toolset: "incidents", effect: "read" },
|
|
@@ -63,6 +66,7 @@ export const TOOL_CATALOG = [
|
|
|
63
66
|
{ name: "tellagen_probe_datasource", toolset: "settings", effect: "read", openWorld: true },
|
|
64
67
|
{ name: "tellagen_get_diagnostic_session", toolset: "settings", effect: "read" },
|
|
65
68
|
{ name: "tellagen_report_diagnostic_tools", toolset: "settings", effect: "add" },
|
|
69
|
+
{ name: "tellagen_report_available_sources", toolset: "settings", effect: "add", idempotent: true },
|
|
66
70
|
{ name: "tellagen_list_trace_steps", toolset: "settings", effect: "read" },
|
|
67
71
|
{ name: "tellagen_list_runbooks", toolset: "settings", effect: "read" },
|
|
68
72
|
{ name: "tellagen_list_investigation_runbook_waivers", toolset: "settings", effect: "read" },
|
|
@@ -1 +1 @@
|
|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AAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACxB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SACxC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,gBAAgB,CAAC;IAChD,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAE,QAA8B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACxF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,mBAAmB,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,4CAA4C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAChJ,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { formatError } from "../errors.js";
|
|
2
|
+
import { formatError, TellagenAPIError } from "../errors.js";
|
|
3
|
+
import { KUBERNETES_SAFETY_CHECK_IDS, KUBERNETES_SAFETY_PROTOCOL, KUBERNETES_SAFETY_STATUSES, } from "../k8s-safety.js";
|
|
4
|
+
import { kubernetesReadOnlyOfClient } from "../doctor/k8s-read-only.js";
|
|
5
|
+
import { realDoctorFs } from "../doctor/real-fs.js";
|
|
6
|
+
import { TOOL_REPORT_PATH } from "../tool-report.js";
|
|
7
|
+
import { AVAILABLE_SOURCE_KEYS, availableSourceSchema } from "./investigations.js";
|
|
3
8
|
const accessStatusSchema = z.enum([
|
|
4
9
|
"ok",
|
|
5
10
|
"missing_tool",
|
|
@@ -74,8 +79,10 @@ export function registerDiagnosticTools(server, client) {
|
|
|
74
79
|
};
|
|
75
80
|
}
|
|
76
81
|
});
|
|
82
|
+
registerReportAvailableSources(server, client);
|
|
77
83
|
server.registerTool("tellagen_report_diagnostic_tools", {
|
|
78
|
-
description: "Report which MCP tools are visible and usable to a diagnostic session (diag_* ID), after you have checked them. Send only sanitized names and access results, never credentials. It does not start or change an investigation run."
|
|
84
|
+
description: "Report which MCP tools are visible and usable to a diagnostic session (diag_* ID), after you have checked them. Send only sanitized names and access results, never credentials. It does not start or change an investigation run. For the kubernetes tool, add the safety check as checks. " +
|
|
85
|
+
KUBERNETES_SAFETY_PROTOCOL,
|
|
79
86
|
inputSchema: {
|
|
80
87
|
diagnostic_session_id: z
|
|
81
88
|
.string()
|
|
@@ -88,7 +95,28 @@ export function registerDiagnosticTools(server, client) {
|
|
|
88
95
|
},
|
|
89
96
|
}, async ({ diagnostic_session_id, reports }) => {
|
|
90
97
|
try {
|
|
91
|
-
const
|
|
98
|
+
const path = `/api/v1/settings/agent/diagnostic-sessions/${diagnostic_session_id}/reports`;
|
|
99
|
+
const plain = reports.map(normalizeDiagnosticReport);
|
|
100
|
+
// Whether the Kubernetes server runs read-only is read from its client config entry, like
|
|
101
|
+
// in the tool report, and only for the kubernetes report of a tool that was found.
|
|
102
|
+
const found = reports.some((r) => r.tool_id === "kubernetes" && r.installed);
|
|
103
|
+
const readOnly = found ? kubernetesReadOnlyOfClient(client.session.identity?.name, realDoctorFs()) : undefined;
|
|
104
|
+
let data;
|
|
105
|
+
if (readOnly === undefined) {
|
|
106
|
+
data = await client.post(path, { reports: plain });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const withFlag = plain.map((r) => (r.tool_id === "kubernetes" ? { ...r, kubernetes_read_only_tools: readOnly } : r));
|
|
110
|
+
try {
|
|
111
|
+
data = await client.post(path, { reports: withFlag });
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
// An older Tellagen refuses a field it does not know: send the report without it.
|
|
115
|
+
if (!(err instanceof TellagenAPIError && err.status === 400 && err.code === "unknown_field"))
|
|
116
|
+
throw err;
|
|
117
|
+
data = await client.post(path, { reports: plain });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
92
120
|
return {
|
|
93
121
|
content: [{ type: "text", text: JSON.stringify(data) }],
|
|
94
122
|
};
|
|
@@ -110,4 +138,104 @@ function normalizeDiagnosticReport(report) {
|
|
|
110
138
|
reported_by: reportedBy,
|
|
111
139
|
};
|
|
112
140
|
}
|
|
141
|
+
const safetyCheckSchema = z
|
|
142
|
+
.object({
|
|
143
|
+
id: z.enum(KUBERNETES_SAFETY_CHECK_IDS).describe("Stable id of the kubectl auth can-i check"),
|
|
144
|
+
status: z.enum(KUBERNETES_SAFETY_STATUSES),
|
|
145
|
+
})
|
|
146
|
+
.strict();
|
|
147
|
+
function registerReportAvailableSources(server, client) {
|
|
148
|
+
server.registerTool("tellagen_report_available_sources", {
|
|
149
|
+
description: `Tell Tellagen which data sources this client can reach, with no run and no diagnostic session ID, so the tools table in Settings shows the current state of this client. Look at the MCP servers and shell tools you have and map them to ${AVAILABLE_SOURCE_KEYS.join(", ")}, as tellagen_pick_up_investigation does: one entry for each key, found or not_found, with an optional short detail that holds no token, no password and no path with a user name (for docs, the name of the source, such as Confluence, Notion or repository folder). Safe to repeat. ${KUBERNETES_SAFETY_PROTOCOL} Pass those results as kubernetes_checks only when you ran them.`,
|
|
150
|
+
inputSchema: {
|
|
151
|
+
available_sources: z
|
|
152
|
+
.array(availableSourceSchema)
|
|
153
|
+
.min(1)
|
|
154
|
+
.max(20)
|
|
155
|
+
.describe("The data sources this client can reach, one entry per catalog key, each found or not_found."),
|
|
156
|
+
profile_id: z
|
|
157
|
+
.string()
|
|
158
|
+
.trim()
|
|
159
|
+
.max(128)
|
|
160
|
+
.optional()
|
|
161
|
+
.describe("The exact MCP profile ID of the client, when it has one. Left out, TELLAGEN_MCP_PROFILE_ID is used."),
|
|
162
|
+
kubernetes_checks: z
|
|
163
|
+
.array(safetyCheckSchema)
|
|
164
|
+
.max(4)
|
|
165
|
+
.optional()
|
|
166
|
+
.describe("The four kubectl auth can-i results of the Kubernetes safety check. Leave out when you did not run them."),
|
|
167
|
+
},
|
|
168
|
+
}, async (input) => {
|
|
169
|
+
try {
|
|
170
|
+
const profileId = (input.profile_id ?? process.env.TELLAGEN_MCP_PROFILE_ID ?? "").trim();
|
|
171
|
+
const body = {
|
|
172
|
+
available_sources: input.available_sources,
|
|
173
|
+
...(profileId ? { profile_id: profileId } : {}),
|
|
174
|
+
};
|
|
175
|
+
const checks = input.kubernetes_checks ?? [];
|
|
176
|
+
// Whether the Kubernetes server of this client runs read-only is read from its own
|
|
177
|
+
// config entry, only when the report says Kubernetes was found. Only the one fact leaves.
|
|
178
|
+
const kubernetesFound = input.available_sources.some((source) => source.key === "kubernetes" && source.state === "found");
|
|
179
|
+
const readOnly = kubernetesFound ? kubernetesReadOnlyOfClient(client.session.identity?.name, realDoctorFs()) : undefined;
|
|
180
|
+
const extras = {
|
|
181
|
+
...(checks.length > 0 ? { kubernetes_checks: checks } : {}),
|
|
182
|
+
...(readOnly !== undefined ? { kubernetes_read_only_tools: readOnly } : {}),
|
|
183
|
+
};
|
|
184
|
+
// An older Tellagen refuses a field it does not know. Try the fields it may know first
|
|
185
|
+
// (the checks), and the plain sources last.
|
|
186
|
+
const attempts = [{ ...body, ...extras }];
|
|
187
|
+
if (readOnly !== undefined && checks.length > 0)
|
|
188
|
+
attempts.push({ ...body, kubernetes_checks: checks });
|
|
189
|
+
if (Object.keys(extras).length > 0)
|
|
190
|
+
attempts.push(body);
|
|
191
|
+
let data;
|
|
192
|
+
let note;
|
|
193
|
+
for (let i = 0; i < attempts.length && !data; i++) {
|
|
194
|
+
try {
|
|
195
|
+
data = await client.post(TOOL_REPORT_PATH, attempts[i], { safeToRepeat: true });
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
const last = i === attempts.length - 1;
|
|
199
|
+
if (last || !(err instanceof TellagenAPIError && err.status === 400 && err.code === "unknown_field"))
|
|
200
|
+
throw err;
|
|
201
|
+
}
|
|
202
|
+
if (data && i > 0) {
|
|
203
|
+
const sent = attempts[i];
|
|
204
|
+
note = "kubernetes_checks" in sent
|
|
205
|
+
? "This Tellagen stored the sources and checks but not whether the Kubernetes tools are read-only yet."
|
|
206
|
+
: checks.length > 0
|
|
207
|
+
? "This Tellagen stored the sources but not the Kubernetes safety checks yet."
|
|
208
|
+
: "This Tellagen stored the sources but not whether the Kubernetes tools are read-only yet.";
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (!data)
|
|
212
|
+
throw new Error("tool report was not sent");
|
|
213
|
+
return {
|
|
214
|
+
content: [{ type: "text", text: JSON.stringify(note ? { ...data, note } : data) }],
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
if (err instanceof TellagenAPIError && (err.status === 404 || err.status === 405)) {
|
|
219
|
+
return {
|
|
220
|
+
content: [
|
|
221
|
+
{
|
|
222
|
+
type: "text",
|
|
223
|
+
text: JSON.stringify({
|
|
224
|
+
error: true,
|
|
225
|
+
status: err.status,
|
|
226
|
+
code: "tool_report_not_supported",
|
|
227
|
+
message: "This Tellagen does not take a tool report without a check yet. Ask an admin to update Tellagen, or start the check from Settings > Local diagnosis and use tellagen_report_diagnostic_tools with its diag_ ID.",
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
isError: true,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
content: [{ type: "text", text: formatError(err) }],
|
|
236
|
+
isError: true,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
113
241
|
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/tools/diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/tools/diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,IAAI;IACJ,cAAc;IACd,cAAc;IACd,eAAe;IACf,aAAa;IACb,SAAS;IACT,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;AAE7E,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAA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EACL,gNAAgN;6BACnN,CAAC;yBACH;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/figures.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import type { TellagenClient } from "../client.js";
|
|
3
3
|
export declare const FIGURE_GUIDE_URI = "resource://tellagen/figure-guide";
|
|
4
4
|
/** Added to the server instructions so every agent knows figures exist. */
|
|
5
|
-
export declare const FIGURE_INSTRUCTIONS = "Figures: Tellagen draws typed widgets (stats, compare, trend, table, checks, changes, range_overlap, histogram, run_history, diff) from data you send, in the Diagnosis tab, on the timeline and in the postmortem. Use tellagen_build_figure to turn the numbers you read from a tool result into a figure Tellagen accepts: it puts a time series on an even grid of at most 500 points, turns deploy, alert and rollback times into marks, turns cumulative histogram buckets into bucket counts, maps a GitHub Actions run list to a run history, and enforces every limit. Attach the result as a causal step's figure or as a block on a timeline event. A figure owns its numbers: never repeat them in prose, never invent one, and keep units in the unit field. Read resource://tellagen/figure-guide to choose the widget that fits the question and to learn how to plot data on it.";
|
|
6
|
-
export declare const FIGURE_GUIDE = "# Tellagen figures\n\nA figure is a small typed widget that Tellagen draws for you. You send the data. Tellagen draws it the same way in the Diagnosis tab, on the timeline and in the postmortem, and a responder can pin one from one place to another.\n\nUse tellagen_build_figure to make one. It reshapes the numbers you already read from a tool result and checks them against Tellagen's limits before you send anything. It has no data of its own.\n\n## Rules every figure follows\n\n1. A figure owns its numbers. The sentence next to it says what happened and why. It does not repeat the numbers.\n2. Never invent a number. Every value comes from a tool result you can cite. If you do not have the value, leave that row, figure or block out.\n3. Units go in the unit field, once. Do not put them inside a number, and do not repeat them in every label.\n4. One figure per causal step, under the step it proves. A step with no good figure carries none.\n5. Say where the data came from. A trend carries its query in source. For other figures, cite the tool result in the step's evidence refs.\n6. A tone is a meaning, not emphasis: good for healthy or recovered, warn for needs attention, bad for failing, neutral for a plain fact.\n7. The limits below are enforced. A figure over a limit is rejected with the field named. Shorten the data yourself. Do not expect it to be trimmed.\n\n## Pick the widget by the question\n\n| The question | Widget | Step figure | Timeline block | Limits |\n| --- | --- | --- | --- | --- |\n| What are the few numbers that matter? | stats | yes | yes | 1 to 8 items (4 or fewer is best), title 80, label 48, value 32, caption 64 |\n| Did it get better, and is it inside the line? | compare | yes | yes | 1 to 8 rows, 3 details per row |\n| When did it start, and what happened around then? | trend | yes | yes | 2 to 500 points, 3 marks |\n| Which items rank highest? | table | no | yes | 1 to 6 columns, 1 to 12 rows, cell 64 |\n| Which checks passed, failed or did not run? | checks | yes | yes | 1 to 12 items, label 80, detail 160 |\n| What moved from one thing to another? | changes | no | yes | 1 to 8 rows, from and to 80, note 160 |\n| Where do two or more ranges meet? | range_overlap | yes | yes | 2 to 4 rows, label 80, unit 12 |\n| Did the slow tail move, when the average did not? | histogram | yes | yes | 3 to 61 edges (2 to 60 buckets), one count per bucket |\n| Which build broke, and which fixed it? | run_history | yes | yes | 2 to 30 runs, runs_not_shown, 4 marks, ref 80, sha 64, job 80, url 500 |\n| What exactly changed in the code? | diff | yes | yes | path 200, ref 64, 1 to 6 hunks, 12 changed lines in all, line 160 |\n\n## How to plot data on each widget\n\n### compare: before and after\n\nUse it for a value measured before and after a deploy, rollback, fix or config change. One row per host, route, query or job, biggest movers first.\n\n1. Pick two windows of the same length, one before the change and one after. Run the same query on both.\n2. Take one number per row from each window, for example the p95 over the window.\n3. Set unit once. Set better to lower or higher. Add a threshold for the SLO or alert line.\n\n { \"type\": \"compare\", \"title\": \"p95 latency by route\", \"unit\": \"ms\", \"better\": \"lower\",\n \"threshold\": { \"value\": 500, \"label\": \"SLO 500 ms\" },\n \"rows\": [ { \"label\": \"POST /checkout\", \"before\": 180, \"after\": 640 },\n { \"label\": \"GET /cart\", \"before\": 95, \"after\": 110 } ] }\n\nA distribution is a compare of percentiles: use p50, p95 and p99 as rows, with the SLO as the threshold.\n\n### trend: a series over time\n\nUse it when the evidence is how a value moved. Send the raw samples as points and the times of the events that explain the shape as events.\n\n1. Run a range query. Keep the time and the value of every sample.\n2. Send them as points with t and v. t is an ISO time or Unix time in seconds or milliseconds. v may be a numeric string, as Prometheus returns it. A null or NaN is skipped.\n3. Tellagen puts the points on an even grid of at most max_points (default 240, most 500) and sets start and step_seconds. Samples that share a step combine with reduce. Use max for error rate and latency so a spike survives, mean for a smooth rate.\n4. Add up to three events: a deploy, an alert, a rollback. They become marks at the right index. An event outside the range is left out and reported.\n5. Fill source with kind, datasource, query and step.\n\n { \"type\": \"trend\", \"title\": \"5xx share of requests\", \"unit\": \"%\", \"reduce\": \"max\",\n \"points\": [ { \"t\": \"2026-11-02T14:00:00Z\", \"v\": \"0.24\" }, { \"t\": \"2026-11-02T14:01:00Z\", \"v\": \"0.27\" } ],\n \"events\": [ { \"at\": \"2026-11-02T14:42:00Z\", \"label\": \"Deploy\" }, { \"at\": \"2026-11-02T15:28:00Z\", \"label\": \"Rollback\" } ],\n \"threshold\": { \"value\": 1, \"label\": \"SLO 1%\" },\n \"source\": { \"kind\": \"promql\", \"datasource\": \"prometheus\", \"query\": \"sum(rate(...))\", \"step\": \"1m\" } }\n\nIf the values are already on an even grid, send series with start and step_seconds, and marks by index. Empty steps are filled with a straight line and reported, so say so in the step when it matters.\n\n### stats: the few numbers that matter\n\nAim for four or fewer. Each has a short label, a value, a caption that says what it is measured on, and a tone. The first four are tiles in one row, so put the total first and give a tone only to the exception. Items five to eight are drawn as plain rows under the tiles. When this Tellagen lists figure_extras_v1 in server_capabilities you may also send a title (up to 80 characters) to name the tiles, for example \"Tests of the run\", and up to eight items. Pass run_id to tellagen_build_figure for this check. Without figure_extras_v1 the builder drops the title and every item after the fourth, and says so in notes, because an older Tellagen rejects them and drops the whole figure.\n\n { \"type\": \"stats\", \"items\": [ { \"label\": \"Failed e2e tests\", \"value\": \"1 of 121\", \"caption\": \"master, Oct 30\", \"tone\": \"bad\" } ] }\n\nA tile caption says what the number is measured on. The name of the source, such as \"node --test summary\", belongs in a source chip (the step's evidence refs), not in a caption.\n\n### table: a ranked list\n\nTop queries, failing routes, slowest endpoints. Give columns, then one cell per column in every row. Numbers are written as text. Keep each cell under 64 characters.\n\n### checks: pass or fail per check\n\nA recovery checklist or a CI job list. Put failures first. The block holds 12 items, so for a larger list send every failure and the checks that matter, and give the counts of the rest in the step.\n\n { \"type\": \"checks\", \"title\": \"Jobs on run 41289327533\",\n \"items\": [ { \"label\": \"Frontend Tests\", \"state\": \"fail\", \"detail\": \"1 failed of 13516\" }, { \"label\": \"E2E Tests\", \"state\": \"pass\" } ] }\n\n### changes: a value that moved\n\nA setting, a version, a limit. Each row has a label and a from, a to, or both, with an optional note.\n\n### range_overlap: ranges that meet\n\nUse it when the cause is two ranges meeting: layout offsets, a maintenance window against an error spike, memory or port ranges. Two to four rows, each with a label, a from and a to (from not above to), all in one unit.\n\n1. Read each range from a tool result: the config, the layout, the window times as numbers.\n2. Send min and max for the whole range when you want an overview strip, and every row must fall inside them. Leave out window: Tellagen zooms to the overlap.\n3. Never send the overlap itself. Tellagen computes it, and the builder tells you what it is in summary.\n\n { \"type\": \"range_overlap\", \"title\": \"Header and sticky bar\", \"unit\": \"px\",\n \"rows\": [ { \"label\": \"Header\", \"from\": 0, \"to\": 153 }, { \"label\": \"Sticky bar\", \"from\": 149, \"to\": 197 } ] }\n\n### histogram: a distribution before and after\n\nUse it when an average hides a slow tail. Send bucket counts for two equal windows. Tellagen computes p50, p95, p99 and the share over the threshold from the buckets, so never send percentiles.\n\n1. Run the bucket query on a window before the change and on one of the same length after it, for example sum by (le) (increase(http_request_duration_seconds_bucket{service=\"checkout\"}[30m])) at the end of each window.\n2. Send the result as buckets: one entry per le with the cumulative before and after counts, as Prometheus returns them, numeric strings and \"+Inf\" included.\n3. The builder turns them into edges (lower_edge, default 0, then every finite le) and one count per bucket. Observations above the last finite le have no bucket: the builder rejects them unless you set overflow to drop, and then you say so in the step.\n4. Add the SLO as threshold, in the unit of the le values.\n\n { \"type\": \"histogram\", \"title\": \"Checkout latency\", \"unit\": \"s\",\n \"buckets\": [ { \"le\": \"0.1\", \"before\": \"820\", \"after\": \"610\" }, { \"le\": \"0.5\", \"before\": \"990\", \"after\": \"800\" },\n { \"le\": \"1\", \"before\": \"1000\", \"after\": \"940\" }, { \"le\": \"+Inf\", \"before\": \"1000\", \"after\": \"940\" } ],\n \"threshold\": { \"value\": 0.5, \"label\": \"SLO 500 ms\" } }\n\nIf you already have per-bucket counts, send edges, before and after instead: before and after hold exactly one count per bucket (one fewer than edges), none negative.\n\n### run_history: CI builds, jobs, canaries or deploys\n\nUse it for a regression in CI or a bad deploy. Runs go oldest first, each with a ref, a result (success, failure, cancelled, pending), and the failing job when one failed.\n\n1. List the workflow runs of the branch around the failure: the GitHub Actions REST list, the GitHub MCP list of workflow runs, or gh run list --json number,databaseId,headSha,conclusion,status,createdAt,startedAt,event,url.\n2. Send them as github_runs, as they came. The builder maps each run: ref #run_number, the head sha, the start time, the event as trigger, the run page as url, and the conclusion as result (timed_out and startup_failure count as failure). A run whose conclusion is skipped, neutral, stale or action_required has no result: leave it out or send runs yourself. Runs are put oldest first by time.\n3. Add job to the failing runs: the name of the job that failed, from the run's jobs list.\n4. Add marks for the change that broke it (change_ref regression) and the one that fixed it (fix). Give the sha of the change and the builder places the mark before the first run built from it, or give between with the refs of the two neighbouring runs. change_ref may be a change_refs role: regression_source and first_bad become regression, fix stays fix, others become change.\n5. Set repo to owner/name so each run links to its page, and an optional span such as { \"from\": \"#4151\", \"to\": \"#4163\", \"label\": \"E2E Tests failed\" }.\n6. A history holds at most 30 runs. If yours has more, send the 30 that matter (the runs around the break and the fix, oldest first) and set runs_not_shown to how many you left out; the strip then says \"N more runs not shown.\" Only when this Tellagen lists figure_extras_v1; without it the builder drops runs_not_shown and says so in notes.\n\n { \"type\": \"run_history\", \"title\": \"E2E on master\", \"repo\": \"acme/shop\", \"branch\": \"master\",\n \"github_runs\": [ { \"run_number\": 4150, \"head_sha\": \"9f2c1e0\", \"conclusion\": \"success\", \"created_at\": \"2026-10-30T08:00:00Z\", \"event\": \"push\" },\n { \"run_number\": 4151, \"head_sha\": \"4b7a2d1\", \"conclusion\": \"failure\", \"created_at\": \"2026-10-30T09:00:00Z\", \"event\": \"push\", \"job\": \"E2E Tests\" } ],\n \"marks\": [ { \"sha\": \"4b7a2d1\", \"change_ref\": \"regression\", \"title\": \"Move the header to a sticky layout\" } ] }\n\n### diff: the change that broke or fixed it\n\nUse it for the lines of the change that broke or fixed it. A short change is sent whole.\n\n1. Read the commit or pull request file from GitHub. additions and deletions are the size of the whole change, from the commit or the pull request, never counted by you from a part of it.\n2. If the change has 12 or fewer changed lines (in at most 6 hunks), send all of them. Send the file's patch as patch: the builder keeps every line, one hunk per @@ header.\n3. If it has more, send the whole hunks the claim cites, in file order, at most 3 hunks and at most 12 changed lines in all: give their numbers in select_hunks (1 is the first @@ header). If one hunk alone is longer than 12 changed lines, the builder cuts it after a complete pair of removed and added lines.\n4. Never send a changed line without its counterpart: each removed line comes with the line that replaced it, next to it, as a patch lists them. If you write hunks yourself, keep that order and keep the indentation.\n5. When the pickup lists diff_lines_v1 in server_capabilities, a hunk may also carry up to 2 unchanged lines (op context) before and after it, and old_no and new_no (1-based) on every line. The builder adds them from the patch headers when you pass run_id. Never invent a number: if you do not have the real numbers, leave all of them out. Without diff_lines_v1 the builder sends only changed lines and no numbers, and says so in notes.\n6. Set path, ref (the commit sha) and repo.\n\n { \"type\": \"diff\", \"path\": \"web/components/Header.tsx\", \"repo\": \"acme/shop\", \"ref\": \"4b7a2d1\", \"additions\": 1, \"deletions\": 1,\n \"hunks\": [ [ { \"op\": \"-\", \"text\": \" position: static;\" }, { \"op\": \"+\", \"text\": \" position: sticky;\" } ] ] }\n\nWith diff_lines_v1 the same change, with the unchanged lines around it and the numbers of the real file:\n\n { \"type\": \"diff\", \"path\": \"web/components/Header.tsx\", \"repo\": \"acme/shop\", \"ref\": \"4b7a2d1\", \"additions\": 1, \"deletions\": 1,\n \"hunks\": [ [ { \"op\": \"context\", \"text\": \".header {\", \"old_no\": 11, \"new_no\": 11 },\n { \"op\": \"-\", \"text\": \" position: static;\", \"old_no\": 12 }, { \"op\": \"+\", \"text\": \" position: sticky;\", \"new_no\": 12 },\n { \"op\": \"context\", \"text\": \"}\", \"old_no\": 13, \"new_no\": 13 } ] ] }\n\n## Where the figure goes\n\n- A causal step: set it as figure on the step in result_summary.causal_paths. Every type except table and changes is allowed there, at most 16 KB. This needs the diagnosis structure, which the pickup advertises as diagnosis_structure_v1. A Tellagen that does not know a figure type yet drops the figure and says so in the completion warnings (figure_invalid).\n- A timeline event: put it in blocks on tellagen_post_timeline_event or tellagen_update_timeline_event. Any type is allowed, up to 12 per event. An update replaces the whole array, so send every block you want to keep, and [] clears them. Set slot to summary to draw the block above the note, or anchor to the exact heading text it sits under. Not both. Set postmortem to false to keep a block out of the postmortem.\n\nCall tellagen_build_figure with placement step_figure or timeline_block, and use the block it returns as it is.\n\n## Getting the data from other servers\n\n- Grafana or Prometheus: a range query returns time and value pairs. Send them as points. Run the same query on two equal windows for a compare.\n- Loki: a count over time by step is a trend. A count by label over two windows is a compare.\n- Prometheus histograms: the _bucket series summed by le over two equal windows are a histogram. Send them as buckets.\n- GitHub Actions: failed jobs of one run go in checks, failures first. The runs of a branch are a run_history: send the run list as github_runs.\n- GitHub commits and pull requests: the lines that broke or fixed it are a diff. Send the file's patch, and the change's additions and deletions.\n- Kubernetes: restarts or ready counts before and after are a compare, a list of pods is a table.\n\n## If Tellagen rejects a figure\n\nThe builder names the field. For a timeline block the API answers 400 invalid_block with field and details.errors. Fix exactly those fields and send once more. Do not drop a figure to get past an error unless the data in it is not real.\n";
|
|
5
|
+
export declare const FIGURE_INSTRUCTIONS = "Figures: Tellagen draws typed widgets (stats, compare, trend, table, checks, changes, range_overlap, histogram, run_history, diff, log_lines) from data you send, in the Diagnosis tab, on the timeline and in the postmortem. Use tellagen_build_figure to turn the numbers you read from a tool result into a figure Tellagen accepts: it puts a time series on an even grid of at most 500 points, turns deploy, alert and rollback times into marks, turns cumulative histogram buckets into bucket counts, maps a GitHub Actions run list to a run history, picks the log lines of a Loki result (log_lines), and enforces every limit. Attach the result as a causal step's figure or as a block on a timeline event. A figure owns its numbers: never repeat them in prose, never invent one, and keep units in the unit field. Read resource://tellagen/figure-guide to choose the widget that fits the question and to learn how to plot data on it.";
|
|
6
|
+
export declare const FIGURE_GUIDE = "# Tellagen figures\n\nA figure is a small typed widget that Tellagen draws for you. You send the data. Tellagen draws it the same way in the Diagnosis tab, on the timeline and in the postmortem, and a responder can pin one from one place to another.\n\nUse tellagen_build_figure to make one. It reshapes the numbers you already read from a tool result and checks them against Tellagen's limits before you send anything. It has no data of its own.\n\n## Rules every figure follows\n\n1. A figure owns its numbers. The sentence next to it says what happened and why. It does not repeat the numbers.\n2. Never invent a number. Every value comes from a tool result you can cite. If you do not have the value, leave that row, figure or block out.\n3. Units go in the unit field, once. Do not put them inside a number, and do not repeat them in every label.\n4. One figure per causal step, under the step it proves. A step with no good figure carries none.\n5. Say where the data came from. A trend carries its query in source. For other figures, cite the tool result in the step's evidence refs.\n6. A tone is a meaning, not emphasis: good for healthy or recovered, warn for needs attention, bad for failing, neutral for a plain fact.\n7. The limits below are enforced. A figure over a limit is rejected with the field named. Shorten the data yourself. Do not expect it to be trimmed.\n\n## Pick the widget by the question\n\n| The question | Widget | Step figure | Timeline block | Limits |\n| --- | --- | --- | --- | --- |\n| What are the few numbers that matter? | stats | yes | yes | 1 to 8 items (4 or fewer is best), title 80, label 48, value 32, caption 64 |\n| Did it get better, and is it inside the line? | compare | yes | yes | 1 to 8 rows, 3 details per row |\n| When did it start, and what happened around then? | trend | yes | yes | 2 to 500 points, 3 marks |\n| Which items rank highest? | table | no | yes | 1 to 6 columns, 1 to 12 rows, cell 64 |\n| Which checks passed, failed or did not run? | checks | yes | yes | 1 to 12 items, label 80, detail 160 |\n| What moved from one thing to another? | changes | no | yes | 1 to 8 rows, from and to 80, note 160 |\n| Where do two or more ranges meet? | range_overlap | yes | yes | 2 to 4 rows, label 80, unit 12 |\n| Did the slow tail move, when the average did not? | histogram | yes | yes | 3 to 61 edges (2 to 60 buckets), one count per bucket |\n| Which build broke, and which fixed it? | run_history | yes | yes | 2 to 30 runs, runs_not_shown, 4 marks, ref 80, sha 64, job 80, url 500 |\n| What exactly changed in the code? | diff | yes | yes | path 200, ref 64, 1 to 6 hunks, 12 changed lines in all, line 160 |\n| Which log lines prove it, or show there are none? | log_lines | yes | yes | 0 to 8 lines, line text 500, 6 fields, note 160, matched and scanned up to 1,000,000,000 |\n\n## How to plot data on each widget\n\n### compare: before and after\n\nUse it for a value measured before and after a deploy, rollback, fix or config change. One row per host, route, query or job, biggest movers first.\n\n1. Pick two windows of the same length, one before the change and one after. Run the same query on both.\n2. Take one number per row from each window, for example the p95 over the window.\n3. Set unit once. Set better to lower or higher. Add a threshold for the SLO or alert line.\n\n { \"type\": \"compare\", \"title\": \"p95 latency by route\", \"unit\": \"ms\", \"better\": \"lower\",\n \"threshold\": { \"value\": 500, \"label\": \"SLO 500 ms\" },\n \"rows\": [ { \"label\": \"POST /checkout\", \"before\": 180, \"after\": 640 },\n { \"label\": \"GET /cart\", \"before\": 95, \"after\": 110 } ] }\n\nA row may also be measured against a limit or a budget (a page-weight budget, a connection cap): when the pickup lists figure_limits_v1 in server_capabilities, send {\"label\": \"Checkout bundle\", \"after\": 7908, \"limit\": 7500} and leave before out. Never put a limit or a budget in before: a row that reads 7,680 before and 7,908 after, where 7,680 is the budget, says the value grew when it only crossed a line. The builder drops the limit and says so in notes when the pickup does not list figure_limits_v1, and then the row needs a before.\n\nA figure shows the fact its step states. Do not put a table of jobs under a step that the jobs do not prove, and keep the run, job and commit ids in links, not in the title or a label.\n\nA distribution is a compare of percentiles: use p50, p95 and p99 as rows, with the SLO as the threshold.\n\n### trend: a series over time\n\nUse it when the evidence is how a value moved. Send the raw samples as points and the times of the events that explain the shape as events.\n\n1. Run a range query. Keep the time and the value of every sample.\n2. Send them as points with t and v. t is an ISO time or Unix time in seconds or milliseconds. v may be a numeric string, as Prometheus returns it. A null or NaN is skipped.\n3. Tellagen puts the points on an even grid of at most max_points (default 240, most 500) and sets start and step_seconds. Samples that share a step combine with reduce. Use max for error rate and latency so a spike survives, mean for a smooth rate.\n4. Add up to three events: a deploy, an alert, a rollback. They become marks at the right index. An event outside the range is left out and reported.\n5. Fill source with kind, datasource, query and step.\n\n { \"type\": \"trend\", \"title\": \"5xx share of requests\", \"unit\": \"%\", \"reduce\": \"max\",\n \"points\": [ { \"t\": \"2026-11-02T14:00:00Z\", \"v\": \"0.24\" }, { \"t\": \"2026-11-02T14:01:00Z\", \"v\": \"0.27\" } ],\n \"events\": [ { \"at\": \"2026-11-02T14:42:00Z\", \"label\": \"Deploy\" }, { \"at\": \"2026-11-02T15:28:00Z\", \"label\": \"Rollback\" } ],\n \"threshold\": { \"value\": 1, \"label\": \"SLO 1%\" },\n \"source\": { \"kind\": \"promql\", \"datasource\": \"prometheus\", \"query\": \"sum(rate(...))\", \"step\": \"1m\" } }\n\nIf the values are already on an even grid, send series with start and step_seconds, and marks by index. Empty steps are filled with a straight line and reported, so say so in the step when it matters.\n\n### stats: the few numbers that matter\n\nAim for four or fewer. Each has a short label, a value, a caption that says what it is measured on, and a tone. The first four are tiles in one row, so put the total first and give a tone only to the exception. Items five to eight are drawn as plain rows under the tiles. When this Tellagen lists figure_extras_v1 in server_capabilities you may also send a title (up to 80 characters) to name the tiles, for example \"Tests of the run\", and up to eight items. Pass run_id to tellagen_build_figure for this check. Without figure_extras_v1 the builder drops the title and every item after the fourth, and says so in notes, because an older Tellagen rejects them and drops the whole figure.\n\n { \"type\": \"stats\", \"items\": [ { \"label\": \"Failed e2e tests\", \"value\": \"1 of 121\", \"caption\": \"master, Oct 30\", \"tone\": \"bad\" } ] }\n\nA tile caption says what the number is measured on. The name of the source, such as \"node --test summary\", belongs in a source chip (the step's evidence refs), not in a caption.\n\n### table: a ranked list\n\nTop queries, failing routes, slowest endpoints. Give columns, then one cell per column in every row. Numbers are written as text. Keep each cell under 64 characters.\n\n### checks: pass or fail per check\n\nA recovery checklist or a CI job list. Put failures first. The block holds 12 items, so for a larger list send every failure and the checks that matter, and give the counts of the rest in the step.\n\n { \"type\": \"checks\", \"title\": \"Jobs of the failing run\",\n \"items\": [ { \"label\": \"Frontend Tests\", \"state\": \"fail\", \"detail\": \"1 failed of 13516\" }, { \"label\": \"E2E Tests\", \"state\": \"pass\" } ] }\n\n### changes: a value that moved\n\nA setting, a version, a limit. Each row has a label and a from, a to, or both, with an optional note.\n\n### range_overlap: ranges that meet\n\nUse it when the cause is two ranges meeting: layout offsets, a maintenance window against an error spike, memory or port ranges. Two to four rows, each with a label, a from and a to (from not above to), all in one unit.\n\n1. Read each range from a tool result: the config, the layout, the window times as numbers.\n2. Send min and max for the whole range when you want an overview strip, and every row must fall inside them. Leave out window: Tellagen zooms to the overlap.\n3. Never send the overlap itself. Tellagen computes it, and the builder tells you what it is in summary.\n\n { \"type\": \"range_overlap\", \"title\": \"Header and sticky bar\", \"unit\": \"px\",\n \"rows\": [ { \"label\": \"Header\", \"from\": 0, \"to\": 153 }, { \"label\": \"Sticky bar\", \"from\": 149, \"to\": 197 } ] }\n\n### histogram: a distribution before and after\n\nUse it when an average hides a slow tail. Send bucket counts for two equal windows. Tellagen computes p50, p95, p99 and the share over the threshold from the buckets, so never send percentiles.\n\n1. Run the bucket query on a window before the change and on one of the same length after it, for example sum by (le) (increase(http_request_duration_seconds_bucket{service=\"checkout\"}[30m])) at the end of each window.\n2. Send the result as buckets: one entry per le with the cumulative before and after counts, as Prometheus returns them, numeric strings and \"+Inf\" included.\n3. The builder turns them into edges (lower_edge, default 0, then every finite le) and one count per bucket. Observations above the last finite le have no bucket: the builder rejects them unless you set overflow to drop, and then you say so in the step.\n4. Add the SLO as threshold, in the unit of the le values.\n\n { \"type\": \"histogram\", \"title\": \"Checkout latency\", \"unit\": \"s\",\n \"buckets\": [ { \"le\": \"0.1\", \"before\": \"820\", \"after\": \"610\" }, { \"le\": \"0.5\", \"before\": \"990\", \"after\": \"800\" },\n { \"le\": \"1\", \"before\": \"1000\", \"after\": \"940\" }, { \"le\": \"+Inf\", \"before\": \"1000\", \"after\": \"940\" } ],\n \"threshold\": { \"value\": 0.5, \"label\": \"SLO 500 ms\" } }\n\nIf you already have per-bucket counts, send edges, before and after instead: before and after hold exactly one count per bucket (one fewer than edges), none negative.\n\n### run_history: CI builds, jobs, canaries or deploys\n\nUse it for a regression in CI or a bad deploy. Runs go oldest first, each with a ref, a result (success, failure, cancelled, pending), and the failing job when one failed.\n\n1. List the workflow runs of the branch around the failure: the GitHub Actions REST list, the GitHub MCP list of workflow runs, or gh run list --json number,databaseId,headSha,conclusion,status,createdAt,startedAt,event,url.\n2. Send them as github_runs, as they came. The builder maps each run: ref #run_number, the head sha, the start time, the event as trigger, the run page as url, and the conclusion as result (timed_out and startup_failure count as failure). A run whose conclusion is skipped, neutral, stale or action_required has no result: leave it out or send runs yourself. Runs are put oldest first by time.\n3. Add job to the failing runs: the name of the job that failed, from the run's jobs list.\n4. Add marks for the change that broke it (change_ref regression) and the one that fixed it (fix). Give the sha of the change and the builder places the mark before the first run built from it, or give between with the refs of the two neighbouring runs. change_ref may be a change_refs role: regression_source and first_bad become regression, fix stays fix, others become change.\n5. Set repo to owner/name so each run links to its page, and an optional span such as { \"from\": \"#4151\", \"to\": \"#4163\", \"label\": \"E2E Tests failed\" }.\n6. A history holds at most 30 runs. If yours has more, send the 30 that matter (the runs around the break and the fix, oldest first) and set runs_not_shown to how many you left out; the strip then says \"N more runs not shown.\" Only when this Tellagen lists figure_extras_v1; without it the builder drops runs_not_shown and says so in notes.\n\n { \"type\": \"run_history\", \"title\": \"E2E on master\", \"repo\": \"acme/shop\", \"branch\": \"master\",\n \"github_runs\": [ { \"run_number\": 4150, \"head_sha\": \"9f2c1e0\", \"conclusion\": \"success\", \"created_at\": \"2026-10-30T08:00:00Z\", \"event\": \"push\" },\n { \"run_number\": 4151, \"head_sha\": \"4b7a2d1\", \"conclusion\": \"failure\", \"created_at\": \"2026-10-30T09:00:00Z\", \"event\": \"push\", \"job\": \"E2E Tests\" } ],\n \"marks\": [ { \"sha\": \"4b7a2d1\", \"change_ref\": \"regression\", \"title\": \"Move the header to a sticky layout\" } ] }\n\n### diff: the change that broke or fixed it\n\nUse it for the lines of the change that broke or fixed it. A short change is sent whole.\n\n1. Read the commit or pull request file from GitHub. additions and deletions are the size of the whole change, from the commit or the pull request, never counted by you from a part of it.\n2. If the change has 12 or fewer changed lines (in at most 6 hunks), send all of them. Send the file's patch as patch: the builder keeps every line, one hunk per @@ header.\n3. If it has more, send the whole hunks the claim cites, in file order, at most 3 hunks and at most 12 changed lines in all: give their numbers in select_hunks (1 is the first @@ header). If one hunk alone is longer than 12 changed lines, the builder cuts it after a complete pair of removed and added lines.\n4. Never send a changed line without its counterpart: each removed line comes with the line that replaced it, next to it, as a patch lists them. If you write hunks yourself, keep that order and keep the indentation.\n5. When the pickup lists diff_lines_v1 in server_capabilities, a hunk may also carry up to 2 unchanged lines (op context) before and after it, and old_no and new_no (1-based) on every line. The builder adds them from the patch headers when you pass run_id. Never invent a number: if you do not have the real numbers, leave all of them out. Without diff_lines_v1 the builder sends only changed lines and no numbers, and says so in notes.\n6. Set path, ref (the commit sha) and repo.\n\n { \"type\": \"diff\", \"path\": \"web/components/Header.tsx\", \"repo\": \"acme/shop\", \"ref\": \"4b7a2d1\", \"additions\": 1, \"deletions\": 1,\n \"hunks\": [ [ { \"op\": \"-\", \"text\": \" position: static;\" }, { \"op\": \"+\", \"text\": \" position: sticky;\" } ] ] }\n\nWith diff_lines_v1 the same change, with the unchanged lines around it and the numbers of the real file:\n\n { \"type\": \"diff\", \"path\": \"web/components/Header.tsx\", \"repo\": \"acme/shop\", \"ref\": \"4b7a2d1\", \"additions\": 1, \"deletions\": 1,\n \"hunks\": [ [ { \"op\": \"context\", \"text\": \".header {\", \"old_no\": 11, \"new_no\": 11 },\n { \"op\": \"-\", \"text\": \" position: static;\", \"old_no\": 12 }, { \"op\": \"+\", \"text\": \" position: sticky;\", \"new_no\": 12 },\n { \"op\": \"context\", \"text\": \"}\", \"old_no\": 13, \"new_no\": 13 } ] ] }\n\n### log_lines: the log lines that prove a claim, or that there are none\n\nUse it for log evidence instead of a stats tile: the lines themselves, how many lines matched out of how many were scanned, and the range that was searched. It needs log_lines_v1 in server_capabilities. Pass run_id so the builder can check this, and so it can use the run window as the default range.\n\n1. Run the Loki query over a range inside the run window. Keep the whole result, with the stream labels.\n2. Send it as streams (the Loki result as returned: [{ stream: { labels }, values: [[ns, line]] }]) or as entries ([{ timestamp, line, labels }]), with query, datasource, from and to. Never write a line yourself: the builder takes only lines that are in the result.\n3. The builder keeps at most 8 lines, the ones that show the event first, and reads each level from a stream label, from the JSON or logfmt of the line, or from a word at its start. Text is kept as logged: it only loses colour codes and secrets, and line breaks become a mark.\n4. matched is the number of lines the query matched in the range. It defaults to the lines you sent, so send matched when the query had a limit. scanned is the number of lines the query looked at (query_loki_stats gives it). The builder works out lines_not_shown.\n5. Say which lines show the event: match lists the terms that mark a line matches_event. Mark a line that looks like proof and is not with marks, for example a line of another tenant, company or request: { \"field\": { \"key\": \"company_id\", \"value\": \"578\" }, \"relation\": \"unrelated\", \"note\": \"Company 578, 11 hours after the event\" }. An unrelated line stays in the figure, with its note, so a reader can see why it is not proof. Never use the text of an unrelated line as the quote of a finding.\n6. A query that found nothing is proof only with its range. Send matched 0 with scanned, from and to: 0 of 2,313 lines from 00:26 to 01:26 says something, an empty list with no range does not. Send streams as an empty list.\n7. Set event_at to the moment of the event, so the page can say how far a line is from it.\n\n { \"type\": \"log_lines\", \"title\": \"Errors from the worker\", \"query\": \"{app=\\\"worker\\\"} |= \\\"timeout\\\"\", \"datasource\": \"loki\",\n \"from\": \"2026-11-14T00:11:00Z\", \"to\": \"2026-11-14T01:26:00Z\", \"event_at\": \"2026-11-14T00:41:00Z\", \"scanned\": 2313,\n \"streams\": [ { \"stream\": { \"app\": \"worker\", \"pod\": \"worker-7\" }, \"values\": [ [ \"1794010860000000000\", \"level=error msg=\\\"upstream timeout\\\" task=sync\" ] ] } ],\n \"match\": [ \"upstream timeout\" ] }\n\n## Where the figure goes\n\n- A causal step: set it as figure on the step in result_summary.causal_paths. Every type except table and changes is allowed there, at most 16 KB (48 KB for log_lines). This needs the diagnosis structure, which the pickup advertises as diagnosis_structure_v1. A Tellagen that does not list log_lines_v1 drops a log_lines figure, so the builder refuses to make one. A Tellagen that does not know a figure type yet drops the figure and says so in the completion warnings (figure_invalid).\n- A timeline event: put it in blocks on tellagen_post_timeline_event or tellagen_update_timeline_event. Any type is allowed, up to 12 per event. An update replaces the whole array, so send every block you want to keep, and [] clears them. Set slot to summary to draw the block above the note, or anchor to the exact heading text it sits under. Not both. Set postmortem to false to keep a block out of the postmortem.\n\nCall tellagen_build_figure with placement step_figure or timeline_block, and use the block it returns as it is.\n\n## Getting the data from other servers\n\n- Grafana or Prometheus: a range query returns time and value pairs. Send them as points. Run the same query on two equal windows for a compare.\n- Loki: a count over time by step is a trend. A count by label over two windows is a compare. The lines of a query result are a log_lines figure, and it is better than a stats tile for log evidence, because the reader can read the lines.\n- Prometheus histograms: the _bucket series summed by le over two equal windows are a histogram. Send them as buckets.\n- GitHub Actions: failed jobs of one run go in checks, failures first. The runs of a branch are a run_history: send the run list as github_runs.\n- GitHub commits and pull requests: the lines that broke or fixed it are a diff. Send the file's patch, and the change's additions and deletions.\n- Kubernetes: restarts or ready counts before and after are a compare, a list of pods is a table.\n\n## If Tellagen rejects a figure\n\nThe builder names the field. For a timeline block the API answers 400 invalid_block with field and details.errors. Fix exactly those fields and send once more. Do not drop a figure to get past an error unless the data in it is not real.\n";
|
|
7
7
|
export declare function registerFigureTools(server: McpServer, client: TellagenClient): void;
|
|
8
8
|
/** Registered from createServer, next to the other resources. */
|
|
9
9
|
export declare function registerFigureResource(server: McpServer): void;
|