@omercnet/paseo-omp 5.4.0-next.398.1 → 5.4.0-next.400.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/OVERVIEW.md +1 -0
- package/client/lsp-diagnostics.tsx +69 -0
- package/index.client.tsx +21 -0
- package/package.json +1 -1
- package/server/omp-settings.ts +3 -4
- package/server/package-version.ts +1 -1
- package/shared/lsp-diagnostics.ts +141 -0
- package/shared/omp-settings.ts +4 -2
package/OVERVIEW.md
CHANGED
|
@@ -16,6 +16,7 @@ OMP adds an agent provider for the OMP coding agent, plus an OMP sidebar and wor
|
|
|
16
16
|
- An **MCP** composer control runs OMP's MCP management in the current session, with authorization prompts shown in the chat.
|
|
17
17
|
- While OMP subagents run, a row under each `task` card in the conversation lets you steer one with a message or stop it after confirmation. It needs OMP 18.4.9 or newer.
|
|
18
18
|
- When an OMP rule fires during a turn of an agent on Paseo's bundled `omp` provider, a notice under that turn names the rule and the text it matched. The plugin reads this, best effort, from the end of the agent's OMP session file, which that provider does not report.
|
|
19
|
+
- When an agent on Paseo's bundled `omp` provider calls OMP's `lsp` tool for diagnostics, the call shows as a card grouped by file with an icon per severity. Output the plugin does not recognize keeps the original row.
|
|
19
20
|
- OMP agents can call Paseo's orchestration tools with the optional `serverId` argument and `list_hosts` to delegate work to other connected Paseo hosts.
|
|
20
21
|
|
|
21
22
|
## Reads and sends
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
2
|
+
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
import type { OmpLspDiagnostics, OmpLspSeverity } from "../shared/lsp-diagnostics";
|
|
5
|
+
|
|
6
|
+
type Theme = PluginTimelineItemProps<OmpLspDiagnostics>["theme"];
|
|
7
|
+
|
|
8
|
+
const SEVERITY_ICON = {
|
|
9
|
+
error: "CircleX",
|
|
10
|
+
warning: "TriangleAlert",
|
|
11
|
+
info: "Info",
|
|
12
|
+
hint: "Lightbulb",
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
function severityColor(theme: Theme, severity: OmpLspSeverity): string {
|
|
16
|
+
if (severity === "error") return theme.colors.statusDanger;
|
|
17
|
+
if (severity === "warning") return theme.colors.statusWarning;
|
|
18
|
+
return theme.colors.foregroundMuted;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function countLabel(data: OmpLspDiagnostics): string {
|
|
22
|
+
const total = data.files.reduce((sum, file) => sum + file.diagnostics.length, 0);
|
|
23
|
+
const issues = total === 1 ? "1 issue" : `${total} issues`;
|
|
24
|
+
const files = data.files.length === 1 ? "1 file" : `${data.files.length} files`;
|
|
25
|
+
return `LSP diagnostics: ${issues} in ${files}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function OmpLspDiagnosticsCard({ item, theme }: PluginTimelineItemProps<OmpLspDiagnostics>) {
|
|
29
|
+
const { foreground, foregroundMuted, border, surface1 } = theme.colors;
|
|
30
|
+
return (
|
|
31
|
+
<View
|
|
32
|
+
style={{
|
|
33
|
+
gap: 8,
|
|
34
|
+
padding: 10,
|
|
35
|
+
borderRadius: 8,
|
|
36
|
+
borderWidth: 1,
|
|
37
|
+
borderColor: border,
|
|
38
|
+
backgroundColor: surface1,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<Text style={{ color: foregroundMuted, fontSize: 13 }}>{countLabel(item.data)}</Text>
|
|
42
|
+
{item.data.files.map((file) => (
|
|
43
|
+
<View key={file.path} style={{ gap: 4 }}>
|
|
44
|
+
<Text style={{ color: foreground, fontSize: 13, fontWeight: "500" }} selectable>
|
|
45
|
+
{file.path}
|
|
46
|
+
</Text>
|
|
47
|
+
{file.diagnostics.map((diagnostic, index) => (
|
|
48
|
+
<View
|
|
49
|
+
key={`${index}:${diagnostic.line}:${diagnostic.column}`}
|
|
50
|
+
style={{ flexDirection: "row", alignItems: "flex-start", gap: 6 }}
|
|
51
|
+
>
|
|
52
|
+
<Icon
|
|
53
|
+
name={SEVERITY_ICON[diagnostic.severity]}
|
|
54
|
+
size={14}
|
|
55
|
+
color={severityColor(theme, diagnostic.severity)}
|
|
56
|
+
/>
|
|
57
|
+
<Text style={{ color: foregroundMuted, fontSize: 13 }}>
|
|
58
|
+
{`${diagnostic.line}:${diagnostic.column}`}
|
|
59
|
+
</Text>
|
|
60
|
+
<Text style={{ color: foreground, fontSize: 13, flexShrink: 1 }} selectable>
|
|
61
|
+
{diagnostic.message}
|
|
62
|
+
</Text>
|
|
63
|
+
</View>
|
|
64
|
+
))}
|
|
65
|
+
</View>
|
|
66
|
+
))}
|
|
67
|
+
</View>
|
|
68
|
+
);
|
|
69
|
+
}
|
package/index.client.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { ConfigSidebarItem } from "./client/config-sidebar";
|
|
|
8
8
|
import { OMP_ICON } from "./client/hub-icon";
|
|
9
9
|
import { HubPopover } from "./client/hub-popover";
|
|
10
10
|
import { summarizeHubProcesses } from "./client/hub-status";
|
|
11
|
+
import { OmpLspDiagnosticsCard } from "./client/lsp-diagnostics";
|
|
11
12
|
import { OmpMcpAuthorizationCard } from "./client/mcp-authorization";
|
|
12
13
|
import { McpPopover } from "./client/mcp-popover";
|
|
13
14
|
import { OmpMemoryPanel } from "./client/memory-panel";
|
|
@@ -43,6 +44,11 @@ import {
|
|
|
43
44
|
composerPillSettingsSchema,
|
|
44
45
|
} from "./shared/composer-pill-settings";
|
|
45
46
|
import { listHubProcesses } from "./shared/hub";
|
|
47
|
+
import {
|
|
48
|
+
OMP_LSP_DIAGNOSTICS_KIND,
|
|
49
|
+
ompLspDiagnosticsSchema,
|
|
50
|
+
transformOmpLspToolItem,
|
|
51
|
+
} from "./shared/lsp-diagnostics";
|
|
46
52
|
import { OMP_MCP_AUTH_TIMELINE_KIND, ompMcpAuthorizationTimelineSchema } from "./shared/mcp";
|
|
47
53
|
import { type OmpStore, storeForProvider } from "./shared/omp-store";
|
|
48
54
|
import { ompImageTimelineSchema, transformOmpImageToolItem } from "./shared/provider-image";
|
|
@@ -229,6 +235,19 @@ export default function contribute(client: PluginClientContext) {
|
|
|
229
235
|
schema: ompRuleNoticeSchema,
|
|
230
236
|
Component: OmpRuleNoticeRow,
|
|
231
237
|
});
|
|
238
|
+
const removeLspDiagnosticsRenderer = client.addTimelineRenderer({
|
|
239
|
+
kind: OMP_LSP_DIAGNOSTICS_KIND,
|
|
240
|
+
version: 1,
|
|
241
|
+
schema: ompLspDiagnosticsSchema,
|
|
242
|
+
Component: OmpLspDiagnosticsCard,
|
|
243
|
+
});
|
|
244
|
+
const removeLspTransformer = client.addTimelineTransformer({
|
|
245
|
+
id: "omp-lsp-diagnostics",
|
|
246
|
+
query: { itemType: "tool_call" },
|
|
247
|
+
transform({ item }) {
|
|
248
|
+
return transformOmpLspToolItem(item);
|
|
249
|
+
},
|
|
250
|
+
});
|
|
232
251
|
const removeImageTransformer = client.addTimelineTransformer({
|
|
233
252
|
id: "omp-images",
|
|
234
253
|
query: { itemType: "tool_call" },
|
|
@@ -521,6 +540,8 @@ export default function contribute(client: PluginClientContext) {
|
|
|
521
540
|
removeMcpAuthorizationRenderer();
|
|
522
541
|
removeSubagentStripRenderer();
|
|
523
542
|
removeRuleNoticeRenderer();
|
|
543
|
+
removeLspDiagnosticsRenderer();
|
|
544
|
+
removeLspTransformer();
|
|
524
545
|
removeImageTransformer();
|
|
525
546
|
removeOpenConfig();
|
|
526
547
|
removeConfigEntry();
|
package/package.json
CHANGED
package/server/omp-settings.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { parseDocument, parse as parseYaml } from "yaml";
|
|
|
7
7
|
import {
|
|
8
8
|
isOmpStructuredSettingPath,
|
|
9
9
|
type listOmpSettings,
|
|
10
|
-
|
|
10
|
+
OMP_SETTING_DESCRIPTIONS,
|
|
11
11
|
OMP_SETTINGS_CATALOG_VERSION,
|
|
12
12
|
type OmpSetting,
|
|
13
13
|
type OmpSettingType,
|
|
@@ -197,9 +197,8 @@ export function parseOmpSettingsList(raw: unknown): ParsedOmpSettings {
|
|
|
197
197
|
path,
|
|
198
198
|
type: parsedType.data,
|
|
199
199
|
description:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
: (OMP_SETTING_FALLBACK_DESCRIPTIONS[path] ?? ""),
|
|
200
|
+
OMP_SETTING_DESCRIPTIONS[path] ??
|
|
201
|
+
(typeof entry.description === "string" ? entry.description : ""),
|
|
203
202
|
...(redacted
|
|
204
203
|
? { redacted: true, ...(configured === undefined ? {} : { configured }) }
|
|
205
204
|
: { value: entry.value }),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Release Please keeps this bundle-safe constant aligned with package.json. */
|
|
2
|
-
export const PASEO_OMP_PACKAGE_VERSION = "5.4.0-next.
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "5.4.0-next.400.1"; // x-release-please-version
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const OMP_LSP_DIAGNOSTICS_KIND = "omp-lsp-diagnostics";
|
|
4
|
+
|
|
5
|
+
const severitySchema = z.enum(["error", "warning", "info", "hint"]);
|
|
6
|
+
export type OmpLspSeverity = z.infer<typeof severitySchema>;
|
|
7
|
+
|
|
8
|
+
export const ompLspDiagnosticsSchema = z.object({
|
|
9
|
+
files: z
|
|
10
|
+
.array(
|
|
11
|
+
z.object({
|
|
12
|
+
path: z.string().min(1),
|
|
13
|
+
diagnostics: z
|
|
14
|
+
.array(
|
|
15
|
+
z.object({
|
|
16
|
+
line: z.number().int().positive(),
|
|
17
|
+
column: z.number().int().positive(),
|
|
18
|
+
severity: severitySchema,
|
|
19
|
+
message: z.string(),
|
|
20
|
+
}),
|
|
21
|
+
)
|
|
22
|
+
.min(1),
|
|
23
|
+
}),
|
|
24
|
+
)
|
|
25
|
+
.min(1),
|
|
26
|
+
});
|
|
27
|
+
export type OmpLspDiagnostics = z.infer<typeof ompLspDiagnosticsSchema>;
|
|
28
|
+
|
|
29
|
+
const COUNTS =
|
|
30
|
+
"\\d+ (?:error|warning|info|hint)\\(s\\)(?:, \\d+ (?:error|warning|info|hint)\\(s\\))*";
|
|
31
|
+
const HEADING = /^(#+) (.+)$/u;
|
|
32
|
+
const DIAGNOSTIC = /^\s+(\d+):(\d+) \[(error|warning|info|hint)\] (.+)$/u;
|
|
33
|
+
/** `3 error(s):` opens a single-target result. */
|
|
34
|
+
const TOTAL = new RegExp(`^${COUNTS}:$`, "u");
|
|
35
|
+
/** A glob result opens each file with `<icon> <path>: 1 error(s)` or `<icon> <path>: no issues`. */
|
|
36
|
+
const FILE_SUMMARY = new RegExp(`^\\S+ .+: (?:${COUNTS}|no issues)$`, "u");
|
|
37
|
+
/** OMP's own warnings (`<icon> a.ts: some servers failed (...)`, `[Showing lines ...]`) are not diagnostics. */
|
|
38
|
+
const NOTE =
|
|
39
|
+
/^(?:\S+ .+: (?:no diagnostics report yet|some servers failed|all language servers failed|No language server found)|\[.*\])/u;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Parses the text of an OMP `lsp` diagnostics result: a headed tree (`# dir/`, `## file`) whose
|
|
43
|
+
* files list `line:col [severity] message` rows. Returns `undefined` unless every file group is
|
|
44
|
+
* recognized, so unknown output keeps its original row.
|
|
45
|
+
*/
|
|
46
|
+
export function parseOmpLspDiagnostics(text: string): OmpLspDiagnostics | undefined {
|
|
47
|
+
const files = new Map<string, OmpLspDiagnostics["files"][number]["diagnostics"]>();
|
|
48
|
+
const directories: string[] = [];
|
|
49
|
+
let current: OmpLspDiagnostics["files"][number]["diagnostics"] | undefined;
|
|
50
|
+
let summarized = false;
|
|
51
|
+
let afterBlank = false;
|
|
52
|
+
for (const line of text.split("\n")) {
|
|
53
|
+
if (line.trim() === "") {
|
|
54
|
+
afterBlank = true;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const wasAfterBlank = afterBlank;
|
|
58
|
+
afterBlank = false;
|
|
59
|
+
if (TOTAL.test(line) || FILE_SUMMARY.test(line)) {
|
|
60
|
+
summarized = true;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (NOTE.test(line)) return undefined;
|
|
64
|
+
const heading = HEADING.exec(line);
|
|
65
|
+
if (heading) {
|
|
66
|
+
const depth = (heading[1] ?? "").length - 1;
|
|
67
|
+
const name = heading[2] ?? "";
|
|
68
|
+
directories.length = depth;
|
|
69
|
+
if (name.endsWith("/")) {
|
|
70
|
+
directories[depth] = name;
|
|
71
|
+
current = undefined;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const path = directories.join("") + name;
|
|
75
|
+
current = files.get(path) ?? [];
|
|
76
|
+
files.set(path, current);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const diagnostic = DIAGNOSTIC.exec(line);
|
|
80
|
+
if (diagnostic && current) {
|
|
81
|
+
current.push({
|
|
82
|
+
line: Number(diagnostic[1]),
|
|
83
|
+
column: Number(diagnostic[2]),
|
|
84
|
+
severity: severitySchema.parse(diagnostic[3]),
|
|
85
|
+
message: diagnostic[4] ?? "",
|
|
86
|
+
});
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const last = current?.at(-1);
|
|
90
|
+
if (!last || wasAfterBlank) return undefined;
|
|
91
|
+
last.message += `\n${line.trim()}`;
|
|
92
|
+
}
|
|
93
|
+
if (!summarized) return undefined;
|
|
94
|
+
const parsed = ompLspDiagnosticsSchema.safeParse({
|
|
95
|
+
files: [...files].map(([path, diagnostics]) => ({ path, diagnostics })),
|
|
96
|
+
});
|
|
97
|
+
return parsed.success ? parsed.data : undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const textBlockSchema = z.object({ type: z.string(), text: z.string().optional() }).loose();
|
|
101
|
+
const lspToolRowSchema = z.object({
|
|
102
|
+
name: z.literal("lsp"),
|
|
103
|
+
callId: z.string(),
|
|
104
|
+
status: z.literal("completed"),
|
|
105
|
+
detail: z.union([
|
|
106
|
+
z.object({ type: z.literal("plain_text"), text: z.string() }),
|
|
107
|
+
z.object({
|
|
108
|
+
type: z.literal("unknown"),
|
|
109
|
+
output: z.object({ content: z.array(textBlockSchema) }).loose(),
|
|
110
|
+
}),
|
|
111
|
+
]),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Replaces a completed built-in `lsp` tool row with a diagnostics card. The built-in provider keeps
|
|
116
|
+
* only the result text (and raw JSON for an unmapped tool), so anything unparsable stays as is.
|
|
117
|
+
*/
|
|
118
|
+
export function transformOmpLspToolItem(item: unknown) {
|
|
119
|
+
const row = lspToolRowSchema.safeParse(item);
|
|
120
|
+
if (!row.success) return undefined;
|
|
121
|
+
const { detail } = row.data;
|
|
122
|
+
const text =
|
|
123
|
+
detail.type === "plain_text"
|
|
124
|
+
? detail.text
|
|
125
|
+
: detail.output.content
|
|
126
|
+
.flatMap((block) => (block.text === undefined ? [] : [block.text]))
|
|
127
|
+
.join("\n");
|
|
128
|
+
const data = parseOmpLspDiagnostics(text);
|
|
129
|
+
if (!data) return undefined;
|
|
130
|
+
return {
|
|
131
|
+
items: [
|
|
132
|
+
{
|
|
133
|
+
type: "plugin" as const,
|
|
134
|
+
kind: OMP_LSP_DIAGNOSTICS_KIND,
|
|
135
|
+
id: row.data.callId,
|
|
136
|
+
version: 1,
|
|
137
|
+
data,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
}
|
package/shared/omp-settings.ts
CHANGED
|
@@ -327,12 +327,14 @@ export function formatOmpSettingLabel(path: string): string {
|
|
|
327
327
|
return words ? `${words[0]?.toUpperCase() ?? ""}${words.slice(1)}` : path;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
/**
|
|
331
|
-
export const
|
|
330
|
+
/** Plain wording that replaces OMP's own description (or its absence) for these settings. */
|
|
331
|
+
export const OMP_SETTING_DESCRIPTIONS: Readonly<Record<string, string>> = {
|
|
332
332
|
"session.warnCost":
|
|
333
333
|
"Warn once when a session's spend reaches this many US dollars. Leave unset for no warning. Applies to every session, including subagents, and takes effect on the next request.",
|
|
334
334
|
"session.maxCost":
|
|
335
335
|
"Stop a session from sending new model requests once its spend reaches this many US dollars. Leave unset for no limit. Requests already in flight can finish past the limit; raise or reset the value to continue.",
|
|
336
|
+
"secrets.enabled":
|
|
337
|
+
"Hides keys, tokens and passwords from the model provider. Values are swapped for placeholders before text is sent and restored when the model uses them in a tool call. OMP detects environment variables named like KEY, TOKEN, SECRET or PASSWORD, passwords of 8 or more characters in connection URLs held in environment variables, and common token formats. Custom rules live in secrets.yml in the OMP agent folder or a project's .omp folder; edit that file by hand, Paseo never shows it. Best effort, not a guarantee: system prompts, static tool definitions and images are not covered. Applies to new sessions.",
|
|
336
338
|
};
|
|
337
339
|
|
|
338
340
|
export const listOmpSettings = defineRpc({
|