@tellagen/mcp-server 0.5.0 → 0.5.1

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 CHANGED
@@ -388,7 +388,7 @@ The agent uses Tellagen tools to manage the investigation lifecycle and vendor t
388
388
  7. **Post** findings back to Tellagen as they're discovered, reusing trace evidence identifiers
389
389
  8. **Complete** the investigation run with a concise RCA summary
390
390
 
391
- `tellagen_probe_datasource` reads Tellagen's metadata-only datasource catalog, checks that required local env vars such as `GRAFANA_URL` and `GRAFANA_SERVICE_ACCOUNT_TOKEN` are present, and calls Grafana `/api/health`. It returns statuses, missing env var names, and HTTP status only; it does not store or return token values.
391
+ `tellagen_probe_datasource` reads Tellagen's metadata-only datasource catalog, checks that required local env vars such as `GRAFANA_SERVICE_ACCOUNT_TOKEN` are present, and calls Grafana `/api/health`. `GRAFANA_URL` is optional: it is used when Tellagen sends no Grafana address, or several and none is picked. For Grafana the answer lists every known address as `addresses[]` with its `source` (`pickup`, `GRAFANA_URL` or `datasource`), marks the one it called with `used`, and says with `token_sent` whether the service account token went to it. The token goes only to `GRAFANA_URL`, the address you paired with it. With only an address from Tellagen, the probe calls `/api/health` with no token and says so, and a `GRAFANA_URL` that is not an http or https address is reported as an error. It returns statuses, missing env var names, and HTTP status only; it does not store or return token values.
392
392
 
393
393
  ## Source links and the diagnosis structure
394
394
 
