@omercnet/paseo-omp 5.4.0-next.393.1 → 5.4.0-next.394.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 +1 -1
- package/client/config-sidebar.tsx +15 -0
- package/client/sidebar-compat.ts +0 -109
- package/index.client.tsx +5 -25
- package/package.json +1 -1
- package/server/package-version.ts +1 -1
- package/client/hub-sidebar.tsx +0 -99
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ Provider functionality outside the capability flags is tracked separately:
|
|
|
112
112
|
| Usage reporting | **100%** | Periodic, post-compaction, fallback, terminal, timeout, and recovered-runtime samples publish `session.usage`. |
|
|
113
113
|
| 0.11 provider `status()` | **75%** | Registered for the plugin-owned default launch (`OMP_COMMAND` or `omp`, plus the fixed `--profile` wrapper for profile providers), using the bounded `--version`/`--help` probe. Only a missing executable reports `available: false`; slow, failing, or unrecognized probes stay available with a diagnostic. An unexpected internal probe error is not caught here, so the host reports it as unavailable. Available results are shared for 30 seconds; an unavailable result is never remembered, so installing `omp` takes effect on the next host call. The request carries only an optional daemon `launch` and never `providerOptions`, so a per-agent `providerOptions.command` or `env` is invisible. **Breaking since 0.11:** the host gates create, resume, and draft commands/features on this status, so a missing default executable blocks them all, including agents configured with an otherwise valid custom command. Any request `launch` is ignored. |
|
|
114
114
|
| 0.11 provider `command` and daemon launch | **0%** | Deliberately not declared. Declaring `command` makes the daemon resolve it against its own `PATH` and reject every `connect` when the default binary is missing. The resulting `launch.env` is the daemon's entire process environment plus overrides, indistinguishable from configured values, so adopting it would defeat names-only `inheritEnv` and the fixed profile store environment. The host never supplies `launch` without a declared `command`; `connect` and `getCatalogCacheKey` do not read it, each pinned by `tests/provider-catalog.test.ts`. Revisit if the host stops gating on the default binary or exposes configured `env` separately from the daemon environment. |
|
|
115
|
-
| 0.11 screens and sidebar items | **100%** | The global config surface migrates to `addScreen({ id: "config" })`, preserving legacy links and encoding profile selection in screen params
|
|
115
|
+
| 0.11 screens and sidebar items | **100%** | The global config surface migrates to `addScreen({ id: "config" })`, preserving legacy links and encoding profile selection in screen params, with one `addSidebarHeaderItem` + `SidebarRow` that opens it. Hub processes appear only in the per-agent composer pill, which lists them and tails logs in a popover; there is no global Hub sidebar row. The legacy static config row and surface were removed with the 0.11 floor. |
|
|
116
116
|
| 0.11 usage source | **0%** | Not registered. `server/quota.ts` reads OMP's recorded `usage_history`, not live quota, so there is no live fetcher to register. Upstream Claude and Codex sources fetch live quota for the Anthropic and Codex OAuth credentials in the daemon's default or `OMP_PROFILE` store; other providers and named profiles remain covered only by this plugin's historical quota pill. |
|
|
117
117
|
|
|
118
118
|
Tracking rules:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PluginSidebarItemProps } from "@getpaseo/plugin/client";
|
|
2
|
+
import { SidebarRow } from "@getpaseo/plugin/client/ui";
|
|
3
|
+
import { OMP_ICON } from "./hub-icon";
|
|
4
|
+
import { CONFIG_SCREEN_ID } from "./sidebar-compat";
|
|
5
|
+
|
|
6
|
+
export function ConfigSidebarItem({ currentScreen, openScreen }: PluginSidebarItemProps) {
|
|
7
|
+
return (
|
|
8
|
+
<SidebarRow
|
|
9
|
+
icon={OMP_ICON}
|
|
10
|
+
label="OMP"
|
|
11
|
+
active={currentScreen?.screenId === CONFIG_SCREEN_ID}
|
|
12
|
+
onPress={() => openScreen({ screenId: CONFIG_SCREEN_ID })}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
package/client/sidebar-compat.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { HubProcess } from "../shared/hub";
|
|
2
1
|
import { isOmpProfileName, type OmpStore } from "../shared/omp-store";
|
|
3
|
-
import { hubProcessTone } from "./hub-status";
|
|
4
2
|
|
|
5
3
|
/** The config screen keeps the id of the retired 0.10 sidebar item so saved links work. */
|
|
6
4
|
export const CONFIG_SCREEN_ID = "config";
|
|
7
|
-
export const HUB_SIDEBAR_ITEM_ID = "hub";
|
|
8
5
|
|
|
9
6
|
type ScreenParams = Readonly<Record<string, string>>;
|
|
10
7
|
|
|
@@ -22,109 +19,3 @@ export function configScreenTitle(params: ScreenParams): string {
|
|
|
22
19
|
const store = configStoreFromParams(params);
|
|
23
20
|
return store?.profile ? `OMP · ${store.profile}` : "OMP";
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
export interface HubWorkspaceProcesses {
|
|
27
|
-
cwd: string;
|
|
28
|
-
processes: readonly HubProcess[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface HubSidebarSummary {
|
|
32
|
-
running: number;
|
|
33
|
-
failed: number;
|
|
34
|
-
total: number;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function summarizeHubWorkspaces(
|
|
38
|
-
workspaces: readonly HubWorkspaceProcesses[],
|
|
39
|
-
): HubSidebarSummary {
|
|
40
|
-
const summary: HubSidebarSummary = { running: 0, failed: 0, total: 0 };
|
|
41
|
-
for (const { processes } of workspaces) {
|
|
42
|
-
for (const process of processes) {
|
|
43
|
-
summary.total += 1;
|
|
44
|
-
const tone = hubProcessTone(process);
|
|
45
|
-
if (tone === "success") summary.running += 1;
|
|
46
|
-
else if (tone === "danger") summary.failed += 1;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return summary;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Distinct, non-empty workspace directories in first-seen order, bounded for polling cost. */
|
|
53
|
-
export function workspaceDirectories(
|
|
54
|
-
workspaces: ReadonlyArray<{ workspaceDirectory?: string; projectRootPath: string }>,
|
|
55
|
-
limit = 50,
|
|
56
|
-
): { directories: string[]; truncated: boolean } {
|
|
57
|
-
const directories = new Set<string>();
|
|
58
|
-
for (const workspace of workspaces) {
|
|
59
|
-
const directory = workspace.workspaceDirectory || workspace.projectRootPath;
|
|
60
|
-
if (!directory || directories.has(directory)) continue;
|
|
61
|
-
if (directories.size >= limit) return { directories: [...directories], truncated: true };
|
|
62
|
-
directories.add(directory);
|
|
63
|
-
}
|
|
64
|
-
return { directories: [...directories], truncated: false };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface HubSnapshot {
|
|
68
|
-
workspaces: HubWorkspaceProcesses[];
|
|
69
|
-
/** More workspaces exist than were polled; counts are a lower bound. */
|
|
70
|
-
truncated: boolean;
|
|
71
|
-
/** Workspaces whose hub state could not be read this poll. */
|
|
72
|
-
unreadable: number;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* One poll of hub state. A failing workspace never hides the others; the poll fails only when
|
|
77
|
-
* the workspace list itself fails or every workspace is unreadable.
|
|
78
|
-
*/
|
|
79
|
-
export async function loadHubSnapshot(
|
|
80
|
-
listWorkspaces: () => Promise<{
|
|
81
|
-
entries: ReadonlyArray<{ workspaceDirectory?: string; projectRootPath: string }>;
|
|
82
|
-
pageInfo?: { hasMore?: boolean };
|
|
83
|
-
}>,
|
|
84
|
-
listProcesses: (cwd: string) => Promise<readonly HubProcess[]>,
|
|
85
|
-
): Promise<HubSnapshot> {
|
|
86
|
-
const page = await listWorkspaces();
|
|
87
|
-
const { directories, truncated } = workspaceDirectories(page.entries);
|
|
88
|
-
const results = await Promise.allSettled(
|
|
89
|
-
directories.map(async (cwd) => ({ cwd, processes: await listProcesses(cwd) })),
|
|
90
|
-
);
|
|
91
|
-
const workspaces: HubWorkspaceProcesses[] = [];
|
|
92
|
-
for (const result of results) if (result.status === "fulfilled") workspaces.push(result.value);
|
|
93
|
-
if (directories.length > 0 && workspaces.length === 0) {
|
|
94
|
-
throw new Error("OMP hub state is unreadable");
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
workspaces,
|
|
98
|
-
truncated: truncated || page.pageInfo?.hasMore === true,
|
|
99
|
-
unreadable: directories.length - workspaces.length,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface HubTrailing {
|
|
104
|
-
running?: string;
|
|
105
|
-
failed?: string;
|
|
106
|
-
/** Some or all hub state could not be read. */
|
|
107
|
-
unreadable: boolean;
|
|
108
|
-
accessibilityLabel: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** What the Hub row's trailing slot shows; null when there is nothing to report. */
|
|
112
|
-
export function hubTrailing(
|
|
113
|
-
snapshot: HubSnapshot | undefined,
|
|
114
|
-
loadFailed: boolean,
|
|
115
|
-
): HubTrailing | null {
|
|
116
|
-
const summary = summarizeHubWorkspaces(snapshot?.workspaces ?? []);
|
|
117
|
-
const atLeast = snapshot?.truncated ? "+" : "";
|
|
118
|
-
const unreadable = loadFailed || (snapshot?.unreadable ?? 0) > 0;
|
|
119
|
-
if (summary.total === 0 && !unreadable) return null;
|
|
120
|
-
const running = summary.total > 0 ? `${summary.running}${atLeast} running` : undefined;
|
|
121
|
-
const failed = summary.failed > 0 ? `${summary.failed}${atLeast} failed` : undefined;
|
|
122
|
-
return {
|
|
123
|
-
...(running ? { running } : {}),
|
|
124
|
-
...(failed ? { failed } : {}),
|
|
125
|
-
unreadable,
|
|
126
|
-
accessibilityLabel: [running, failed, unreadable ? "some hub state unreadable" : undefined]
|
|
127
|
-
.filter(Boolean)
|
|
128
|
-
.join(", "),
|
|
129
|
-
};
|
|
130
|
-
}
|
package/index.client.tsx
CHANGED
|
@@ -4,9 +4,9 @@ import type {
|
|
|
4
4
|
PluginClientContext,
|
|
5
5
|
PluginSurfaceProps,
|
|
6
6
|
} from "@getpaseo/plugin/client";
|
|
7
|
+
import { ConfigSidebarItem } from "./client/config-sidebar";
|
|
7
8
|
import { OMP_ICON } from "./client/hub-icon";
|
|
8
9
|
import { HubPopover } from "./client/hub-popover";
|
|
9
|
-
import { ConfigSidebarItem, createHubSidebar } from "./client/hub-sidebar";
|
|
10
10
|
import { summarizeHubProcesses } from "./client/hub-status";
|
|
11
11
|
import { OmpMcpAuthorizationCard } from "./client/mcp-authorization";
|
|
12
12
|
import { McpPopover } from "./client/mcp-popover";
|
|
@@ -36,8 +36,6 @@ import {
|
|
|
36
36
|
configParamsFromStore,
|
|
37
37
|
configScreenTitle,
|
|
38
38
|
configStoreFromParams,
|
|
39
|
-
HUB_SIDEBAR_ITEM_ID,
|
|
40
|
-
loadHubSnapshot,
|
|
41
39
|
} from "./client/sidebar-compat";
|
|
42
40
|
import { OmpSubagentStrip } from "./client/subagents-strip";
|
|
43
41
|
import {
|
|
@@ -114,15 +112,9 @@ async function loadAgents(paseo: PaseoApi): Promise<AgentEntry[]> {
|
|
|
114
112
|
return entries;
|
|
115
113
|
}
|
|
116
114
|
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*/
|
|
121
|
-
export function registerConfigAndHub(
|
|
122
|
-
client: Pick<
|
|
123
|
-
PluginClientContext,
|
|
124
|
-
"addScreen" | "addSidebarHeaderItem" | "openScreen" | "rpc" | "paseo"
|
|
125
|
-
>,
|
|
115
|
+
/** A param-addressable `config` screen (same id as the old sidebar item, so saved links resolve to it) and a header row that opens it. */
|
|
116
|
+
export function registerConfig(
|
|
117
|
+
client: Pick<PluginClientContext, "addScreen" | "addSidebarHeaderItem" | "openScreen">,
|
|
126
118
|
onComposerPillSettingsChange: (settings: ComposerPillSettings) => void,
|
|
127
119
|
): () => void {
|
|
128
120
|
function ConfigScreen(props: PluginSurfaceProps & { params: Record<string, string> }) {
|
|
@@ -140,13 +132,6 @@ export function registerConfigAndHub(
|
|
|
140
132
|
/>
|
|
141
133
|
);
|
|
142
134
|
}
|
|
143
|
-
const { HubSidebarItem } = createHubSidebar(() =>
|
|
144
|
-
loadHubSnapshot(
|
|
145
|
-
() =>
|
|
146
|
-
client.paseo.workspaces.list({ filter: { includeBackground: true }, page: { limit: 200 } }),
|
|
147
|
-
async (cwd) => (await client.rpc(listHubProcesses, { cwd })).processes,
|
|
148
|
-
),
|
|
149
|
-
);
|
|
150
135
|
const removers = [
|
|
151
136
|
client.addScreen({ id: CONFIG_SCREEN_ID, title: configScreenTitle, Component: ConfigScreen }),
|
|
152
137
|
client.addSidebarHeaderItem({
|
|
@@ -154,11 +139,6 @@ export function registerConfigAndHub(
|
|
|
154
139
|
title: "OMP",
|
|
155
140
|
Component: ConfigSidebarItem,
|
|
156
141
|
}),
|
|
157
|
-
client.addSidebarHeaderItem({
|
|
158
|
-
id: HUB_SIDEBAR_ITEM_ID,
|
|
159
|
-
title: "OMP Hub",
|
|
160
|
-
Component: HubSidebarItem,
|
|
161
|
-
}),
|
|
162
142
|
];
|
|
163
143
|
return () => {
|
|
164
144
|
for (const remove of removers.reverse()) remove();
|
|
@@ -218,7 +198,7 @@ export default function contribute(client: PluginClientContext) {
|
|
|
218
198
|
openPanel("workspace", { location: "workspace" });
|
|
219
199
|
},
|
|
220
200
|
});
|
|
221
|
-
const removeConfigEntry =
|
|
201
|
+
const removeConfigEntry = registerConfig(client, applyComposerPillSettings);
|
|
222
202
|
const removeOpenConfig = client.addCommandCenterItem({
|
|
223
203
|
id: "open-config",
|
|
224
204
|
title: "Open OMP",
|
package/package.json
CHANGED
|
@@ -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.394.1"; // x-release-please-version
|
package/client/hub-sidebar.tsx
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { PluginPopoverProps, PluginSidebarItemProps } from "@getpaseo/plugin/client";
|
|
2
|
-
import { SidebarRow } from "@getpaseo/plugin/client/ui";
|
|
3
|
-
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
import { Text, View } from "react-native";
|
|
5
|
-
import { OMP_ICON } from "./hub-icon";
|
|
6
|
-
import { HubProcessList } from "./hub-popover";
|
|
7
|
-
import { CONFIG_SCREEN_ID, type HubSnapshot, hubTrailing } from "./sidebar-compat";
|
|
8
|
-
|
|
9
|
-
// The row is always mounted; a slower poll bounds per-client RPC fan-out across workspaces.
|
|
10
|
-
const HUB_POLL_MS = 15_000;
|
|
11
|
-
const HUB_SIDEBAR_QUERY_KEY = ["paseo-omp", "hub-sidebar"] as const;
|
|
12
|
-
|
|
13
|
-
export function ConfigSidebarItem({ currentScreen, openScreen }: PluginSidebarItemProps) {
|
|
14
|
-
return (
|
|
15
|
-
<SidebarRow
|
|
16
|
-
icon={OMP_ICON}
|
|
17
|
-
label="OMP"
|
|
18
|
-
active={currentScreen?.screenId === CONFIG_SCREEN_ID}
|
|
19
|
-
onPress={() => openScreen({ screenId: CONFIG_SCREEN_ID })}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function createHubSidebar(loadSnapshot: () => Promise<HubSnapshot>) {
|
|
25
|
-
const useHubSnapshot = () =>
|
|
26
|
-
useQuery({
|
|
27
|
-
queryKey: HUB_SIDEBAR_QUERY_KEY,
|
|
28
|
-
queryFn: loadSnapshot,
|
|
29
|
-
refetchInterval: HUB_POLL_MS,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
function HubSidebarPopover({ theme, layout }: PluginPopoverProps) {
|
|
33
|
-
const snapshot = useHubSnapshot();
|
|
34
|
-
const muted = { color: theme.colors.foregroundMuted, fontSize: 13 };
|
|
35
|
-
if (snapshot.isLoading) return <Text style={muted}>Loading hub processes…</Text>;
|
|
36
|
-
if (!snapshot.data) {
|
|
37
|
-
return (
|
|
38
|
-
<Text style={{ color: theme.colors.statusDanger, fontSize: 13 }}>
|
|
39
|
-
Could not read omp hub state.
|
|
40
|
-
</Text>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
const active = snapshot.data.workspaces.filter(({ processes }) => processes.length > 0);
|
|
44
|
-
const notes = [
|
|
45
|
-
snapshot.data.unreadable > 0
|
|
46
|
-
? `${snapshot.data.unreadable} workspace(s) could not be read.`
|
|
47
|
-
: undefined,
|
|
48
|
-
snapshot.data.truncated ? "Showing the first 50 workspaces." : undefined,
|
|
49
|
-
].filter(Boolean);
|
|
50
|
-
return (
|
|
51
|
-
<View style={{ gap: layout.compact ? 12 : 14 }}>
|
|
52
|
-
{notes.map((note) => (
|
|
53
|
-
<Text key={note} style={{ ...muted, fontSize: 12 }}>
|
|
54
|
-
{note}
|
|
55
|
-
</Text>
|
|
56
|
-
))}
|
|
57
|
-
{active.length === 0 ? <Text style={muted}>No hub-supervised processes.</Text> : null}
|
|
58
|
-
{active.map(({ cwd, processes }) => (
|
|
59
|
-
<View key={cwd} style={{ gap: 6 }}>
|
|
60
|
-
<Text numberOfLines={1} style={{ ...muted, fontSize: 12 }}>
|
|
61
|
-
{cwd}
|
|
62
|
-
</Text>
|
|
63
|
-
<HubProcessList theme={theme} layout={layout} cwd={cwd} processes={processes} />
|
|
64
|
-
</View>
|
|
65
|
-
))}
|
|
66
|
-
</View>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function HubSidebarItem({ theme, openPopover }: PluginSidebarItemProps) {
|
|
71
|
-
const snapshot = useHubSnapshot();
|
|
72
|
-
const state = hubTrailing(snapshot.data, snapshot.error !== null);
|
|
73
|
-
const trailing = state ? (
|
|
74
|
-
<View
|
|
75
|
-
accessibilityLabel={state.accessibilityLabel}
|
|
76
|
-
style={{ flexDirection: "row", alignItems: "center", gap: 6 }}
|
|
77
|
-
>
|
|
78
|
-
{state.running ? (
|
|
79
|
-
<Text style={{ color: theme.colors.foregroundMuted, fontSize: 12 }}>{state.running}</Text>
|
|
80
|
-
) : null}
|
|
81
|
-
{state.failed || state.unreadable ? (
|
|
82
|
-
<Text style={{ color: theme.colors.statusDanger, fontSize: 12, fontWeight: "600" }}>
|
|
83
|
-
{[state.failed, state.unreadable ? "!" : undefined].filter(Boolean).join(" ")}
|
|
84
|
-
</Text>
|
|
85
|
-
) : null}
|
|
86
|
-
</View>
|
|
87
|
-
) : undefined;
|
|
88
|
-
return (
|
|
89
|
-
<SidebarRow
|
|
90
|
-
icon="Activity"
|
|
91
|
-
label="OMP Hub"
|
|
92
|
-
trailing={trailing}
|
|
93
|
-
onPress={() => openPopover(HubSidebarPopover)}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return { HubSidebarItem, HubSidebarPopover };
|
|
99
|
-
}
|