@tellagen/mcp-server 0.6.0 → 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 +26 -2
- package/SKILL.md +106 -19
- package/contracts/mcp-protocol.json +52 -3
- package/contracts/runbooks/manifest.json +10 -10
- package/contracts/runbooks/v2/client-protocol.json +6 -0
- package/contracts/runbooks/v2/fixtures/filesystem-pressure.json +22 -31
- package/contracts/runbooks/v2/result-summary.guidance.json +53 -5
- package/contracts/runbooks/v2/timeline-event-blocks.schema.json +4 -2
- 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 +2 -2
- package/dist/cli/doctor.js +2 -35
- package/dist/cli/doctor.js.map +1 -1
- 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 +5 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/diagnosis-structure.d.ts +277 -24
- package/dist/diagnosis-structure.js +273 -8
- package/dist/diagnosis-structure.js.map +1 -1
- package/dist/doctor/checks.js +8 -2
- package/dist/doctor/checks.js.map +1 -1
- 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/figures.d.ts +121 -26
- package/dist/figures.js +44 -2
- 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 +2 -2
- package/dist/k8s-safety.js +2 -2
- package/dist/k8s-safety.js.map +1 -1
- 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/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/server.d.ts +1 -1
- package/dist/server.js +10 -8
- 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/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 +3 -0
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/diagnostics.js +57 -12
- package/dist/tools/diagnostics.js.map +1 -1
- package/dist/tools/figures.d.ts +1 -1
- package/dist/tools/figures.js +12 -6
- package/dist/tools/figures.js.map +1 -1
- package/dist/tools/findings.d.ts +128 -0
- package/dist/tools/findings.js +6 -6
- 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 +3222 -4
- package/dist/tools/investigations.js +174 -61
- 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/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/timeline.js +13 -2
- package/dist/tools/timeline.js.map +1 -1
- package/dist/version.d.ts +4 -2
- package/dist/version.js +4 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
|
@@ -19,17 +19,6 @@
|
|
|
19
19
|
"capabilities": ["repos:read"],
|
|
20
20
|
"required": true,
|
|
21
21
|
"on_unavailable": {"action": "record_gap"}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "host-filesystem",
|
|
25
|
-
"source_key": "local_host",
|
|
26
|
-
"capabilities": [
|
|
27
|
-
"host:filesystem_inventory",
|
|
28
|
-
"host:path_mount_mapping",
|
|
29
|
-
"host:filesystem_consumers"
|
|
30
|
-
],
|
|
31
|
-
"required": true,
|
|
32
|
-
"on_unavailable": {"action": "record_gap"}
|
|
33
22
|
}
|
|
34
23
|
],
|
|
35
24
|
"entry_check_ids": ["identify-alert-filesystem"],
|
|
@@ -82,44 +71,46 @@
|
|
|
82
71
|
},
|
|
83
72
|
{
|
|
84
73
|
"id": "map-runtime-filesystems",
|
|
85
|
-
"intent": "Map the alerted filesystem and every suspected service storage path to
|
|
86
|
-
"source_requirement_id": "
|
|
74
|
+
"intent": "Map the alerted filesystem and every suspected service storage path to host, device, and mountpoint identities with the node-exporter filesystem series",
|
|
75
|
+
"source_requirement_id": "filesystem-metrics",
|
|
87
76
|
"safety": "read_only",
|
|
88
77
|
"invocation": {
|
|
89
78
|
"kind": "query",
|
|
90
|
-
"capability": "
|
|
91
|
-
"template": "
|
|
92
|
-
"parameters": {
|
|
93
|
-
|
|
79
|
+
"capability": "prometheus:query",
|
|
80
|
+
"template": "node_filesystem_size_bytes{fstype=~\"ext4|xfs\"}",
|
|
81
|
+
"parameters": {
|
|
82
|
+
"time_range": {"type": "time_range", "source": "incident.time_range", "target": "request.range"}
|
|
83
|
+
},
|
|
84
|
+
"bounds": {"lookback": "30m", "step": "5m", "max_points": 6}
|
|
94
85
|
},
|
|
95
86
|
"evidence_contract": {
|
|
96
|
-
"kind": "
|
|
97
|
-
"required_fields": ["artifact", "query", "resource_identity", "join_basis", "result_summary"]
|
|
87
|
+
"kind": "timeseries",
|
|
88
|
+
"required_fields": ["artifact", "query", "time_range", "resource_identity", "join_basis", "result_summary"]
|
|
98
89
|
},
|
|
99
|
-
"confirms_when": "The suspected consumer maps to the same host, device, and mountpoint as the alert, with the join keys recorded",
|
|
100
|
-
"falsifies_when": "The suspected consumer
|
|
90
|
+
"confirms_when": "The suspected consumer's storage path maps to the same host, device, and mountpoint as the alert, with the join keys recorded",
|
|
91
|
+
"falsifies_when": "The documented storage path of the suspected consumer maps to a different device or mountpoint on the alerting host",
|
|
101
92
|
"on_confirm": ["find-alerted-filesystem-consumers"],
|
|
102
93
|
"on_falsify": ["find-alerted-filesystem-consumers"],
|
|
103
94
|
"on_error": {"action": "record_gap"}
|
|
104
95
|
},
|
|
105
96
|
{
|
|
106
97
|
"id": "find-alerted-filesystem-consumers",
|
|
107
|
-
"intent": "Identify
|
|
108
|
-
"source_requirement_id": "
|
|
98
|
+
"intent": "Identify the documented consumers of the alerted filesystem from the infrastructure documentation. Tellagen does not read the host itself, so a consumer the documentation does not name stays a gap finding",
|
|
99
|
+
"source_requirement_id": "infrastructure-docs",
|
|
109
100
|
"safety": "read_only",
|
|
110
101
|
"invocation": {
|
|
111
102
|
"kind": "query",
|
|
112
|
-
"capability": "
|
|
113
|
-
"template": "
|
|
103
|
+
"capability": "repos:read",
|
|
104
|
+
"template": "Read the configured infrastructure repository for the services, volumes, and storage paths that sit on the alerted host and mountpoint. Return the documented consumers with their paths. Do not read credentials, configuration values, or environment files.",
|
|
114
105
|
"parameters": {},
|
|
115
106
|
"bounds": {"lookback": "5m", "step": "5m", "max_points": 1}
|
|
116
107
|
},
|
|
117
108
|
"evidence_contract": {
|
|
118
|
-
"kind": "
|
|
119
|
-
"required_fields": ["artifact", "query", "
|
|
109
|
+
"kind": "document",
|
|
110
|
+
"required_fields": ["artifact", "query", "result_summary"]
|
|
120
111
|
},
|
|
121
|
-
"confirms_when": "
|
|
122
|
-
"falsifies_when": "
|
|
112
|
+
"confirms_when": "The documentation names one or more consumers whose storage is on the alerted filesystem",
|
|
113
|
+
"falsifies_when": "The documentation shows that no documented consumer stores data on the alerted filesystem",
|
|
123
114
|
"on_confirm": ["verify-filesystem-headroom"],
|
|
124
115
|
"on_falsify": ["verify-filesystem-headroom"],
|
|
125
116
|
"on_error": {"action": "record_gap"}
|
|
@@ -150,13 +141,13 @@
|
|
|
150
141
|
}
|
|
151
142
|
],
|
|
152
143
|
"escalation": {
|
|
153
|
-
"when": "Runtime topology is unavailable, resource identities do not match, or no
|
|
144
|
+
"when": "Runtime topology is unavailable, resource identities do not match, or no documented consumer explains the alert. Post a gap finding that says the host was not inspected",
|
|
154
145
|
"target": "infrastructure owner and incident commander"
|
|
155
146
|
},
|
|
156
147
|
"remediation": {
|
|
157
148
|
"mode": "suggest_only",
|
|
158
149
|
"proposed_steps": [
|
|
159
|
-
"Ask the infrastructure owner to
|
|
150
|
+
"Ask the infrastructure owner to inspect the alerted filesystem on the host and approve a reversible cleanup target.",
|
|
160
151
|
"Treat service storage or WAL failures on a different filesystem as a separate remediation task with its own owner and verification."
|
|
161
152
|
],
|
|
162
153
|
"approval_required": true,
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "Investigation result: the
|
|
3
|
-
"description": "How to write the
|
|
4
|
-
"x-limits": {
|
|
2
|
+
"title": "Investigation result: the words a responder reads",
|
|
3
|
+
"description": "How to write the text a responder reads in the result of an investigation run: the headline claim (conclusion.summary, stored as the verdict), the answer line, the blocking question and every claim, summary, action and explanation. The server accepts any text. It adds the advice warnings headline_too_long, question_not_a_question, text_too_long, filler_phrase and raw_id_in_text (and coverage_not_needed_without_reason) to the completion response and to the run's quality_warnings, and never rejects the result for them. A dry run (completion_repairs_v1) lists each text warning as a repair with advice true: ready stays true, because the run would complete as it is. They apply whether or not the client advertised diagnosis_structure_v1.",
|
|
4
|
+
"x-limits": {
|
|
5
|
+
"headline_max_words": 15,
|
|
6
|
+
"answer_max_words": 15,
|
|
7
|
+
"step_claim_max_words": 20,
|
|
8
|
+
"finding_claim_max_words": 20,
|
|
9
|
+
"finding_evidence_summary_max_words": 60,
|
|
10
|
+
"action_title_max_words": 12,
|
|
11
|
+
"action_summary_max_words": 20,
|
|
12
|
+
"ruled_out_explanation_max_words": 30,
|
|
13
|
+
"coverage_summary_max_words": 20,
|
|
14
|
+
"unknown_label_max_words": 12,
|
|
15
|
+
"customer_impact_label_max_words": 15
|
|
16
|
+
},
|
|
5
17
|
"x-guidance": [
|
|
6
18
|
"The headline claim states one cause in at most 15 words. Name what broke and why, in plain words. Put the detail, the numbers and the other possible causes in findings, causal_paths and ruled_out, not in the headline.",
|
|
7
19
|
"A blocking question is a gap finding that a person has to answer before the diagnosis can be trusted. Write its claim as one real question that ends with a question mark and that a person with access to the system can answer with a fact. Do not write it as a statement about what is unknown.",
|
|
8
20
|
"Ask one thing in a blocking question. If you have two questions, post two gap findings. Put what you already checked in the evidence summary, not in the question.",
|
|
9
|
-
"If the headline is over 15 words, completion answers with the warning headline_too_long and keeps the result. If a blocking question does not end with a question mark, completion answers with question_not_a_question and keeps the result. Fix the sentence and send the result again when you can; the run is not failed either way."
|
|
21
|
+
"If the headline is over 15 words, completion answers with the warning headline_too_long and keeps the result. If a blocking question does not end with a question mark, completion answers with question_not_a_question and keeps the result. Fix the sentence and send the result again when you can; the run is not failed either way.",
|
|
22
|
+
"Keep every sentence short. The limits in words are: answer 15, claim of a causal step 20, claim of a finding 20, evidence summary of a finding 60 (three sentences at most), action title 12, action summary 20, ruled-out explanation 30, coverage summary or reason 20, unknown label 12, customer impact label 15. A text over its limit completes with the warning text_too_long, which names the path, the count and the limit; the page folds it behind Show more.",
|
|
23
|
+
"Do not repeat a rule of this protocol in your text. The page shows who decides.",
|
|
24
|
+
"The phrases in x-banned-phrase-openers are filler only at the start of a sentence: a sentence that opens with Based on the is flagged, a fact that says the threshold is based on the p99 latency is not.",
|
|
25
|
+
"A finding states a fact. Do not write in the first person; a source you did not read is a coverage entry, not a sentence.",
|
|
26
|
+
"Do not put a raw id in a sentence: a number of 9 digits or more, such as a run or job number, or a hex string of 12 characters or more. Put the id in links and name the thing in words. A short commit id of 7 characters or a pull request number such as #421 is fine. A long number followed by a unit word, such as 107374182400 bytes, is a measurement and is fine. The warning is raw_id_in_text.",
|
|
27
|
+
"When the run's question asks what to do, write result_summary.answer: one plain sentence of at most 15 words that answers it directly. Leave it out when the run had no question beyond the default. When an action changes a file, add a diff figure of the exact lines to the action (recommended_actions[].figure). Both need the server capability action_answer_v1.",
|
|
28
|
+
"A source you skipped on purpose is a coverage entry in state not_needed with a reason of at most 20 words (coverage_not_needed_v1). It is not checked, and it is not a gap. Never send checked for a source nobody read.",
|
|
29
|
+
"In a compare figure, never put a limit or a budget in before. Give the row its own limit instead (figure_limits_v1): the row then reads after against limit and needs no before."
|
|
10
30
|
],
|
|
11
31
|
"x-examples": {
|
|
12
32
|
"headline": {
|
|
@@ -16,6 +36,34 @@
|
|
|
16
36
|
"blocking_question": {
|
|
17
37
|
"good": "Did the 14:02 deploy of the billing service lower the retry limit?",
|
|
18
38
|
"bad": "Whether the retry limit was lowered by the 14:02 deploy of the billing service could not be established from the available data and needs to be confirmed by someone with access to the deploy history."
|
|
39
|
+
},
|
|
40
|
+
"answer": {
|
|
41
|
+
"good": "Keep the P1 alert for master. Stop paging for pull requests.",
|
|
42
|
+
"bad": "Based on the investigation, I recommend that the team considers whether the alert should be moved to a lower priority or removed."
|
|
43
|
+
},
|
|
44
|
+
"finding_evidence_summary": {
|
|
45
|
+
"good": "The pool reached 100 of 100 connections at 14:02. Errors began 40 seconds later. The pool recovered after the restart at 14:20.",
|
|
46
|
+
"bad": "Run 43852571837 failed. I could not find a written paging policy. This is a proposal. A person decides."
|
|
19
47
|
}
|
|
20
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"x-banned-phrases": [
|
|
50
|
+
"This is a proposal. A person decides.",
|
|
51
|
+
"A person decides",
|
|
52
|
+
"Only a person can",
|
|
53
|
+
"Based on the",
|
|
54
|
+
"It is likely that",
|
|
55
|
+
"It is worth noting",
|
|
56
|
+
"Please note",
|
|
57
|
+
"I could not find",
|
|
58
|
+
"I did not",
|
|
59
|
+
"in the data I read",
|
|
60
|
+
"Not queried on purpose",
|
|
61
|
+
"Investigation complete"
|
|
62
|
+
],
|
|
63
|
+
"x-banned-phrase-openers": [
|
|
64
|
+
"Based on the",
|
|
65
|
+
"It is likely that",
|
|
66
|
+
"It is worth noting",
|
|
67
|
+
"Please note"
|
|
68
|
+
]
|
|
21
69
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "The blocks field of a timeline event: typed widgets that hold the numbers behind a note. Send it with the REST timeline create (POST /api/v1/incidents/{id}/timeline) or update (PATCH /api/v1/timeline/{id}); the MCP tools tellagen_post_timeline_event and tellagen_update_timeline_event pass it through. The server validates every block and answers one bad block with 400 invalid_block, a message, the path of the first bad field in field and up to ten bad fields in details.errors. An update that sends blocks replaces the whole array; [] removes them; leaving the field out keeps them. Strings are trimmed, one line and free of control characters (only source.query may hold line breaks; a diff line's text is the one string that is not trimmed, so it keeps its indentation, and it may hold tabs). The same blocks, except table and changes, are the figure of a Diagnosis chain step (causal_paths[].steps[].figure). Numbers are finite and between -1e12 and 1e12. An event carries at most 12 blocks and 64 KB of block JSON.",
|
|
6
6
|
"x-guidance": [
|
|
7
7
|
"Put the few numbers a responder scans for in one stats block, each with a short label, a value, a caption that says what it is measured on, and a tone. Send at most four when you can: the first four are drawn as tiles in one row, the total first, and colour goes only on the exception. A block may hold up to eight figures, and the web draws the ones after the fourth as plain rows under the tiles. Give the block a title of at most 80 characters when the tiles need a name. A title and more than four figures are optional, and a client that picked up a run sends them only when server_capabilities lists figure_extras_v1. In the figure of a Diagnosis step, a source name such as a test runner summary belongs in a source chip (the step's evidence), not in a tile caption.",
|
|
8
|
-
"Use a compare block for a metric that has a value before, a value after and a threshold (an SLO or alert line). Give the unit, say which direction is better, and put one row per host, route or query.",
|
|
8
|
+
"Use a compare block for a metric that has a value before, a value after and a threshold (an SLO or alert line). Give the unit, say which direction is better, and put one row per host, route or query. Never put a limit, a budget or a threshold in before: before is what the value was earlier. When each row has its own limit (a page length against its budget), give the row a limit and leave before out, so the row reads after against limit. A client that picked up a run sends limit only when server_capabilities lists figure_limits_v1.",
|
|
9
9
|
"Use a trend block for a series over time. Send start and step_seconds together, reduce the range to at most 500 points, add at most three marks for the events that explain the shape, and fill source with the query that produced the series (kind, datasource, query, step, and artifact_id when you have it).",
|
|
10
10
|
"Use a table block for a ranked list (top queries, failing routes), a checks block for a recovery checklist with a result per check, and a changes block for a value that moved from one thing to another.",
|
|
11
11
|
"Use a range_overlap block when the cause is two ranges meeting (layout offsets, a maintenance window against an error spike, memory or port ranges): two to four rows with a from and a to, in one unit. Tellagen computes the overlap and zooms to it; send min and max for the whole range, and a window only to choose the zoom yourself.",
|
|
@@ -123,12 +123,14 @@
|
|
|
123
123
|
"items": {
|
|
124
124
|
"type": "object",
|
|
125
125
|
"additionalProperties": false,
|
|
126
|
-
"required": ["label", "
|
|
126
|
+
"required": ["label", "after"],
|
|
127
|
+
"anyOf": [{"required": ["before"]}, {"required": ["limit"]}],
|
|
127
128
|
"properties": {
|
|
128
129
|
"label": {"type": "string", "minLength": 1, "maxLength": 80},
|
|
129
130
|
"mono": {"type": "boolean"},
|
|
130
131
|
"before": {"$ref": "#/$defs/number"},
|
|
131
132
|
"after": {"$ref": "#/$defs/number"},
|
|
133
|
+
"limit": {"$ref": "#/$defs/number"},
|
|
132
134
|
"details": {
|
|
133
135
|
"type": "array",
|
|
134
136
|
"maxItems": 3,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"upstream_repository": "https://github.com/tellagen/tellagen",
|
|
3
|
-
"upstream_commit": "
|
|
3
|
+
"upstream_commit": "8af893562cfb80bed9ad5bacc5844d150feedb0e",
|
|
4
4
|
"upstream_worktree_dirty": false,
|
|
5
|
-
"contract_version": "2026-11-
|
|
6
|
-
"bundle_sha256": "
|
|
5
|
+
"contract_version": "2026-11-17.1",
|
|
6
|
+
"bundle_sha256": "f0c6dbed0bd3e716de808f5cf42553def829864a0c26cb40f3c85cae7ec3fd3e",
|
|
7
7
|
"bundle_path": "contracts/runbooks"
|
|
8
8
|
}
|
package/dist/active-run.d.ts
CHANGED
|
@@ -27,3 +27,9 @@ export declare function otherLiveSession(client: TellagenClient, state: RunState
|
|
|
27
27
|
* question for the person, or what the model must do, never both in one text.
|
|
28
28
|
*/
|
|
29
29
|
export declare function joinFact(state: RunState): string;
|
|
30
|
+
/**
|
|
31
|
+
* The run an addition is about: the id it was given, else the finished
|
|
32
|
+
* run this session remembers that still takes additions (the one a write
|
|
33
|
+
* answered about last). Never the open run: it is not finished.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveAmendRunId(client: TellagenClient, given?: string): string;
|
package/dist/active-run.js
CHANGED
|
@@ -64,4 +64,18 @@ export function joinFact(state) {
|
|
|
64
64
|
const who = state.client_name ? `${state.client_name}${state.client_version ? ` ${state.client_version}` : ""}` : "Another client";
|
|
65
65
|
return `${who} on this computer is working on run ${state.run_id} (picked up at ${state.picked_up_at}). Two clients on one run write over each other.`;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The run an addition is about: the id it was given, else the finished
|
|
69
|
+
* run this session remembers that still takes additions (the one a write
|
|
70
|
+
* answered about last). Never the open run: it is not finished.
|
|
71
|
+
*/
|
|
72
|
+
export function resolveAmendRunId(client, given) {
|
|
73
|
+
const id = given?.trim();
|
|
74
|
+
if (id)
|
|
75
|
+
return checkedRunId(id);
|
|
76
|
+
const finished = client.session.latestAmendable();
|
|
77
|
+
if (finished)
|
|
78
|
+
return finished.runId;
|
|
79
|
+
throw new NoActiveRunError("No finished run is remembered in this session. Pass investigation_run_id: the run you completed, or the run the person names.");
|
|
80
|
+
}
|
|
67
81
|
//# sourceMappingURL=active-run.js.map
|
package/dist/active-run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-run.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AO,CAAC,eAAe,EAAE,CAAC;IAClD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC;IACpC,MAAM,IAAI,gBAAgB,CACxB,+HAA+H,CAChI,CAAC;AACJ,CAAC"}
|
package/dist/cli/doctor.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TellagenClient } from "../client.js";
|
|
2
2
|
import { type CheckDeps, type ToolResult } from "../doctor/checks.js";
|
|
3
3
|
import { type DoctorFs } from "../doctor/config-files.js";
|
|
4
|
+
import { realDoctorFs } from "../doctor/real-fs.js";
|
|
4
5
|
import { type CliIo } from "./io.js";
|
|
5
6
|
export declare const DOCTOR_USAGE = "Usage: tellagen-mcp-server doctor [--client claude-code|claude-desktop|codex|cursor] [--tool grafana|kubernetes|github|docs] [--fix] [--report]\n";
|
|
6
|
-
|
|
7
|
-
export declare function realDoctorFs(): DoctorFs;
|
|
7
|
+
export { realDoctorFs };
|
|
8
8
|
export interface DoctorDeps {
|
|
9
9
|
fs?: DoctorFs;
|
|
10
10
|
shellPath?: string;
|
package/dist/cli/doctor.js
CHANGED
|
@@ -1,46 +1,13 @@
|
|
|
1
|
-
import { accessSync, constants, readFileSync, statSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
1
|
import { createRuntime } from "../bootstrap.js";
|
|
4
2
|
import { checkEntry, DOCTOR_TOOLS, toolOfEntry } from "../doctor/checks.js";
|
|
5
3
|
import { CLIENT_LABELS, DOCTOR_CLIENTS, scanClient, } from "../doctor/config-files.js";
|
|
4
|
+
import { realDoctorFs } from "../doctor/real-fs.js";
|
|
6
5
|
import { formatError, TellagenAPIError } from "../errors.js";
|
|
7
6
|
import { TOOL_REPORT_PATH } from "../tool-report.js";
|
|
8
7
|
import { MCP_SERVER_VERSION } from "../version.js";
|
|
9
8
|
import { parseArgs } from "./io.js";
|
|
10
|
-
const MAX_CONFIG_BYTES = 4 << 20;
|
|
11
9
|
export const DOCTOR_USAGE = "Usage: tellagen-mcp-server doctor [--client claude-code|claude-desktop|codex|cursor] [--tool grafana|kubernetes|github|docs] [--fix] [--report]\n";
|
|
12
|
-
|
|
13
|
-
export function realDoctorFs() {
|
|
14
|
-
return {
|
|
15
|
-
platform: process.platform,
|
|
16
|
-
home: homedir(),
|
|
17
|
-
cwd: process.cwd(),
|
|
18
|
-
appData: process.env.APPDATA ?? "",
|
|
19
|
-
xdgConfig: process.env.XDG_CONFIG_HOME ?? "",
|
|
20
|
-
readText(path) {
|
|
21
|
-
try {
|
|
22
|
-
if (statSync(path).size > MAX_CONFIG_BYTES)
|
|
23
|
-
return undefined;
|
|
24
|
-
return readFileSync(path, "utf8");
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
isExecutable(path) {
|
|
31
|
-
try {
|
|
32
|
-
if (!statSync(path).isFile())
|
|
33
|
-
return false;
|
|
34
|
-
if (process.platform !== "win32")
|
|
35
|
-
accessSync(path, constants.X_OK);
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
10
|
+
export { realDoctorFs };
|
|
44
11
|
/** One line of what a person does to read the result: the status word first. */
|
|
45
12
|
function statusWord(status) {
|
|
46
13
|
return status === "ok" ? "ok " : status === "failed" ? "FAIL" : "warn";
|
package/dist/cli/doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAoD,MAAM,qBAAqB,C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OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,EAAE,CAAC,MAAM,CAAC,qLAAqL,CAAC,CAAC;IACjM,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,YAAY;QAAE,EAAE,CAAC,MAAM,CAAC,yFAAyF,CAAC,CAAC;IAE7I,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9B,CAAC;IACD,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TellagenClient } from "../client.js";
|
|
2
|
+
import { type DoctorFs } from "../doctor/config-files.js";
|
|
3
|
+
import { type CliIo } from "./io.js";
|
|
4
|
+
export declare const KUBERNETES_USAGE = "Usage: tellagen-mcp-server kubernetes setup [--client claude-code|claude-desktop|codex|cursor] [--context NAME]\n [--service-account NAME [-n NAMESPACE] [--duration 8h]] [--yes] [--no-report]\n\nSets up a read-only Kubernetes server for diagnosis: writes its settings file, adds the server to your AI client\n(it asks first), runs four access checks and reports them to Tellagen.\n";
|
|
5
|
+
export declare const SETUP_DIR_PARTS: readonly [".config", "tellagen"];
|
|
6
|
+
export interface RunResult {
|
|
7
|
+
code: number;
|
|
8
|
+
stdout: string;
|
|
9
|
+
stderr: string;
|
|
10
|
+
}
|
|
11
|
+
/** What the setup writes, so a test can run it on a fake computer. */
|
|
12
|
+
export interface SetupFiles {
|
|
13
|
+
/** Writes a file with mode 600 (a private file), creating its folder. */
|
|
14
|
+
writePrivate(path: string, text: string): void;
|
|
15
|
+
/** Writes a file that holds no secret. */
|
|
16
|
+
write(path: string, text: string): void;
|
|
17
|
+
}
|
|
18
|
+
export interface KubernetesSetupDeps {
|
|
19
|
+
fs?: DoctorFs;
|
|
20
|
+
files?: SetupFiles;
|
|
21
|
+
/** Runs a program with no shell. */
|
|
22
|
+
run?: (command: string, args: string[], env?: Record<string, string>) => Promise<RunResult>;
|
|
23
|
+
confirm?: (question: string) => Promise<boolean>;
|
|
24
|
+
reportClient?: () => Promise<TellagenClient>;
|
|
25
|
+
now?: () => Date;
|
|
26
|
+
}
|
|
27
|
+
export declare const nodeFiles: SetupFiles;
|
|
28
|
+
/** A path as a person reads it: the home folder is `~`, so no user name is printed. */
|
|
29
|
+
export declare function shortPath(path: string, home: string): string;
|
|
30
|
+
/** The settings file of the server: read tools only, a few write-side guards, and secrets denied. */
|
|
31
|
+
export declare function kubernetesServerConfig(kubeconfigPath?: string): string;
|
|
32
|
+
/** The program and arguments a client starts for the server. */
|
|
33
|
+
export declare function serverCommand(configPath: string): {
|
|
34
|
+
command: string;
|
|
35
|
+
args: string[];
|
|
36
|
+
};
|
|
37
|
+
/** A kubeconfig for one service account token. JSON strings are valid YAML, so values are quoted safely. */
|
|
38
|
+
export declare function serviceAccountKubeconfig(name: string, cluster: {
|
|
39
|
+
server: string;
|
|
40
|
+
ca?: {
|
|
41
|
+
data?: string;
|
|
42
|
+
file?: string;
|
|
43
|
+
};
|
|
44
|
+
insecure?: boolean;
|
|
45
|
+
}, token: string): string;
|
|
46
|
+
/** `kubernetes setup`: one command for the computer side of the Kubernetes setup. */
|
|
47
|
+
export declare function kubernetesCommand(args: readonly string[], io: CliIo, deps?: KubernetesSetupDeps): Promise<number>;
|