@@ -400,7 +400,7 @@ Tellagen shows a source on every proof in the Diagnosis tab. Evidence refs (`tel
400
400
  | `command` | A copyable read-only command (up to 1000 characters) for Kubernetes and other local sources that have no browser link. Tellagen redacts credentials and drops a longer command. |
401
401
  | `datasource` | The data source name or uid the evidence came from. |
402
402
 
403
- `tellagen_build_source_link` takes the Grafana address from `GRAFANA_URL` in the MCP client environment, else from the Tellagen Grafana datasource `base_url` (Tellagen shows connector settings to settings managers only, so everyone else sets `GRAFANA_URL`). Explore links use Grafana's `left` parameter and the same builder as the Tellagen web app (shared test vectors keep them identical). The time range defaults to the incident window when you pass `investigation_run_id`. It never puts credentials in a link and makes no network call except to the Tellagen API.
403
+ `tellagen_build_source_link` takes the Grafana address in this order: the `source_bases` that Tellagen sends with the pickup answer and the context read of the run (the enabled Grafana and GitHub addresses of the workspace, remembered with the run, also after a restart or `tellagen_resume`), then `GRAFANA_URL` in the MCP client environment, then the `base_url` of the Tellagen Grafana datasource (Tellagen shows connector settings to settings managers only). With several Grafana addresses in the pickup, pass `connector` with the name of one. A signed-in client therefore needs no `GRAFANA_URL`; set it only when Tellagen sends no Grafana address (or several and you pass no `connector`). A GitHub link uses the GitHub address from the pickup (a GitHub Enterprise server, for example) when the repository belongs to it, and an explicit `github_url` wins. Only http and https addresses are used, credentials, query and fragment are removed, and a copyable command or a file path is never turned into a link. An older Tellagen sends no `source_bases`, and then the order is `GRAFANA_URL`, then the datasource, as before. Explore links use Grafana's `left` parameter and the same builder as the Tellagen web app (shared test vectors keep them identical). The time range defaults to the incident window when you pass `investigation_run_id`. It never puts credentials in a link and makes no network call except to the Tellagen API.
404
404
 
405
405
  `tellagen_complete_investigation` also accepts the causal chain with `finding_ids` (the numeric ids that `tellagen_post_finding` returns), one `figure` per step (a timeline block of any type except `table` and `changes`, validated before the request is sent; see Figures), `ruled_out[]`, `coverage[]`, `unknowns[]` and `change_refs[]` (see Change refs). `tellagen_post_trace_step` accepts `outcome` (supports, rules_out, nothing_notable, inconclusive, unavailable) and `cause_key`. `tellagen_update_cause` posts the causes you are testing while the run is live (`PUT /api/v1/investigation-runs/{id}/causes/{key}`, at most 8 per run); it is sent only when the run advertises `diagnosis_structure_v1`, otherwise the result carries an `mcp_notice` and nothing is sent. The response carries the backend `warnings[]` verbatim and a one-line `warnings_summary` the agent can act on.
406
406
 
@@ -666,4 +666,4 @@ npm run lint # tsc --noEmit
666
666
  | `TELLAGEN_STATE_DIR` | No | Folder of the remembered-run file. Defaults to `~/.tellagen/state` |
667
667
  | `TELLAGEN_MCP_CLIENT` | No | Deprecated. `codex` or `claude`; used only when the client sends no name in the handshake, and for an older Tellagen workspace |
668
668
  | `TELLAGEN_MCP_PROFILE_ID` | No | Stable opaque profile ID used to scope local MCP access observations |
669
- | `GRAFANA_URL` | No | Grafana address; used by `tellagen_probe_datasource` and by `tellagen_build_source_link` (wins over the Tellagen datasource `base_url`) |
669
+ | `GRAFANA_URL` | No | Grafana address, for `tellagen_probe_datasource` and `tellagen_build_source_link`. Used when Tellagen sends no Grafana address with the pickup, or several and none is picked; the Tellagen datasource `base_url` comes after it. The probe sends the service account token only to this address |
package/SKILL.md CHANGED
@@ -180,7 +180,7 @@ Every investigation follows this sequence. Do not skip steps.
180
180
  - **Attribute every trace step.** Copy exact frozen runbook identifiers from `request.skills`, or declare the honest non-runbook origin. Never invent a citation.
181
181
  - **Keep a step's basis immutable.** Reuse the same `guidance` object when changing a step from `running` to `done` or `error`.
182
182
  - **Keep every finding's numeric `id`.** `tellagen_post_finding` returns `{finding:{id,...}}`. The cause chain, `ruled_out`, `coverage` and `unknowns` cite findings by `finding_ids`, so note the id of each finding as you post it (see Diagnosis structure).
183
- - **Give every proof a source.** Call `tellagen_build_source_link` for GitHub evidence, and for Grafana evidence when `GRAFANA_URL` is set (see Links, command and datasource); send the result as `links`. Send a `command` for kubectl and other local sources.
183
+ - **Give every proof a source.** Call `tellagen_build_source_link` for GitHub evidence, and for Grafana evidence when the pickup lists a Grafana address or `GRAFANA_URL` is set (see Links, command and datasource); send the result as `links`. Send a `command` for kubectl and other local sources.
184
184
 
185
185
  When a terminal read-only check reveals a repeatable diagnostic pattern, attach reuse_hint to the done trace/check attempt. Generalize the diagnostic intent and trigger, choose confirmed or falsified, and list parameter names without values. Never hint remediation, mutation, failed/skipped work, incident-specific one-offs, secrets, customer identifiers, URLs, commands, or a check already fully covered by the frozen runbook unless the evidence supports a specific extension. Copy the returned stable evidence identifiers into a qualifying finding when the result materially changes confidence.
186
186
 
@@ -395,10 +395,10 @@ Responders open the source of every proof from the Diagnosis tab. Three fields m
395
395
  | `command` | Kubernetes and any local source with no browser address (kubectl, a SQL client, a local script) | A read-only command that reproduces the evidence, up to 1000 characters, no credentials (Tellagen redacts what it finds and drops a longer command) |
396
396
  | `datasource` | A Grafana or similar source | The data source name or uid the query ran against |
397
397
 
398
- **Call `tellagen_build_source_link`** for GitHub and Grafana instead of writing the address yourself, and copy the `links[]` it returns into the ref unchanged. A GitHub link needs only `repo`. A Grafana link needs a Grafana address, so decide first:
398
+ **Call `tellagen_build_source_link`** for GitHub and Grafana instead of writing the address yourself, and copy the `links[]` it returns into the ref unchanged. A GitHub link needs only `repo`. A Grafana link needs a Grafana address. The tool takes it from the `source_bases` of the pickup answer (the enabled Grafana and GitHub addresses of the workspace), else from `GRAFANA_URL` in the MCP client environment, else from the `base_url` of the Tellagen Grafana datasource. Decide first:
399
399
 
400
- - If `GRAFANA_URL` is set in the MCP client environment, call the tool for every Grafana source.
401
- - If `GRAFANA_URL` is not set, the tool reads the `base_url` of the Tellagen Grafana datasource. You cannot see that setting, so call the tool once, for your first Grafana source. If it fails with "No enabled Grafana datasource" or "no usable base_url", do not call it again for Grafana. Send a read-only `command` and the `datasource` on each Grafana evidence ref, and add a `coverage` entry that says the Grafana address was not configured.
400
+ - If the pickup answer lists a Grafana address in `source_bases`, or `GRAFANA_URL` is set in the MCP client environment, call the tool for every Grafana source. With several Grafana addresses, pass `connector` with the name of one.
401
+ - If neither is true, the tool reads the `base_url` of the Tellagen Grafana datasource. You cannot see that setting, so call the tool once, for your first Grafana source. If it fails with "No enabled Grafana datasource" or "no usable base_url", do not call it again for Grafana. Send a read-only `command` and the `datasource` on each Grafana evidence ref, and add a `coverage` entry that says the Grafana address was not configured.
402
402
 
403
403
  ```
404
404
  tellagen_build_source_link(kind: "logs", datasource: "<loki uid>", query: '{app="checkout"} |= "error"', investigation_run_id: <run_id>)
@@ -79,12 +79,12 @@ export declare const evidenceLinkSchema: z.ZodObject<{
79
79
  label: z.ZodString;
80
80
  url: z.ZodEffects<z.ZodString, string, string>;
81
81
  }, "strip", z.ZodTypeAny, {
82
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
82
83
  label: string;
83
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
84
84
  url: string;
85
85
  }, {
86
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
86
87
  label: string;
87
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
88
88
  url: string;
89
89
  }>;
90
90
  export declare const evidenceLinksSchema: z.ZodArray<z.ZodObject<{
@@ -92,12 +92,12 @@ export declare const evidenceLinksSchema: z.ZodArray<z.ZodObject<{
92
92
  label: z.ZodString;
93
93
  url: z.ZodEffects<z.ZodString, string, string>;
94
94
  }, "strip", z.ZodTypeAny, {
95
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
95
96
  label: string;
96
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
97
97
  url: string;
98
98
  }, {
99
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
99
100
  label: string;
100
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
101
101
  url: string;
102
102
  }>, "many">;
103
103
  /** Fields added to every evidence ref by diagnosis_structure_v1. */
@@ -107,12 +107,12 @@ export declare const evidenceRefStructureShape: {
107
107
  label: z.ZodString;
108
108
  url: z.ZodEffects<z.ZodString, string, string>;
109
109
  }, "strip", z.ZodTypeAny, {
110
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
110
111
  label: string;
111
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
112
112
  url: string;
113
113
  }, {
114
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
114
115
  label: string;
115
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
116
116
  url: string;
117
117
  }>, "many">>;
118
118
  command: z.ZodOptional<z.ZodString>;
@@ -311,16 +311,16 @@ export declare const stepFigureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"typ
311
311
  step: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
312
312
  artifact_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
313
313
  }, "strict", z.ZodTypeAny, {
314
- kind?: string | undefined;
315
314
  datasource?: string | undefined;
315
+ kind?: string | undefined;
316
316
  query?: string | undefined;
317
317
  from?: string | undefined;
318
318
  to?: string | undefined;
319
319
  step?: string | undefined;
320
320
  artifact_id?: string | undefined;
321
321
  }, {
322
- kind?: string | undefined;
323
322
  datasource?: string | undefined;
323
+ kind?: string | undefined;
324
324
  query?: string | undefined;
325
325
  from?: string | undefined;
326
326
  to?: string | undefined;
@@ -337,8 +337,8 @@ export declare const stepFigureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"typ
337
337
  title?: string | undefined;
338
338
  anchor?: string | undefined;
339
339
  source?: {
340
- kind?: string | undefined;
341
340
  datasource?: string | undefined;
341
+ kind?: string | undefined;
342
342
  query?: string | undefined;
343
343
  from?: string | undefined;
344
344
  to?: string | undefined;
@@ -365,8 +365,8 @@ export declare const stepFigureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"typ
365
365
  title?: string | undefined;
366
366
  anchor?: string | undefined;
367
367
  source?: {
368
- kind?: string | undefined;
369
368
  datasource?: string | undefined;
369
+ kind?: string | undefined;
370
370
  query?: string | undefined;
371
371
  from?: string | undefined;
372
372
  to?: string | undefined;
@@ -436,8 +436,8 @@ export declare const stepFigureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"typ
436
436
  title?: string | undefined;
437
437
  anchor?: string | undefined;
438
438
  source?: {
439
- kind?: string | undefined;
440
439
  datasource?: string | undefined;
440
+ kind?: string | undefined;
441
441
  query?: string | undefined;
442
442
  from?: string | undefined;
443
443
  to?: string | undefined;
@@ -503,8 +503,8 @@ export declare const stepFigureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"typ
503
503
  title?: string | undefined;
504
504
  anchor?: string | undefined;
505
505
  source?: {
506
- kind?: string | undefined;
507
506
  datasource?: string | undefined;
507
+ kind?: string | undefined;
508
508
  query?: string | undefined;
509
509
  from?: string | undefined;
510
510
  to?: string | undefined;
@@ -721,16 +721,16 @@ export declare const stepStructureShape: {
721
721
  step: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
722
722
  artifact_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
723
723
  }, "strict", z.ZodTypeAny, {
724
- kind?: string | undefined;
725
724
  datasource?: string | undefined;
725
+ kind?: string | undefined;
726
726
  query?: string | undefined;
727
727
  from?: string | undefined;
728
728
  to?: string | undefined;
729
729
  step?: string | undefined;
730
730
  artifact_id?: string | undefined;
731
731
  }, {
732
- kind?: string | undefined;
733
732
  datasource?: string | undefined;
733
+ kind?: string | undefined;
734
734
  query?: string | undefined;
735
735
  from?: string | undefined;
736
736
  to?: string | undefined;
@@ -747,8 +747,8 @@ export declare const stepStructureShape: {
747
747
  title?: string | undefined;
748
748
  anchor?: string | undefined;
749
749
  source?: {
750
- kind?: string | undefined;
751
750
  datasource?: string | undefined;
751
+ kind?: string | undefined;
752
752
  query?: string | undefined;
753
753
  from?: string | undefined;
754
754
  to?: string | undefined;
@@ -775,8 +775,8 @@ export declare const stepStructureShape: {
775
775
  title?: string | undefined;
776
776
  anchor?: string | undefined;
777
777
  source?: {
778
- kind?: string | undefined;
779
778
  datasource?: string | undefined;
779
+ kind?: string | undefined;
780
780
  query?: string | undefined;
781
781
  from?: string | undefined;
782
782
  to?: string | undefined;
@@ -846,8 +846,8 @@ export declare const stepStructureShape: {
846
846
  title?: string | undefined;
847
847
  anchor?: string | undefined;
848
848
  source?: {
849
- kind?: string | undefined;
850
849
  datasource?: string | undefined;
850
+ kind?: string | undefined;
851
851
  query?: string | undefined;
852
852
  from?: string | undefined;
853
853
  to?: string | undefined;
@@ -913,8 +913,8 @@ export declare const stepStructureShape: {
913
913
  title?: string | undefined;
914
914
  anchor?: string | undefined;
915
915
  source?: {
916
- kind?: string | undefined;
917
916
  datasource?: string | undefined;
917
+ kind?: string | undefined;
918
918
  query?: string | undefined;
919
919
  from?: string | undefined;
920
920
  to?: string | undefined;
@@ -943,12 +943,12 @@ export declare const stepStructureShape: {
943
943
  label: z.ZodString;
944
944
  url: z.ZodEffects<z.ZodString, string, string>;
945
945
  }, "strip", z.ZodTypeAny, {
946
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
946
947
  label: string;
947
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
948
948
  url: string;
949
949
  }, {
950
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
950
951
  label: string;
951
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
952
952
  url: string;
953
953
  }>, "many">>;
954
954
  };
@@ -962,12 +962,12 @@ export declare const ruledOutSchema: z.ZodObject<{
962
962
  label: z.ZodString;
963
963
  url: z.ZodEffects<z.ZodString, string, string>;
964
964
  }, "strip", z.ZodTypeAny, {
965
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
965
966
  label: string;
966
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
967
967
  url: string;
968
968
  }, {
969
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
969
970
  label: string;
970
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
971
971
  url: string;
972
972
  }>, "many">>;
973
973
  confidence_percent: z.ZodOptional<z.ZodNumber>;
@@ -975,8 +975,8 @@ export declare const ruledOutSchema: z.ZodObject<{
975
975
  label: string;
976
976
  id?: string | undefined;
977
977
  links?: {
978
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
978
979
  label: string;
979
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
980
980
  url: string;
981
981
  }[] | undefined;
982
982
  explanation?: string | undefined;
@@ -986,8 +986,8 @@ export declare const ruledOutSchema: z.ZodObject<{
986
986
  label: string;
987
987
  id?: string | undefined;
988
988
  links?: {
989
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
989
990
  label: string;
990
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
991
991
  url: string;
992
992
  }[] | undefined;
993
993
  explanation?: string | undefined;
@@ -1004,12 +1004,12 @@ export declare const coverageEntrySchema: z.ZodObject<{
1004
1004
  label: z.ZodString;
1005
1005
  url: z.ZodEffects<z.ZodString, string, string>;
1006
1006
  }, "strip", z.ZodTypeAny, {
1007
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1007
1008
  label: string;
1008
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1009
1009
  url: string;
1010
1010
  }, {
1011
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1011
1012
  label: string;
1012
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1013
1013
  url: string;
1014
1014
  }>, "many">>;
1015
1015
  step_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1021,8 +1021,8 @@ export declare const coverageEntrySchema: z.ZodObject<{
1021
1021
  id?: string | undefined;
1022
1022
  summary?: string | undefined;
1023
1023
  links?: {
1024
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1024
1025
  label: string;
1025
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1026
1026
  url: string;
1027
1027
  }[] | undefined;
1028
1028
  finding_ids?: number[] | undefined;
@@ -1034,8 +1034,8 @@ export declare const coverageEntrySchema: z.ZodObject<{
1034
1034
  id?: string | undefined;
1035
1035
  summary?: string | undefined;
1036
1036
  links?: {
1037
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1037
1038
  label: string;
1038
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1039
1039
  url: string;
1040
1040
  }[] | undefined;
1041
1041
  finding_ids?: number[] | undefined;
@@ -1085,17 +1085,17 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1085
1085
  label: z.ZodString;
1086
1086
  url: z.ZodEffects<z.ZodString, string, string>;
1087
1087
  }, "strip", z.ZodTypeAny, {
1088
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1088
1089
  label: string;
1089
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1090
1090
  url: string;
1091
1091
  }, {
1092
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1092
1093
  label: string;
1093
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1094
1094
  url: string;
1095
1095
  }>, "many">>;
1096
1096
  }, "strip", z.ZodTypeAny, {
1097
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1098
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1097
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1098
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1099
1099
  title?: string | undefined;
1100
1100
  id?: string | undefined;
1101
1101
  author?: string | undefined;
@@ -1105,8 +1105,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1105
1105
  sha?: string | undefined;
1106
1106
  repo?: string | undefined;
1107
1107
  links?: {
1108
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1108
1109
  label: string;
1109
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1110
1110
  url: string;
1111
1111
  }[] | undefined;
1112
1112
  finding_ids?: number[] | undefined;
@@ -1115,8 +1115,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1115
1115
  occurred_at?: string | undefined;
1116
1116
  verification?: "unknown" | "confirmed" | "likely" | undefined;
1117
1117
  }, {
1118
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1119
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1118
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1119
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1120
1120
  title?: string | undefined;
1121
1121
  id?: string | undefined;
1122
1122
  author?: string | undefined;
@@ -1126,8 +1126,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1126
1126
  sha?: string | undefined;
1127
1127
  repo?: string | undefined;
1128
1128
  links?: {
1129
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1129
1130
  label: string;
1130
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1131
1131
  url: string;
1132
1132
  }[] | undefined;
1133
1133
  finding_ids?: number[] | undefined;
@@ -1136,8 +1136,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1136
1136
  occurred_at?: string | undefined;
1137
1137
  verification?: "unknown" | "confirmed" | "likely" | undefined;
1138
1138
  }>, {
1139
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1140
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1139
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1140
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1141
1141
  title?: string | undefined;
1142
1142
  id?: string | undefined;
1143
1143
  author?: string | undefined;
@@ -1147,8 +1147,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1147
1147
  sha?: string | undefined;
1148
1148
  repo?: string | undefined;
1149
1149
  links?: {
1150
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1150
1151
  label: string;
1151
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1152
1152
  url: string;
1153
1153
  }[] | undefined;
1154
1154
  finding_ids?: number[] | undefined;
@@ -1157,8 +1157,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1157
1157
  occurred_at?: string | undefined;
1158
1158
  verification?: "unknown" | "confirmed" | "likely" | undefined;
1159
1159
  }, {
1160
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1161
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1160
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1161
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1162
1162
  title?: string | undefined;
1163
1163
  id?: string | undefined;
1164
1164
  author?: string | undefined;
@@ -1168,8 +1168,8 @@ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1168
1168
  sha?: string | undefined;
1169
1169
  repo?: string | undefined;
1170
1170
  links?: {
1171
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1171
1172
  label: string;
1172
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1173
1173
  url: string;
1174
1174
  }[] | undefined;
1175
1175
  finding_ids?: number[] | undefined;
@@ -1200,17 +1200,17 @@ export declare const resultChangeShape: {
1200
1200
  label: z.ZodString;
1201
1201
  url: z.ZodEffects<z.ZodString, string, string>;
1202
1202
  }, "strip", z.ZodTypeAny, {
1203
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1203
1204
  label: string;
1204
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1205
1205
  url: string;
1206
1206
  }, {
1207
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1207
1208
  label: string;
1208
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1209
1209
  url: string;
1210
1210
  }>, "many">>;
1211
1211
  }, "strip", z.ZodTypeAny, {
1212
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1213
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1212
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1213
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1214
1214
  title?: string | undefined;
1215
1215
  id?: string | undefined;
1216
1216
  author?: string | undefined;
@@ -1220,8 +1220,8 @@ export declare const resultChangeShape: {
1220
1220
  sha?: string | undefined;
1221
1221
  repo?: string | undefined;
1222
1222
  links?: {
1223
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1223
1224
  label: string;
1224
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1225
1225
  url: string;
1226
1226
  }[] | undefined;
1227
1227
  finding_ids?: number[] | undefined;
@@ -1230,8 +1230,8 @@ export declare const resultChangeShape: {
1230
1230
  occurred_at?: string | undefined;
1231
1231
  verification?: "unknown" | "confirmed" | "likely" | undefined;
1232
1232
  }, {
1233
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1234
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1233
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1234
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1235
1235
  title?: string | undefined;
1236
1236
  id?: string | undefined;
1237
1237
  author?: string | undefined;
@@ -1241,8 +1241,8 @@ export declare const resultChangeShape: {
1241
1241
  sha?: string | undefined;
1242
1242
  repo?: string | undefined;
1243
1243
  links?: {
1244
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1244
1245
  label: string;
1245
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1246
1246
  url: string;
1247
1247
  }[] | undefined;
1248
1248
  finding_ids?: number[] | undefined;
@@ -1251,8 +1251,8 @@ export declare const resultChangeShape: {
1251
1251
  occurred_at?: string | undefined;
1252
1252
  verification?: "unknown" | "confirmed" | "likely" | undefined;
1253
1253
  }>, {
1254
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1255
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1254
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1255
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1256
1256
  title?: string | undefined;
1257
1257
  id?: string | undefined;
1258
1258
  author?: string | undefined;
@@ -1262,8 +1262,8 @@ export declare const resultChangeShape: {
1262
1262
  sha?: string | undefined;
1263
1263
  repo?: string | undefined;
1264
1264
  links?: {
1265
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1265
1266
  label: string;
1266
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1267
1267
  url: string;
1268
1268
  }[] | undefined;
1269
1269
  finding_ids?: number[] | undefined;
@@ -1272,8 +1272,8 @@ export declare const resultChangeShape: {
1272
1272
  occurred_at?: string | undefined;
1273
1273
  verification?: "unknown" | "confirmed" | "likely" | undefined;
1274
1274
  }, {
1275
- kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1276
- role: "fix" | "context" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1275
+ kind: "commit" | "ci_run" | "release" | "deployment" | "pull_request" | "config_change";
1276
+ role: "context" | "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by";
1277
1277
  title?: string | undefined;
1278
1278
  id?: string | undefined;
1279
1279
  author?: string | undefined;
@@ -1283,8 +1283,8 @@ export declare const resultChangeShape: {
1283
1283
  sha?: string | undefined;
1284
1284
  repo?: string | undefined;
1285
1285
  links?: {
1286
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1286
1287
  label: string;
1287
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1288
1288
  url: string;
1289
1289
  }[] | undefined;
1290
1290
  finding_ids?: number[] | undefined;
@@ -1305,12 +1305,12 @@ export declare const resultStructureShape: {
1305
1305
  label: z.ZodString;
1306
1306
  url: z.ZodEffects<z.ZodString, string, string>;
1307
1307
  }, "strip", z.ZodTypeAny, {
1308
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1308
1309
  label: string;
1309
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1310
1310
  url: string;
1311
1311
  }, {
1312
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1312
1313
  label: string;
1313
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1314
1314
  url: string;
1315
1315
  }>, "many">>;
1316
1316
  confidence_percent: z.ZodOptional<z.ZodNumber>;
@@ -1318,8 +1318,8 @@ export declare const resultStructureShape: {
1318
1318
  label: string;
1319
1319
  id?: string | undefined;
1320
1320
  links?: {
1321
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1321
1322
  label: string;
1322
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1323
1323
  url: string;
1324
1324
  }[] | undefined;
1325
1325
  explanation?: string | undefined;
@@ -1329,8 +1329,8 @@ export declare const resultStructureShape: {
1329
1329
  label: string;
1330
1330
  id?: string | undefined;
1331
1331
  links?: {
1332
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1332
1333
  label: string;
1333
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1334
1334
  url: string;
1335
1335
  }[] | undefined;
1336
1336
  explanation?: string | undefined;
@@ -1347,12 +1347,12 @@ export declare const resultStructureShape: {
1347
1347
  label: z.ZodString;
1348
1348
  url: z.ZodEffects<z.ZodString, string, string>;
1349
1349
  }, "strip", z.ZodTypeAny, {
1350
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1350
1351
  label: string;
1351
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1352
1352
  url: string;
1353
1353
  }, {
1354
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1354
1355
  label: string;
1355
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1356
1356
  url: string;
1357
1357
  }>, "many">>;
1358
1358
  step_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1364,8 +1364,8 @@ export declare const resultStructureShape: {
1364
1364
  id?: string | undefined;
1365
1365
  summary?: string | undefined;
1366
1366
  links?: {
1367
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1367
1368
  label: string;
1368
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1369
1369
  url: string;
1370
1370
  }[] | undefined;
1371
1371
  finding_ids?: number[] | undefined;
@@ -1377,8 +1377,8 @@ export declare const resultStructureShape: {
1377
1377
  id?: string | undefined;
1378
1378
  summary?: string | undefined;
1379
1379
  links?: {
1380
+ kind: "diff" | "commit" | "pr" | "ci_run" | "release" | "deployment" | "explore" | "panel" | "logs" | "trace";
1380
1381
  label: string;
1381
- kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1382
1382
  url: string;
1383
1383
  }[] | undefined;
1384
1384
  finding_ids?: number[] | undefined;
@@ -17,6 +17,7 @@
17
17
  */
18
18
  import { z } from "zod";
19
19
  import { checksBlockSchema, diffBlockSchema, figureRuleIssues, histogramBlockSchema, MAX_STEP_FIGURE_BYTES, FIGURE_EXTRAS_CAPABILITY, rangeOverlapBlockSchema, runHistoryBlockSchema, withoutDiffLineDetailInBlock, withoutFigureExtrasInBlock, } from "./figures.js";
20
+ import { rememberSourceBases } from "./source-bases.js";
20
21
  import { RECORDED_STEPS_CAPABILITY } from "./trace-record.js";
21
22
  export { RECORDED_STEPS_CAPABILITY };
22
23
  export const DIAGNOSIS_STRUCTURE_CAPABILITY = "diagnosis_structure_v1";
@@ -71,6 +72,7 @@ export async function supportsCapability(client, runId, capability) {
71
72
  try {
72
73
  const context = await client.get(`/api/v1/investigations/${encodeURIComponent(runId)}/context`);
73
74
  rememberServerCapabilities(client, runId, context);
75
+ rememberSourceBases(client, runId, context);
74
76
  return map.get(runId)?.has(capability) ?? false;
75
77
  }
76
78
  catch {