dsh-lsp-actions 0.2.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/CHANGELOG.md +79 -0
- package/LICENSE +201 -0
- package/README.es.md +177 -0
- package/README.hi.md +177 -0
- package/README.md +183 -0
- package/README.pt.md +177 -0
- package/README.zh-CN.md +181 -0
- package/cordis.patch.yml +17 -0
- package/lib/abort.d.ts +13 -0
- package/lib/abort.d.ts.map +1 -0
- package/lib/abort.js +31 -0
- package/lib/abort.js.map +1 -0
- package/lib/client.d.ts +173 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +926 -0
- package/lib/client.js.map +1 -0
- package/lib/connection.d.ts +103 -0
- package/lib/connection.d.ts.map +1 -0
- package/lib/connection.js +241 -0
- package/lib/connection.js.map +1 -0
- package/lib/edits.d.ts +17 -0
- package/lib/edits.d.ts.map +1 -0
- package/lib/edits.js +76 -0
- package/lib/edits.js.map +1 -0
- package/lib/extension.d.ts +9 -0
- package/lib/extension.d.ts.map +1 -0
- package/lib/extension.js +17 -0
- package/lib/extension.js.map +1 -0
- package/lib/extra-tools.d.ts +45 -0
- package/lib/extra-tools.d.ts.map +1 -0
- package/lib/extra-tools.js +406 -0
- package/lib/extra-tools.js.map +1 -0
- package/lib/framing.d.ts +33 -0
- package/lib/framing.d.ts.map +1 -0
- package/lib/framing.js +80 -0
- package/lib/framing.js.map +1 -0
- package/lib/host.d.ts +64 -0
- package/lib/host.d.ts.map +1 -0
- package/lib/host.js +152 -0
- package/lib/host.js.map +1 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +78 -0
- package/lib/index.js.map +1 -0
- package/lib/render.d.ts +364 -0
- package/lib/render.d.ts.map +1 -0
- package/lib/render.js +485 -0
- package/lib/render.js.map +1 -0
- package/lib/runner.d.ts +55 -0
- package/lib/runner.d.ts.map +1 -0
- package/lib/runner.js +149 -0
- package/lib/runner.js.map +1 -0
- package/lib/sandbox.d.ts +69 -0
- package/lib/sandbox.d.ts.map +1 -0
- package/lib/sandbox.js +98 -0
- package/lib/sandbox.js.map +1 -0
- package/lib/seam.d.ts +67 -0
- package/lib/seam.d.ts.map +1 -0
- package/lib/seam.js +62 -0
- package/lib/seam.js.map +1 -0
- package/lib/servers.d.ts +120 -0
- package/lib/servers.d.ts.map +1 -0
- package/lib/servers.js +216 -0
- package/lib/servers.js.map +1 -0
- package/lib/session-cwd.d.ts +15 -0
- package/lib/session-cwd.d.ts.map +1 -0
- package/lib/session-cwd.js +16 -0
- package/lib/session-cwd.js.map +1 -0
- package/lib/tools.d.ts +150 -0
- package/lib/tools.d.ts.map +1 -0
- package/lib/tools.js +543 -0
- package/lib/tools.js.map +1 -0
- package/lib/translate.d.ts +181 -0
- package/lib/translate.d.ts.map +1 -0
- package/lib/translate.js +715 -0
- package/lib/translate.js.map +1 -0
- package/lib/vocabulary.d.ts +167 -0
- package/lib/vocabulary.d.ts.map +1 -0
- package/lib/vocabulary.js +20 -0
- package/lib/vocabulary.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAY5G,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,uGAAuG;AACvG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS;QAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;QAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;QACxB,QAAQ,C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AkB,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,CAgBvH;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAQ5E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,CAWjH;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,GAAG,eAAe,CAOhF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,CAWrH;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,GAAG,eAAe,CAOlF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,CASvH;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,eAAe,CAO1E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,CAK3G"}
|
package/lib/render.js
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure formatting and presentation for the three LSP action tools: severity-labeled diagnostic
|
|
3
|
+
* text, completion listings marked as reference-only, bounded result truncation, and the pure
|
|
4
|
+
* UI card presenters. No I/O — a UI may call the presenters on live streaming and on replay, so
|
|
5
|
+
* they depend only on tool arguments (and persisted result metadata).
|
|
6
|
+
* @module dsh-lsp-actions/render
|
|
7
|
+
*/
|
|
8
|
+
/** Severity labels, indexed by LSP DiagnosticSeverity (1..4). */
|
|
9
|
+
const SEVERITY_LABELS = ['', 'Error', 'Warning', 'Information', 'Hint'];
|
|
10
|
+
/** LSP SymbolKind labels, indexed 1..26 (CompletionItemKind shares the same numbering). */
|
|
11
|
+
const SYMBOL_KIND_LABELS = [
|
|
12
|
+
'', 'File', 'Module', 'Namespace', 'Package', 'Class', 'Method', 'Property', 'Field', 'Constructor',
|
|
13
|
+
'Enum', 'Interface', 'Function', 'Variable', 'Constant', 'String', 'Number', 'Boolean', 'Array',
|
|
14
|
+
'Object', 'Key', 'Null', 'EnumMember', 'Struct', 'Event', 'Operator', 'TypeParameter',
|
|
15
|
+
];
|
|
16
|
+
/** The human-readable label for a numeric LSP symbol/completion kind. */
|
|
17
|
+
export function symbolKindLabel(kind) {
|
|
18
|
+
const label = SYMBOL_KIND_LABELS[kind];
|
|
19
|
+
return label === undefined || label === '' ? `Kind ${kind}` : label;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Format a diagnostics result as model-facing text: one `path:line:character [Severity] message`
|
|
23
|
+
* line per diagnostic, an omission marker past `maxDiagnostics`, then the complete result cap.
|
|
24
|
+
* @param filePath - the diagnosed file (all diagnostics belong to it).
|
|
25
|
+
* @param diagnostics - the already count-capped diagnostics (the canonical schema's projection).
|
|
26
|
+
* @param maxResultChars - the complete rendered-text cap, including truncation metadata.
|
|
27
|
+
* @returns the rendered text; a distinct no-result line when there are none.
|
|
28
|
+
*/
|
|
29
|
+
export function formatDiagnostics(filePath, diagnostics, maxResultChars) {
|
|
30
|
+
if (diagnostics.length === 0)
|
|
31
|
+
return boundResult(`No diagnostics reported for ${filePath}.`, maxResultChars, 'diagnostics');
|
|
32
|
+
const lines = diagnostics.map((diagnostic) => {
|
|
33
|
+
const line = diagnostic.range.start.line + 1;
|
|
34
|
+
const character = diagnostic.range.start.character + 1;
|
|
35
|
+
const label = SEVERITY_LABELS[diagnostic.severity] ?? `Severity ${diagnostic.severity}`;
|
|
36
|
+
const tail = diagnostic.code === undefined
|
|
37
|
+
? diagnostic.source === undefined ? '' : ` [${diagnostic.source}]`
|
|
38
|
+
: ` [${diagnostic.source ?? 'server'} ${String(diagnostic.code)}]`;
|
|
39
|
+
return `${filePath}:${line}:${character} [${label}] ${diagnostic.message}${tail}`;
|
|
40
|
+
});
|
|
41
|
+
return boundResult(lines.join('\n'), maxResultChars, 'diagnostics');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Format a completion result as model-facing text. The header marks the items as reference-only:
|
|
45
|
+
* nothing was executed, and applying one is the model's own write/edit decision. Each item shows
|
|
46
|
+
* its label and detail, plus the actual insertion text (textEdit.newText, else insertText, else
|
|
47
|
+
* the label) on an indented `→` line when it adds information — the label alone is often not what
|
|
48
|
+
* the server would insert.
|
|
49
|
+
* @param filePath - the completed file.
|
|
50
|
+
* @param line - the one-based cursor line.
|
|
51
|
+
* @param character - the one-based cursor character.
|
|
52
|
+
* @param items - the already count-capped items (the canonical schema's projection).
|
|
53
|
+
* @param maxResultChars - the complete rendered-text cap, including truncation metadata.
|
|
54
|
+
* @returns the rendered text; a distinct no-result line when there are none.
|
|
55
|
+
*/
|
|
56
|
+
export function formatCompletionList(filePath, line, character, items, maxResultChars) {
|
|
57
|
+
const header = `Completion suggestions for ${filePath}:${line}:${character} (reference only — nothing was executed; apply one yourself with write/edit).`;
|
|
58
|
+
if (items.length === 0)
|
|
59
|
+
return boundResult(`${header}\nNo completions available.`, maxResultChars, 'completion');
|
|
60
|
+
const lines = [header, ...items.flatMap((item, index) => {
|
|
61
|
+
const label = item.detail === undefined ? item.label : `${item.label} — ${item.detail}`;
|
|
62
|
+
const insertText = completionInsertText(item);
|
|
63
|
+
const snippet = insertText === undefined || insertText === item.label ? [] : [` → ${insertText}`];
|
|
64
|
+
return [`${index + 1}. ${label}`, ...snippet];
|
|
65
|
+
})];
|
|
66
|
+
return boundResult(lines.join('\n'), maxResultChars, 'completion');
|
|
67
|
+
}
|
|
68
|
+
/** The text this item would insert: textEdit.newText wins, then insertText, then nothing. */
|
|
69
|
+
function completionInsertText(item) {
|
|
70
|
+
return item.textEdit?.newText ?? item.insertText;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Format a formatting outcome as one model-facing line; the UI diff card carries the applied
|
|
74
|
+
* change, so the text stays a summary and the model re-reads the file for the full result. The
|
|
75
|
+
* optional one-based line span names how much of the file changed, so the model can decide whether
|
|
76
|
+
* a re-read is worth the tokens.
|
|
77
|
+
* @param filePath - the formatted file.
|
|
78
|
+
* @param appliedEdits - how many edits were applied.
|
|
79
|
+
* @param linesChanged - the one-based line span the edits touch; omitted keeps the bare summary.
|
|
80
|
+
* @returns the summary text.
|
|
81
|
+
*/
|
|
82
|
+
export function formatAppliedEdits(filePath, appliedEdits, linesChanged) {
|
|
83
|
+
const span = linesChanged === undefined ? '' : ` across ${linesChanged} line${linesChanged === 1 ? '' : 's'}`;
|
|
84
|
+
return `Formatted ${filePath}: applied ${appliedEdits} edit${appliedEdits === 1 ? '' : 's'}${span}. The result card shows the diff; re-read the file for the full result.`;
|
|
85
|
+
}
|
|
86
|
+
/** Bound a complete rendered result, including the truncation notice itself. */
|
|
87
|
+
function boundResult(text, maxChars, label) {
|
|
88
|
+
if (text.length <= maxChars)
|
|
89
|
+
return text;
|
|
90
|
+
const notice = `\n… ${label} truncated (limit ${maxChars} characters).`;
|
|
91
|
+
if (notice.length >= maxChars)
|
|
92
|
+
return notice.slice(0, maxChars);
|
|
93
|
+
return `${text.slice(0, maxChars - notice.length)}${notice}`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Format a code action result as model-facing text: one numbered line per action, then each
|
|
97
|
+
* action's edits with the replacement text. Reference-only — nothing is applied, and a command
|
|
98
|
+
* form is reported but never executed.
|
|
99
|
+
* @param filePath - the file actions were requested for.
|
|
100
|
+
* @param items - the normalized actions (edits in the uri→list projection).
|
|
101
|
+
* @param maxResultChars - the complete rendered-text cap.
|
|
102
|
+
* @returns the rendered text.
|
|
103
|
+
*/
|
|
104
|
+
export function formatCodeActions(filePath, items, maxResultChars) {
|
|
105
|
+
const header = `Code actions for ${filePath} (reference only — nothing was applied; apply an action's edits yourself with write/edit).`;
|
|
106
|
+
if (items.length === 0)
|
|
107
|
+
return boundResult(`${header}\nNo code actions available.`, maxResultChars, 'code actions');
|
|
108
|
+
const lines = [header];
|
|
109
|
+
for (const [index, item] of items.entries()) {
|
|
110
|
+
const tags = [
|
|
111
|
+
item.kind === undefined ? '' : item.kind,
|
|
112
|
+
item.isPreferred === true ? 'preferred' : '',
|
|
113
|
+
].filter(tag => tag !== '').join(', ');
|
|
114
|
+
lines.push(`${index + 1}. ${item.title}${tags === '' ? '' : ` [${tags}]`}`);
|
|
115
|
+
for (const document of item.edits ?? []) {
|
|
116
|
+
for (const edit of document.edits) {
|
|
117
|
+
const at = `${document.uri}:${edit.range.start.line + 1}:${edit.range.start.character + 1}`;
|
|
118
|
+
lines.push(` ${at} → ${singleLine(edit.newText)}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (item.command !== undefined) {
|
|
122
|
+
lines.push(` command (reference only, never executed): ${item.command.title}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return boundResult(lines.join('\n'), maxResultChars, 'code actions');
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Format a symbol result as model-facing text: one `name [Kind] at uri:line:col` line per symbol.
|
|
129
|
+
* @param items - the normalized symbols.
|
|
130
|
+
* @param maxResultChars - the complete rendered-text cap.
|
|
131
|
+
* @returns the rendered text.
|
|
132
|
+
*/
|
|
133
|
+
export function formatSymbols(items, maxResultChars) {
|
|
134
|
+
const header = `Symbols (${items.length}):`;
|
|
135
|
+
if (items.length === 0)
|
|
136
|
+
return boundResult(`${header} no symbols found.`, maxResultChars, 'symbols');
|
|
137
|
+
const lines = [header, ...items.map((item) => {
|
|
138
|
+
const at = `${item.location.uri}:${item.location.range.start.line + 1}:${item.location.range.start.character + 1}`;
|
|
139
|
+
const container = item.containerName === undefined ? '' : ` in ${item.containerName}`;
|
|
140
|
+
return `${item.name} [${symbolKindLabel(item.kind)}]${container} at ${at}`;
|
|
141
|
+
})];
|
|
142
|
+
return boundResult(lines.join('\n'), maxResultChars, 'symbols');
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Format a signature help result as model-facing text: the signatures with the active one and
|
|
146
|
+
* active parameter marked, plus parameter labels and documentation.
|
|
147
|
+
* @param filePath - the completed file.
|
|
148
|
+
* @param signatures - the normalized signatures.
|
|
149
|
+
* @param activeSignature - the server's active signature index.
|
|
150
|
+
* @param activeParameter - the server's active parameter index.
|
|
151
|
+
* @param maxResultChars - the complete rendered-text cap.
|
|
152
|
+
* @returns the rendered text.
|
|
153
|
+
*/
|
|
154
|
+
export function formatSignatures(filePath, signatures, activeSignature, activeParameter, maxResultChars) {
|
|
155
|
+
const header = `Signature help for ${filePath}:`;
|
|
156
|
+
if (signatures.length === 0)
|
|
157
|
+
return boundResult(`${header}\nNo signatures available.`, maxResultChars, 'signatures');
|
|
158
|
+
const lines = [header];
|
|
159
|
+
for (const [index, signature] of signatures.entries()) {
|
|
160
|
+
const marker = activeSignature === index ? '▶' : ' ';
|
|
161
|
+
lines.push(`${marker} ${index + 1}. ${signature.label}`);
|
|
162
|
+
for (const [parameterIndex, parameter] of (signature.parameters ?? []).entries()) {
|
|
163
|
+
const active = activeSignature === index && activeParameter === parameterIndex ? ' ▶ ' : ' ';
|
|
164
|
+
const doc = parameter.documentation === undefined ? '' : ` — ${parameter.documentation}`;
|
|
165
|
+
lines.push(`${active}${parameter.label}${doc}`);
|
|
166
|
+
}
|
|
167
|
+
if (signature.documentation !== undefined)
|
|
168
|
+
lines.push(` ${signature.documentation}`);
|
|
169
|
+
}
|
|
170
|
+
return boundResult(lines.join('\n'), maxResultChars, 'signatures');
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Format an inlay hint result as model-facing text: one `line:col label` line per hint.
|
|
174
|
+
* @param filePath - the hinted file.
|
|
175
|
+
* @param items - the normalized hints.
|
|
176
|
+
* @param maxResultChars - the complete rendered-text cap.
|
|
177
|
+
* @returns the rendered text.
|
|
178
|
+
*/
|
|
179
|
+
export function formatInlayHints(filePath, items, maxResultChars) {
|
|
180
|
+
const header = `Inlay hints for ${filePath}:`;
|
|
181
|
+
if (items.length === 0)
|
|
182
|
+
return boundResult(`${header}\nNo inlay hints available.`, maxResultChars, 'inlay hints');
|
|
183
|
+
const lines = [header, ...items.map((item) => {
|
|
184
|
+
const kind = item.kind === undefined ? '' : item.kind === 1 ? ' [type]' : item.kind === 2 ? ' [parameter]' : ` [kind ${item.kind}]`;
|
|
185
|
+
return `${item.position.line + 1}:${item.position.character + 1} ${item.label}${kind}`;
|
|
186
|
+
})];
|
|
187
|
+
return boundResult(lines.join('\n'), maxResultChars, 'inlay hints');
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Format a rename outcome as one model-facing line; the UI diff cards carry the applied changes
|
|
191
|
+
* per file, so the text stays a summary and the model re-reads the files for the full result.
|
|
192
|
+
* @param filePath - the file the rename was requested in.
|
|
193
|
+
* @param line - the one-based cursor line.
|
|
194
|
+
* @param character - the one-based cursor character.
|
|
195
|
+
* @param newName - the new symbol name.
|
|
196
|
+
* @param appliedEdits - how many edits were applied across the workspace.
|
|
197
|
+
* @param filesChanged - how many files changed.
|
|
198
|
+
* @returns the summary text.
|
|
199
|
+
*/
|
|
200
|
+
export function formatRenameResult(filePath, line, character, newName, appliedEdits, filesChanged) {
|
|
201
|
+
return `Renamed the symbol at ${filePath}:${line}:${character} to "${newName}": applied ${appliedEdits} edit${appliedEdits === 1 ? '' : 's'} across ${filesChanged} file${filesChanged === 1 ? '' : 's'}. The result cards show the diffs; re-read the files for the full result.`;
|
|
202
|
+
}
|
|
203
|
+
/** Collapse an edit's replacement text to its first line for the one-line edit listing. */
|
|
204
|
+
function singleLine(text) {
|
|
205
|
+
const first = text.split('\n', 1)[0] ?? '';
|
|
206
|
+
return first.length > 80 ? `${first.slice(0, 80)}…` : first;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Pending-state presenter for `lsp_diagnostics`: a generic search card focused on the file.
|
|
210
|
+
* @param args - the raw tool arguments.
|
|
211
|
+
* @returns the generic call view.
|
|
212
|
+
*/
|
|
213
|
+
export function presentLspDiagnosticsCall(args) {
|
|
214
|
+
return {
|
|
215
|
+
card: 'generic',
|
|
216
|
+
kind: 'search',
|
|
217
|
+
title: `LSP diagnostics ${args.file_path}`,
|
|
218
|
+
locations: [{ path: args.file_path }],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Completed-state presenter for `lsp_diagnostics`: severity-labeled lines rebuilt from the
|
|
223
|
+
* persisted projection, with a follow-along location on the first diagnostic.
|
|
224
|
+
* @param _args - the raw tool arguments (unused; the projection carries the result facts).
|
|
225
|
+
* @param result - the completed tool result.
|
|
226
|
+
* @returns the generic result view, or undefined to keep the fallback card.
|
|
227
|
+
*/
|
|
228
|
+
export function presentLspDiagnosticsResult(_args, result) {
|
|
229
|
+
if (result.isError)
|
|
230
|
+
return undefined;
|
|
231
|
+
const meta = result.meta;
|
|
232
|
+
if (meta === undefined || !Array.isArray(meta.diagnostics))
|
|
233
|
+
return undefined;
|
|
234
|
+
if (meta.diagnostics.length === 0) {
|
|
235
|
+
return { card: 'generic', title: `0 diagnostics in ${_args.file_path}`, content: [{ type: 'text', text: 'No diagnostics reported.' }] };
|
|
236
|
+
}
|
|
237
|
+
const lines = meta.diagnostics.map((diagnostic) => {
|
|
238
|
+
const label = SEVERITY_LABELS[diagnostic.severity] ?? `Severity ${diagnostic.severity}`;
|
|
239
|
+
const tail = diagnostic.code === undefined
|
|
240
|
+
? diagnostic.source === undefined ? '' : ` [${diagnostic.source}]`
|
|
241
|
+
: ` [${diagnostic.source ?? 'server'} ${String(diagnostic.code)}]`;
|
|
242
|
+
// Replays of logs persisted before the column projection fall back to line-only.
|
|
243
|
+
const at = diagnostic.character === undefined ? String(diagnostic.line) : `${diagnostic.line}:${diagnostic.character}`;
|
|
244
|
+
return `${_args.file_path}:${at} [${label}] ${diagnostic.message}${tail}`;
|
|
245
|
+
});
|
|
246
|
+
return {
|
|
247
|
+
card: 'generic',
|
|
248
|
+
title: `${meta.diagnostics.length} diagnostic${meta.diagnostics.length === 1 ? '' : 's'} in ${_args.file_path}`,
|
|
249
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Pending-state presenter for `lsp_completion`: a generic search card at the cursor.
|
|
254
|
+
* @param args - the raw tool arguments.
|
|
255
|
+
* @returns the generic call view.
|
|
256
|
+
*/
|
|
257
|
+
export function presentLspCompletionCall(args) {
|
|
258
|
+
return {
|
|
259
|
+
card: 'generic',
|
|
260
|
+
kind: 'search',
|
|
261
|
+
title: `LSP completion ${args.file_path}:${args.line}:${args.character}`,
|
|
262
|
+
locations: [{ path: args.file_path, line: args.line }],
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Completed-state presenter for `lsp_completion`: the reference-only item list rebuilt from the
|
|
267
|
+
* persisted projection.
|
|
268
|
+
* @param args - the raw tool arguments (used for the title).
|
|
269
|
+
* @param result - the completed tool result.
|
|
270
|
+
* @returns the generic result view, or undefined to keep the fallback card.
|
|
271
|
+
*/
|
|
272
|
+
export function presentLspCompletionResult(args, result) {
|
|
273
|
+
if (result.isError)
|
|
274
|
+
return undefined;
|
|
275
|
+
const meta = result.meta;
|
|
276
|
+
if (meta === undefined || !Array.isArray(meta.items))
|
|
277
|
+
return undefined;
|
|
278
|
+
if (meta.items.length === 0) {
|
|
279
|
+
return { card: 'generic', title: `No completions at ${args.file_path}:${args.line}:${args.character}`, content: [{ type: 'text', text: 'No completions available.' }] };
|
|
280
|
+
}
|
|
281
|
+
const lines = meta.items.flatMap((item, index) => {
|
|
282
|
+
const label = item.detail === undefined ? item.label : `${item.label} — ${item.detail}`;
|
|
283
|
+
const snippet = item.insertText === undefined || item.insertText === item.label ? [] : [` → ${item.insertText}`];
|
|
284
|
+
return [`${index + 1}. ${label}`, ...snippet];
|
|
285
|
+
});
|
|
286
|
+
return {
|
|
287
|
+
card: 'generic',
|
|
288
|
+
title: `${meta.items.length} completion${meta.items.length === 1 ? '' : 's'} at ${args.file_path}:${args.line}:${args.character}`,
|
|
289
|
+
content: [{ type: 'text', text: `Reference only — nothing was executed.\n${lines.join('\n')}` }],
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Pending-state presenter for `lsp_format`: the diff exists only after the server answers, so the
|
|
294
|
+
* pending card is a generic edit card; the completed diff card replaces it.
|
|
295
|
+
* @param args - the raw tool arguments.
|
|
296
|
+
* @returns the generic call view.
|
|
297
|
+
*/
|
|
298
|
+
export function presentLspFormatCall(args) {
|
|
299
|
+
return {
|
|
300
|
+
card: 'generic',
|
|
301
|
+
kind: 'edit',
|
|
302
|
+
title: `Format ${args.file_path}`,
|
|
303
|
+
locations: [{ path: args.file_path }],
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Completed-state presenter for `lsp_format`: the applied whole-file diff rebuilt from the
|
|
308
|
+
* persisted projection, so replay reproduces the card without re-reading the file.
|
|
309
|
+
* @param args - the raw tool arguments (used for the title).
|
|
310
|
+
* @param result - the completed tool result.
|
|
311
|
+
* @returns the diff result view, or undefined to keep the fallback card.
|
|
312
|
+
*/
|
|
313
|
+
export function presentLspFormatResult(args, result) {
|
|
314
|
+
if (result.isError)
|
|
315
|
+
return undefined;
|
|
316
|
+
const meta = result.meta;
|
|
317
|
+
if (meta === undefined || !Array.isArray(meta.diffs))
|
|
318
|
+
return undefined;
|
|
319
|
+
if (meta.diffs.length === 0) {
|
|
320
|
+
return { card: 'diff', title: `Format ${args.file_path}`, diffs: [] };
|
|
321
|
+
}
|
|
322
|
+
return { card: 'diff', title: `Format ${args.file_path}`, diffs: [...meta.diffs] };
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Pending-state presenter for `lsp_code_action`: a generic search card on the file.
|
|
326
|
+
* @param args - the raw tool arguments.
|
|
327
|
+
* @returns the generic call view.
|
|
328
|
+
*/
|
|
329
|
+
export function presentLspCodeActionCall(args) {
|
|
330
|
+
return {
|
|
331
|
+
card: 'generic',
|
|
332
|
+
kind: 'search',
|
|
333
|
+
title: `LSP code actions ${args.file_path}`,
|
|
334
|
+
locations: [{ path: args.file_path }],
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Completed-state presenter for `lsp_code_action`: the reference-only action list.
|
|
339
|
+
* @param _args - the raw tool arguments.
|
|
340
|
+
* @param result - the completed tool result.
|
|
341
|
+
* @returns the generic result view, or undefined to keep the fallback card.
|
|
342
|
+
*/
|
|
343
|
+
export function presentLspCodeActionResult(_args, result) {
|
|
344
|
+
if (result.isError)
|
|
345
|
+
return undefined;
|
|
346
|
+
const meta = result.meta;
|
|
347
|
+
if (meta === undefined || !Array.isArray(meta.items))
|
|
348
|
+
return undefined;
|
|
349
|
+
if (meta.items.length === 0) {
|
|
350
|
+
return { card: 'generic', title: `No code actions for ${_args.file_path}`, content: [{ type: 'text', text: 'No code actions available.' }] };
|
|
351
|
+
}
|
|
352
|
+
const lines = meta.items.map((item, index) => {
|
|
353
|
+
const tags = [item.kind ?? '', item.isPreferred === true ? 'preferred' : ''].filter(tag => tag !== '').join(', ');
|
|
354
|
+
return `${index + 1}. ${item.title}${tags === '' ? '' : ` [${tags}]`}`;
|
|
355
|
+
});
|
|
356
|
+
return {
|
|
357
|
+
card: 'generic',
|
|
358
|
+
title: `${meta.items.length} code action${meta.items.length === 1 ? '' : 's'} for ${_args.file_path}`,
|
|
359
|
+
content: [{ type: 'text', text: `Reference only — nothing was applied.\n${lines.join('\n')}` }],
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Pending-state presenter for `lsp_symbols`: a generic search card.
|
|
364
|
+
* @param args - the raw tool arguments.
|
|
365
|
+
* @returns the generic call view.
|
|
366
|
+
*/
|
|
367
|
+
export function presentLspSymbolsCall(args) {
|
|
368
|
+
const subject = args.query !== undefined ? `"${args.query}"` : args.file_path ?? '';
|
|
369
|
+
return {
|
|
370
|
+
card: 'generic',
|
|
371
|
+
kind: 'search',
|
|
372
|
+
title: `LSP symbols ${subject}`,
|
|
373
|
+
...args.file_path === undefined ? {} : { locations: [{ path: args.file_path }] },
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Completed-state presenter for `lsp_symbols`: name, kind, and location lines.
|
|
378
|
+
* @param _args - the raw tool arguments.
|
|
379
|
+
* @param result - the completed tool result.
|
|
380
|
+
* @returns the generic result view, or undefined to keep the fallback card.
|
|
381
|
+
*/
|
|
382
|
+
export function presentLspSymbolsResult(_args, result) {
|
|
383
|
+
if (result.isError)
|
|
384
|
+
return undefined;
|
|
385
|
+
const meta = result.meta;
|
|
386
|
+
if (meta === undefined || !Array.isArray(meta.items))
|
|
387
|
+
return undefined;
|
|
388
|
+
if (meta.items.length === 0) {
|
|
389
|
+
return { card: 'generic', title: 'No symbols found', content: [{ type: 'text', text: 'No symbols found.' }] };
|
|
390
|
+
}
|
|
391
|
+
const lines = meta.items.map(item => (`${item.name} [${symbolKindLabel(item.kind)}] at ${item.location.uri}:${item.location.line}:${item.location.character}`));
|
|
392
|
+
return { card: 'generic', title: `${meta.items.length} symbol${meta.items.length === 1 ? '' : 's'}`, content: [{ type: 'text', text: lines.join('\n') }] };
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Pending-state presenter for `lsp_signature`: a generic search card at the cursor.
|
|
396
|
+
* @param args - the raw tool arguments.
|
|
397
|
+
* @returns the generic call view.
|
|
398
|
+
*/
|
|
399
|
+
export function presentLspSignatureCall(args) {
|
|
400
|
+
return {
|
|
401
|
+
card: 'generic',
|
|
402
|
+
kind: 'search',
|
|
403
|
+
title: `LSP signature ${args.file_path}:${args.line}:${args.character}`,
|
|
404
|
+
locations: [{ path: args.file_path, line: args.line }],
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Completed-state presenter for `lsp_signature`: the signature labels.
|
|
409
|
+
* @param _args - the raw tool arguments.
|
|
410
|
+
* @param result - the completed tool result.
|
|
411
|
+
* @returns the generic result view, or undefined to keep the fallback card.
|
|
412
|
+
*/
|
|
413
|
+
export function presentLspSignatureResult(_args, result) {
|
|
414
|
+
if (result.isError)
|
|
415
|
+
return undefined;
|
|
416
|
+
const meta = result.meta;
|
|
417
|
+
if (meta === undefined || !Array.isArray(meta.signatures))
|
|
418
|
+
return undefined;
|
|
419
|
+
if (meta.signatures.length === 0) {
|
|
420
|
+
return { card: 'generic', title: `No signatures at ${_args.file_path}:${_args.line}:${_args.character}`, content: [{ type: 'text', text: 'No signatures available.' }] };
|
|
421
|
+
}
|
|
422
|
+
const lines = meta.signatures.map((signature, index) => (`${index + 1}. ${signature.label}${signature.documentation === undefined ? '' : ` — ${signature.documentation}`}`));
|
|
423
|
+
return { card: 'generic', title: `${meta.signatures.length} signature${meta.signatures.length === 1 ? '' : 's'} at ${_args.file_path}:${_args.line}:${_args.character}`, content: [{ type: 'text', text: lines.join('\n') }] };
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Pending-state presenter for `lsp_inlay_hints`: a generic search card on the file.
|
|
427
|
+
* @param args - the raw tool arguments.
|
|
428
|
+
* @returns the generic call view.
|
|
429
|
+
*/
|
|
430
|
+
export function presentLspInlayHintsCall(args) {
|
|
431
|
+
return {
|
|
432
|
+
card: 'generic',
|
|
433
|
+
kind: 'search',
|
|
434
|
+
title: `LSP inlay hints ${args.file_path}`,
|
|
435
|
+
locations: [{ path: args.file_path }],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Completed-state presenter for `lsp_inlay_hints`: one line per hint.
|
|
440
|
+
* @param _args - the raw tool arguments.
|
|
441
|
+
* @param result - the completed tool result.
|
|
442
|
+
* @returns the generic result view, or undefined to keep the fallback card.
|
|
443
|
+
*/
|
|
444
|
+
export function presentLspInlayHintsResult(_args, result) {
|
|
445
|
+
if (result.isError)
|
|
446
|
+
return undefined;
|
|
447
|
+
const meta = result.meta;
|
|
448
|
+
if (meta === undefined || !Array.isArray(meta.items))
|
|
449
|
+
return undefined;
|
|
450
|
+
if (meta.items.length === 0) {
|
|
451
|
+
return { card: 'generic', title: `No inlay hints for ${_args.file_path}`, content: [{ type: 'text', text: 'No inlay hints available.' }] };
|
|
452
|
+
}
|
|
453
|
+
const lines = meta.items.map(item => `${item.line}:${item.character} ${item.label}`);
|
|
454
|
+
return { card: 'generic', title: `${meta.items.length} inlay hint${meta.items.length === 1 ? '' : 's'} for ${_args.file_path}`, content: [{ type: 'text', text: lines.join('\n') }] };
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Pending-state presenter for `lsp_rename`: the diffs exist only after the server answers, so the
|
|
458
|
+
* pending card is a generic edit card; the completed diff cards replace it.
|
|
459
|
+
* @param args - the raw tool arguments.
|
|
460
|
+
* @returns the generic call view.
|
|
461
|
+
*/
|
|
462
|
+
export function presentLspRenameCall(args) {
|
|
463
|
+
return {
|
|
464
|
+
card: 'generic',
|
|
465
|
+
kind: 'edit',
|
|
466
|
+
title: `Rename at ${args.file_path}:${args.line}:${args.character} to ${args.new_name}`,
|
|
467
|
+
locations: [{ path: args.file_path, line: args.line }],
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Completed-state presenter for `lsp_rename`: one applied diff card per changed file, rebuilt
|
|
472
|
+
* from the persisted projection so replay reproduces the cards without re-reading the files.
|
|
473
|
+
* @param args - the raw tool arguments (used for the title).
|
|
474
|
+
* @param result - the completed tool result.
|
|
475
|
+
* @returns the diff result view, or undefined to keep the fallback card.
|
|
476
|
+
*/
|
|
477
|
+
export function presentLspRenameResult(args, result) {
|
|
478
|
+
if (result.isError)
|
|
479
|
+
return undefined;
|
|
480
|
+
const meta = result.meta;
|
|
481
|
+
if (meta === undefined || !Array.isArray(meta.diffs))
|
|
482
|
+
return undefined;
|
|
483
|
+
return { card: 'diff', title: `Rename to ${args.new_name}`, diffs: [...meta.diffs] };
|
|
484
|
+
}
|
|
485
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,iEAAiE;AACjE,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAU,CAAA;AAEhF,2FAA2F;AAC3F,MAAM,kBAAkB,GAAG;IACzB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa;IACnG,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO;IAC/F,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe;CAC7E,CAAA;AAEV,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACtC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ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AAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAA;AACvL,CAAC;AASD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAoB;IACvD,OAAO;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,aAAa,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,OAAO,IAAI,CAAC,QAAQ,EAAE;QACvF,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;KACvD,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAoB,EAAE,MAAkB;IAC7E,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IACpC,MAAM,IAAI,GAAG,MAAM,CAAC,IAA2C,CAAA;IAC/D,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACtE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAA;AACtF,CAAC"}
|
package/lib/runner.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The action runner the three tools call: official-seam-first, own-client-fallback. When the
|
|
3
|
+
* extended `ctx.lsp` seam is mounted, actions go through it; when the seam is absent, too old, or
|
|
4
|
+
* has no provider for the file, the plugin's own client serves the call from the `servers` table.
|
|
5
|
+
* A seam provider that exists but lacks the capability fails loud — the user configured the
|
|
6
|
+
* server in one place and gets a real error instead of a silently spawned duplicate.
|
|
7
|
+
* @module dsh-lsp-actions/runner
|
|
8
|
+
*/
|
|
9
|
+
import { LspActionClient } from './client.ts';
|
|
10
|
+
import type { HostSource } from './host.ts';
|
|
11
|
+
import type { ResolvedServer } from './servers.ts';
|
|
12
|
+
import type { SeamService } from './seam.ts';
|
|
13
|
+
import type { LspCodeActionsResult, LspCompletionResult, LspDiagnosticsResult, LspEditsResult, LspInlayHintsResult, LspPosition, LspRange, LspRenameResult, LspSignaturesResult, LspSymbolsResult } from './vocabulary.ts';
|
|
14
|
+
/** One action call as the tools prepare it: everything the runner needs to serve it either way. */
|
|
15
|
+
export interface RunnerRequest {
|
|
16
|
+
/** The source file (relative to `workspaceRoot` or absolute). */
|
|
17
|
+
readonly filePath: string;
|
|
18
|
+
/** The workspace root the server resolves against. */
|
|
19
|
+
readonly workspaceRoot: string;
|
|
20
|
+
/** The pre-read source the own client's didOpen synchronizes (the seam re-reads its own copy). */
|
|
21
|
+
readonly source?: HostSource;
|
|
22
|
+
/** The cursor position, for completion and signature help. */
|
|
23
|
+
readonly position?: LspPosition;
|
|
24
|
+
/** The formatting/code-action/inlay-hint range, for range-scoped operations. */
|
|
25
|
+
readonly range?: LspRange;
|
|
26
|
+
/** The symbol name query, for workspace symbol search. */
|
|
27
|
+
readonly query?: string;
|
|
28
|
+
/** CodeActionKind filters, for code actions. */
|
|
29
|
+
readonly onlyKinds?: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
/** The unified surface the tools consume, agnostic of which backend served the result. */
|
|
32
|
+
export interface ActionRunner {
|
|
33
|
+
diagnostics(request: RunnerRequest, signal?: AbortSignal): Promise<LspDiagnosticsResult>;
|
|
34
|
+
formatDocument(request: RunnerRequest, signal?: AbortSignal): Promise<LspEditsResult>;
|
|
35
|
+
completion(request: RunnerRequest, signal?: AbortSignal): Promise<LspCompletionResult>;
|
|
36
|
+
codeActions(request: RunnerRequest, signal?: AbortSignal): Promise<LspCodeActionsResult>;
|
|
37
|
+
workspaceSymbols(request: RunnerRequest, signal?: AbortSignal): Promise<LspSymbolsResult>;
|
|
38
|
+
documentSymbols(request: RunnerRequest, signal?: AbortSignal): Promise<LspSymbolsResult>;
|
|
39
|
+
signatureHelp(request: RunnerRequest, signal?: AbortSignal): Promise<LspSignaturesResult>;
|
|
40
|
+
inlayHints(request: RunnerRequest, signal?: AbortSignal): Promise<LspInlayHintsResult>;
|
|
41
|
+
rename(request: RunnerRequest, newName: string, signal?: AbortSignal): Promise<LspRenameResult>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create the seam-first action runner. The seam is resolved through `getSeam` on every call, not
|
|
45
|
+
* captured at apply time, so the plugin serves through a seam that loads after it or is re-added
|
|
46
|
+
* later; a seam that is absent at call time falls back to the own client.
|
|
47
|
+
* @param options - the per-call seam resolver, the own client, and the resolved server table.
|
|
48
|
+
* @returns the runner facade.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createActionRunner(options: {
|
|
51
|
+
readonly getSeam: () => SeamService | undefined;
|
|
52
|
+
readonly client: LspActionClient;
|
|
53
|
+
readonly servers: readonly ResolvedServer[];
|
|
54
|
+
}): ActionRunner;
|
|
55
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,gBAAgB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