@omercnet/paseo-omp 5.7.0-next.525.1 → 5.7.0-next.526.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/quota-popover.tsx +31 -3
- package/client/quota-state.ts +9 -0
- package/index.client.tsx +47 -5
- package/index.server.ts +5 -1
- package/package.json +1 -1
- package/server/package-version.ts +1 -1
- package/server/provider/session.ts +9 -0
- package/server/subagents.ts +11 -0
- package/shared/quota.ts +10 -0
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Open the **OMP** sidebar to review the provider-profile contract, choose which c
|
|
|
35
35
|
|
|
36
36
|
Open the **Accounts** tab of the **OMP** sidebar to see the logins in OMP's own credential store with their usage and banked resets, add a login through OMP's own sign-in, sign one out, spend a banked reset, and steer OMP's balancing: prefer a login, keep part of its quota in reserve, and set what OMP does at a limit. Each login shows plan and organization badges from its usage report, such as **Business**, **Pro Lite**, **Personal** or an organization name, and the label drops OMP's parenthesized organization once a badge shows it. Steering is written to OMP's own config. See [OMP accounts](docs/configuration.md#omp-accounts).
|
|
37
37
|
|
|
38
|
-
The quota popover groups recorded limits by provider and OMP account, showing an available recorded email or, when absent, the Copilot account ID (GitHub username) across that account's windows. Duplicate and unnamed accounts receive numbers in opaque account-key order, so changing usage does not swap their numbers; accounts are still displayed by highest usage. Duplicate-name suffixes stay visible when long emails truncate, and a lone unnamed account needs no heading. Copilot accounts also show **GitHub** or **GHE · host**, using the enterprise URL in OMP's recorded account key; unrecognized keys show neither. Badges beside each account name show the plan (such as **Business** or **Pro Lite**) and organization name from OMP's cached usage report for that account; an Anthropic organization named after the account's email shows as **Personal**, and accounts without a cached plan or organization show no badge. Only a server-side SHA-256 hash of the account key reaches the client. **CURRENT PROVIDER** identifies the session's provider, not its active account. Provider summary percentages show the highest recorded usage across that provider's accounts. Reset countdowns a day or more away show days and hours, such as **resets 14d 21h**.
|
|
38
|
+
The quota popover groups recorded limits by provider and OMP account, showing an available recorded email or, when absent, the Copilot account ID (GitHub username) across that account's windows. Duplicate and unnamed accounts receive numbers in opaque account-key order, so changing usage does not swap their numbers; accounts are still displayed by highest usage. Duplicate-name suffixes stay visible when long emails truncate, and a lone unnamed account needs no heading. Copilot accounts also show **GitHub** or **GHE · host**, using the enterprise URL in OMP's recorded account key; unrecognized keys show neither. Badges beside each account name show the plan (such as **Business** or **Pro Lite**) and organization name from OMP's cached usage report for that account; an Anthropic organization named after the account's email shows as **Personal**, and accounts without a cached plan or organization show no badge. Only a server-side SHA-256 hash of the account key reaches the client. **CURRENT PROVIDER** identifies the session's provider, not its active account. Paseo sees an OMP Plugin agent's model only as an opaque id, so the pill and popover ask the agent's live OMP session which provider that model belongs to; a closed OMP Plugin agent shows every provider until its session runs again. Provider summary percentages show the highest recorded usage across that provider's accounts. Reset countdowns a day or more away show days and hours, such as **resets 14d 21h**.
|
|
39
39
|
|
|
40
40
|
Open the **MCPs** tab of the **OMP** sidebar to list the MCP servers OMP connects to, add one by URL or command, test, enable, disable or remove it, and sign a remote server in through your browser, like **Accounts** does for logins. See [OMP MCP servers](docs/configuration.md#omp-mcp-servers).
|
|
41
41
|
|
package/client/quota-popover.tsx
CHANGED
|
@@ -4,9 +4,10 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { Text, View } from "react-native";
|
|
6
6
|
import { storeForProvider, storeLabel } from "../shared/omp-store";
|
|
7
|
-
import { listOmpQuotas } from "../shared/quota";
|
|
7
|
+
import { getOmpSessionModelProvider, listOmpQuotas } from "../shared/quota";
|
|
8
8
|
import { ompStoreKey } from "./omp-store-state";
|
|
9
9
|
import {
|
|
10
|
+
needsSessionModelProvider,
|
|
10
11
|
type QuotaProviderGroup,
|
|
11
12
|
quotaDetailLabel,
|
|
12
13
|
quotaProviderFromSession,
|
|
@@ -21,8 +22,35 @@ const QUOTA_POLL_MS = 30_000;
|
|
|
21
22
|
export function QuotaPopover(props: PluginButtonContentProps) {
|
|
22
23
|
const { theme, layout } = props;
|
|
23
24
|
const agentId = props.context === "agent" ? props.agentId : "";
|
|
24
|
-
const session = useAgent(agentId, (agent) => ({
|
|
25
|
-
|
|
25
|
+
const session = useAgent(agentId, (agent) => ({
|
|
26
|
+
model: agent.model,
|
|
27
|
+
provider: agent.provider,
|
|
28
|
+
status: agent.status,
|
|
29
|
+
}));
|
|
30
|
+
const loadSessionModelProvider = useRpc(getOmpSessionModelProvider);
|
|
31
|
+
const sessionModelProvider = useQuery({
|
|
32
|
+
// The answer comes from the live session, so a closed or resumed session asks again.
|
|
33
|
+
queryKey: [
|
|
34
|
+
"paseo-omp",
|
|
35
|
+
"session-model-provider",
|
|
36
|
+
agentId,
|
|
37
|
+
session?.model ?? null,
|
|
38
|
+
session?.status ?? null,
|
|
39
|
+
],
|
|
40
|
+
queryFn: () => loadSessionModelProvider({ agentId }),
|
|
41
|
+
// A closed agent has no live session to ask, as in the pill.
|
|
42
|
+
enabled: Boolean(
|
|
43
|
+
agentId &&
|
|
44
|
+
session &&
|
|
45
|
+
session.status !== "closed" &&
|
|
46
|
+
needsSessionModelProvider(session.provider, session.model),
|
|
47
|
+
),
|
|
48
|
+
retry: false,
|
|
49
|
+
});
|
|
50
|
+
const currentProvider =
|
|
51
|
+
quotaProviderFromSession(session?.provider ?? "", session?.model ?? null) ??
|
|
52
|
+
sessionModelProvider.data?.provider ??
|
|
53
|
+
null;
|
|
26
54
|
const store = storeForProvider(session?.provider);
|
|
27
55
|
const loadQuotas = useRpc(listOmpQuotas);
|
|
28
56
|
const quotas = useQuery({
|
package/client/quota-state.ts
CHANGED
|
@@ -44,6 +44,15 @@ export function quotaProviderFromSession(
|
|
|
44
44
|
return model?.includes("/") ? model.split("/")[0] : null;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/** An OMP Plugin agent's model reaches Paseo as an opaque id; its live session names the provider. */
|
|
48
|
+
export function needsSessionModelProvider(provider: string, model: string | null): boolean {
|
|
49
|
+
return (
|
|
50
|
+
isOmpProvider(provider.split("/")[0]) &&
|
|
51
|
+
Boolean(model) &&
|
|
52
|
+
quotaProviderFromSession(provider, model) === null
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
export function quotaProviderLabel(provider: string | null): string {
|
|
48
57
|
return provider
|
|
49
58
|
? (PROVIDER_LABELS[provider] ?? `${provider.slice(0, 1).toUpperCase()}${provider.slice(1)}`)
|
package/index.client.tsx
CHANGED
|
@@ -28,6 +28,7 @@ import { quotaProviderIcon } from "./client/provider-icon";
|
|
|
28
28
|
import { OmpImageTimeline } from "./client/provider-image";
|
|
29
29
|
import { QuotaPopover } from "./client/quota-popover";
|
|
30
30
|
import {
|
|
31
|
+
needsSessionModelProvider,
|
|
31
32
|
type QuotaSeverity,
|
|
32
33
|
quotaProviderFromSession,
|
|
33
34
|
quotaSeverityForProvider,
|
|
@@ -61,7 +62,7 @@ import {
|
|
|
61
62
|
import { OMP_MCP_AUTH_TIMELINE_KIND, ompMcpAuthorizationTimelineSchema } from "./shared/mcp";
|
|
62
63
|
import { type OmpStore, storeForProvider } from "./shared/omp-store";
|
|
63
64
|
import { ompImageTimelineSchema, transformOmpImageToolItem } from "./shared/provider-image";
|
|
64
|
-
import { listOmpQuotas } from "./shared/quota";
|
|
65
|
+
import { getOmpSessionModelProvider, listOmpQuotas } from "./shared/quota";
|
|
65
66
|
import { OMP_RULE_NOTICE_KIND, ompRuleNoticeSchema } from "./shared/rule-notices";
|
|
66
67
|
import { OMP_SUBAGENT_STRIP_KIND, ompSubagentStripSchema } from "./shared/subagents";
|
|
67
68
|
|
|
@@ -71,6 +72,7 @@ const STATUS_POLL_MS = 4_000;
|
|
|
71
72
|
const QUOTA_POLL_MS = 30_000;
|
|
72
73
|
const RECONCILE_DEBOUNCE_MS = 250;
|
|
73
74
|
const SETTINGS_POLL_MS = 15_000;
|
|
75
|
+
const SESSION_PROVIDER_RETRY_MS = 60_000;
|
|
74
76
|
const composerPillSettingsRpc = settingsRpc(composerPillSettings.id);
|
|
75
77
|
|
|
76
78
|
type AgentEntry = PaseoAgentListResult["entries"][number];
|
|
@@ -382,15 +384,52 @@ export default function contribute(client: PluginClientContext) {
|
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
386
|
|
|
387
|
+
// Agent id to its session's provider, asked again only when the agent's model or status changes.
|
|
388
|
+
// A failed lookup is kept too, but only until `retryAt`, so a server without the RPC is not asked
|
|
389
|
+
// on every reconcile and a transient failure still recovers.
|
|
390
|
+
const sessionModelProviders = new Map<
|
|
391
|
+
string,
|
|
392
|
+
{ key: string; provider: string | null; retryAt?: number }
|
|
393
|
+
>();
|
|
394
|
+
|
|
395
|
+
async function sessionModelProvider(agent: AgentEntry["agent"]): Promise<string | null> {
|
|
396
|
+
if (agent.status === "closed" || !needsSessionModelProvider(agent.provider, agent.model)) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
const key = `${agent.model}|${agent.status}`;
|
|
400
|
+
const cached = sessionModelProviders.get(agent.id);
|
|
401
|
+
if (cached?.key === key && (cached.retryAt === undefined || Date.now() < cached.retryAt)) {
|
|
402
|
+
return cached.provider;
|
|
403
|
+
}
|
|
404
|
+
try {
|
|
405
|
+
const { provider } = await client.rpc(getOmpSessionModelProvider, { agentId: agent.id });
|
|
406
|
+
sessionModelProviders.set(agent.id, { key, provider });
|
|
407
|
+
return provider;
|
|
408
|
+
} catch {
|
|
409
|
+
sessionModelProviders.set(agent.id, {
|
|
410
|
+
key,
|
|
411
|
+
provider: null,
|
|
412
|
+
retryAt: Date.now() + SESSION_PROVIDER_RETRY_MS,
|
|
413
|
+
});
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
385
418
|
async function reconcileOnce(): Promise<void> {
|
|
386
419
|
if (!preferences) return;
|
|
387
|
-
const
|
|
420
|
+
const listed = (await loadAgents(client.paseo)).filter(
|
|
421
|
+
({ agent }) => !agent.archivedAt && agent.workspaceId && agent.cwd,
|
|
422
|
+
);
|
|
423
|
+
const sessionProviders = await Promise.all(
|
|
424
|
+
listed.map(({ agent }) => sessionModelProvider(agent)),
|
|
425
|
+
);
|
|
388
426
|
if (disposed || !preferences) return;
|
|
389
427
|
const activeIds = new Set<string>();
|
|
390
|
-
for (const { agent } of
|
|
391
|
-
if (
|
|
428
|
+
for (const [index, { agent }] of listed.entries()) {
|
|
429
|
+
if (!agent.workspaceId || !agent.cwd) continue;
|
|
392
430
|
activeIds.add(agent.id);
|
|
393
|
-
const quotaProvider =
|
|
431
|
+
const quotaProvider =
|
|
432
|
+
quotaProviderFromSession(agent.provider, agent.model) ?? sessionProviders[index];
|
|
394
433
|
const store = storeForProvider(agent.provider);
|
|
395
434
|
let entry = pills.get(agent.id);
|
|
396
435
|
if (
|
|
@@ -419,6 +458,9 @@ export default function contribute(client: PluginClientContext) {
|
|
|
419
458
|
removePills(entry);
|
|
420
459
|
pills.delete(agentId);
|
|
421
460
|
}
|
|
461
|
+
for (const agentId of sessionModelProviders.keys()) {
|
|
462
|
+
if (!activeIds.has(agentId)) sessionModelProviders.delete(agentId);
|
|
463
|
+
}
|
|
422
464
|
await Promise.all([refreshHubStatus(), refreshQuotaStatus()]);
|
|
423
465
|
}
|
|
424
466
|
|
package/index.server.ts
CHANGED
|
@@ -57,6 +57,7 @@ import { ompRuleNoticeRow } from "./server/rule-notices";
|
|
|
57
57
|
import {
|
|
58
58
|
OmpSubagentControlRegistry,
|
|
59
59
|
resolveCancelOmpSubagent,
|
|
60
|
+
resolveGetOmpSessionModelProvider,
|
|
60
61
|
resolveSteerOmpSubagent,
|
|
61
62
|
} from "./server/subagents";
|
|
62
63
|
import { resolveGetOmpSupportReport } from "./server/support-diagnostics";
|
|
@@ -116,7 +117,7 @@ import { getOmpUpdateStatus, installOmpUpdate } from "./shared/omp-update";
|
|
|
116
117
|
import { getOmpProviderHealth } from "./shared/provider-diagnostics";
|
|
117
118
|
import { getOmpImage } from "./shared/provider-image";
|
|
118
119
|
import { providerLaunchSettings } from "./shared/provider-launch-settings";
|
|
119
|
-
import { listOmpQuotas } from "./shared/quota";
|
|
120
|
+
import { getOmpSessionModelProvider, listOmpQuotas } from "./shared/quota";
|
|
120
121
|
import { cancelOmpSubagent, steerOmpSubagent } from "./shared/subagents";
|
|
121
122
|
import { getOmpSupportReport } from "./shared/support-diagnostics";
|
|
122
123
|
|
|
@@ -283,6 +284,9 @@ export default function contribute(server: PluginServerContext) {
|
|
|
283
284
|
server.handle(steerOmpSubagent, (input) =>
|
|
284
285
|
resolveSteerOmpSubagent(input, subagentControlRegistry),
|
|
285
286
|
);
|
|
287
|
+
server.handle(getOmpSessionModelProvider, (input) =>
|
|
288
|
+
resolveGetOmpSessionModelProvider(input, subagentControlRegistry),
|
|
289
|
+
);
|
|
286
290
|
const removeTurnRows = registerOmpTurnRows(server, [ompRuleNoticeRow, ompScreenshotRow]);
|
|
287
291
|
const removeSessionOpenHook = server.before("agent.session_open", ({ request }) => {
|
|
288
292
|
if (request.provider !== "omp-plugin" && !request.provider.startsWith("omp-plugin-")) return;
|
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.7.0-next.
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "5.7.0-next.526.1"; // x-release-please-version
|
|
@@ -482,6 +482,15 @@ export class OmpProviderSession implements OmpOpenedSession, OmpSubagentControls
|
|
|
482
482
|
await target.runtime.steerSubagent(target.nativeId, message);
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
+
/** Paseo publishes the model as an opaque id; only the session can map it back to OMP's model. */
|
|
486
|
+
modelProvider(): string | null {
|
|
487
|
+
if (this.closed || this.runtimeDead) return null;
|
|
488
|
+
const model = this.configState.model
|
|
489
|
+
? this.nativeModelsByPublicId.get(this.configState.model)
|
|
490
|
+
: undefined;
|
|
491
|
+
return model?.provider ?? null;
|
|
492
|
+
}
|
|
493
|
+
|
|
485
494
|
/**
|
|
486
495
|
* The native ID and runtime of a subagent this session's current runtime lists as running, or
|
|
487
496
|
* `null`. OMP repeats the check; this scopes the request to this session and answers exactly.
|
package/server/subagents.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
|
|
2
|
+
import type { getOmpSessionModelProvider } from "../shared/quota";
|
|
2
3
|
import type { cancelOmpSubagent, steerOmpSubagent } from "../shared/subagents";
|
|
3
4
|
import { OmpRpcRequestRejectedError } from "./provider/omp-rpc-transport";
|
|
4
5
|
import { isOmpPublicError, OmpPublicError } from "./provider/security";
|
|
@@ -8,6 +9,8 @@ export interface OmpSubagentControls {
|
|
|
8
9
|
/** Resolves `false` when the subagent is no longer running. */
|
|
9
10
|
cancelSubagent(handle: string): Promise<boolean>;
|
|
10
11
|
steerSubagent(handle: string, message: string): Promise<void>;
|
|
12
|
+
/** The OMP provider of the session's current model, or null once the session has ended. */
|
|
13
|
+
modelProvider(): string | null;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export class OmpSubagentNotRunningError extends OmpPublicError {
|
|
@@ -95,3 +98,11 @@ export async function resolveSteerOmpSubagent(
|
|
|
95
98
|
await withPublicFailure("steer", () => controls.steerSubagent(input.subagentId, input.message));
|
|
96
99
|
return { accepted: true };
|
|
97
100
|
}
|
|
101
|
+
|
|
102
|
+
/** No live session (closed, history-only or another daemon's) answers null rather than failing. */
|
|
103
|
+
export function resolveGetOmpSessionModelProvider(
|
|
104
|
+
input: RpcInput<typeof getOmpSessionModelProvider>,
|
|
105
|
+
registry: OmpSubagentControlRegistry,
|
|
106
|
+
): RpcOutput<typeof getOmpSessionModelProvider> {
|
|
107
|
+
return { provider: registry.get(input.agentId)?.modelProvider() ?? null };
|
|
108
|
+
}
|
package/shared/quota.ts
CHANGED
|
@@ -34,3 +34,13 @@ export const listOmpQuotas = defineRpc({
|
|
|
34
34
|
input: z.object({ store: OmpStoreSchema.optional() }),
|
|
35
35
|
output: z.object({ quotas: z.array(OmpQuotaSchema) }),
|
|
36
36
|
});
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The OMP provider (such as `anthropic`) of the model an OMP Plugin agent's live session uses.
|
|
40
|
+
* Paseo only sees that model as an opaque id, so the provider is null without a live session.
|
|
41
|
+
*/
|
|
42
|
+
export const getOmpSessionModelProvider = defineRpc({
|
|
43
|
+
name: "paseo-omp.session-model-provider",
|
|
44
|
+
input: z.object({ agentId: z.string().min(1).max(256) }),
|
|
45
|
+
output: z.object({ provider: z.string().nullable() }),
|
|
46
|
+
});
|