@omercnet/paseo-omp 5.5.0 → 5.6.0-next.435.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
@@ -1,6 +1,6 @@
1
1
  # Paseo OMP plugin
2
2
 
3
- Community OMP integration for Paseo. The plugin registers the distinct `omp-plugin` provider plus named profile providers and coexists with Paseo's bundled `omp` provider.
3
+ Community OMP integration for Paseo. The plugin's own `omp-plugin` provider plus named profile providers are off by default for new installs while they are retired in favor of Paseo's bundled `omp` provider; the plugin's configuration tabs and timeline cards also work on the bundled `omp` provider. See [Plugin provider opt-in](#plugin-provider-opt-in).
4
4
 
5
5
  > **Stable:** see [Support](SUPPORT.md) for supported versions and known limitations, and review release notes for any migration requirements before upgrading.
6
6
 
@@ -31,7 +31,7 @@ paseo plugin install npm:@omercnet/paseo-omp@<version>
31
31
  paseo plugin ls paseo-omp
32
32
  ```
33
33
 
34
- Open the **OMP** sidebar to review the provider-profile contract, choose which composer pills appear, browse and edit native scalar settings, manage OMP-native plugins, verify runtime health, and generate a bounded support report under **Help**. The same tabs are available in the workspace OMP panel, except for the global Composer preference and the Accounts and MCPs tabs. Then create an agent and select **OMP Plugin**. Its optional **MCP** composer control runs OMP-native management commands in the current session; setup questions and authorization stay in that chat timeline, where OAuth can open in a workspace-scoped Paseo Browser or on the current device. While OMP subagents run, a row under each `task` card in the conversation lets you steer or stop one of them; this needs OMP 18.4.9 or newer. Composer pill preferences are shared by clients connected to the same host; normal use requires no other plugin-specific settings.
34
+ Open the **OMP** sidebar to review the provider-profile contract, choose which composer pills appear, browse and edit native scalar settings, manage OMP-native plugins, verify runtime health, and generate a bounded support report under **Help**. The same tabs are available in the workspace OMP panel, except for the global Composer preference and the Accounts and MCPs tabs. Then create an agent and select **OMP Plugin**; on a new install, [enable it](#plugin-provider-opt-in) and restart the daemon first. Its optional **MCP** composer control runs OMP-native management commands in the current session; setup questions and authorization stay in that chat timeline, where OAuth can open in a workspace-scoped Paseo Browser or on the current device. While OMP subagents run, a row under each `task` card in the conversation lets you steer or stop one of them; this needs OMP 18.4.9 or newer. Composer pill preferences are shared by clients connected to the same host; normal use requires no other plugin-specific settings.
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. Steering is written to OMP's own config. See [OMP accounts](docs/configuration.md#omp-accounts).
37
37
 
@@ -47,6 +47,18 @@ Open the **MCPs** tab of the **OMP** sidebar to list the MCP servers OMP connect
47
47
 
48
48
  The plugin uses public Paseo 0.14 provider and client contracts and registers distinct `omp-plugin` and `omp-plugin-<profile>` identities; it does not modify the bundled `omp` provider.
49
49
 
50
+ ## Plugin provider opt-in
51
+
52
+ On a new install, `omp-plugin` and `omp-plugin-<profile>` are not offered. To turn them on, add the provider to the Paseo config and restart the daemon:
53
+
54
+ ```json
55
+ { "agents": { "providers": { "omp-plugin": { "enabled": true } } } }
56
+ ```
57
+
58
+ An entry for any plugin provider registers all of them, as before. Disabling is per provider: `enabled: false` on `omp-plugin` turns off only `omp-plugin`, so give each `omp-plugin-<profile>` you do not want its own `enabled: false` entry. Paseo versions whose provider grid lists opt-in plugin providers also offer **Add** there.
59
+
60
+ Hosts that already use the plugin provider are not affected and need no step. The first start after upgrading looks for agents or schedules on `omp-plugin*` and, if it finds one, records that in `<PASEO_HOME>/plugin-data/paseo-omp/provider-opt-in.json`. Config entries that name or extend an `omp-plugin*` provider (including agent profiles and metadata generation providers) are read on every start. If the Paseo home cannot be read or parsed, the providers stay on. Deleting old agents later does not turn them off; disable each provider you no longer want with its own `agents.providers.<id>.enabled: false` entry. If that file cannot be written (for example a read-only Paseo home), the providers stay on for that start but nothing is latched; check that the file exists, or add an `agents.providers.omp-plugin` entry, before deleting the last such agent or schedule.
61
+
50
62
  ## Named OMP profiles
51
63
 
52
64
  At startup the plugin discovers directory names under `~/.omp/profiles/` (or `PI_CONFIG_DIR`) and registers **OMP · <profile>** for each valid lowercase name. Select that provider when creating a profile-backed agent. Discovery, launch, recovery and persisted session listing share its fixed profile and session root. Matching command wrappers, including Doppler, remain supported; conflicting profile or session-directory overrides fail before launch. Plain `env NAME=value omp` wrappers are supported, but environment-control flags such as `env -i` and `env -u` are rejected because they can discard the selected store. Profile-specific XDG roots cannot be overridden by per-launch environment values. Reload the plugin after adding a profile.
@@ -135,7 +147,7 @@ Paseo 0.14 is the minimum supported release. The controlled Docker canary is pin
135
147
 
136
148
  Paseo releases idle resumable agent runtimes after one hour; the agent stays listed as `closed` and the next prompt resumes the same OMP session. The plugin vetoes that release while the session has a running turn, a pending permission, an active subagent, or OMP background async work, and while OMP does not report a settled state (the plugin needs the `hasPendingAsyncWork` and `isSettled` fields in OMP's `get_state`; builds without them are never released). Set `agents.idleRuntimeCleanup: false` in the Paseo config to disable idle release for every provider.
137
149
 
138
- Install, update, disable, or remove `paseo-omp` independently of the bundled provider. Verify the provider snapshot contains `omp-plugin` after installation; a bundled `omp` entry may remain present and is not modified by this plugin.
150
+ Install, update, disable, or remove `paseo-omp` independently of the bundled provider. On a new install the snapshot lists only the bundled `omp` provider until you enable `omp-plugin` as described in [Plugin provider opt-in](#plugin-provider-opt-in); a bundled `omp` entry is never modified by this plugin.
139
151
 
140
152
  ## Output and credential boundary
141
153
 
@@ -169,7 +169,7 @@ function DocumentationLink({
169
169
 
170
170
  function ProviderSetupSection({ styles }: { styles: OmpConfigStyles }) {
171
171
  return (
172
- <SectionCard styles={styles} title="OMP Plugin">
172
+ <SectionCard styles={styles} title="Provider">
173
173
  <Text style={styles.muted}>
174
174
  Host-wide inherited environment names apply to every OMP provider. Profile launch overrides
175
175
  remain available for narrower exceptions.
package/index.server.ts CHANGED
@@ -42,6 +42,7 @@ import { withOmpStore } from "./server/paths";
42
42
  import { OmpProtocolViolationCollector } from "./server/protocol-violation-diagnostics";
43
43
  import { withOmpSessionOpenEnv } from "./server/provider/host-tools";
44
44
  import { ompImageCache, resolveGetOmpImage } from "./server/provider/image-cache";
45
+ import { pluginProvidersRequireConfiguration } from "./server/provider/opt-in";
45
46
  import {
46
47
  createProfileOmpProvider,
47
48
  discoverOmpProfiles,
@@ -143,10 +144,11 @@ export default function contribute(server: PluginServerContext) {
143
144
  const accounts = new OmpAccounts();
144
145
  const mcps = new OmpMcps();
145
146
  const profiles = discoverOmpProfilesSync();
147
+ const requiresConfiguration = pluginProvidersRequireConfiguration();
146
148
  server.handle(listOmpStores, async () => ({ profiles: await discoverOmpProfiles() }));
147
149
  for (const profile of profiles) {
148
- server.registerProvider(
149
- createProfileOmpProvider(profile, {
150
+ server.registerProvider({
151
+ ...createProfileOmpProvider(profile, {
150
152
  browserAuthorizationRegistry,
151
153
  sessionLimit,
152
154
  subagentControlRegistry,
@@ -154,7 +156,8 @@ export default function contribute(server: PluginServerContext) {
154
156
  reportOperationalFailure: operationalFailures.report,
155
157
  resolveHostInheritEnv,
156
158
  }),
157
- );
159
+ requiresConfiguration,
160
+ });
158
161
  }
159
162
  server.handle(listHubProcesses, resolveListHubProcesses);
160
163
  server.handle(tailHubLog, resolveTailHubLog);
@@ -285,8 +288,8 @@ export default function contribute(server: PluginServerContext) {
285
288
  if (request.provider !== "omp-plugin" && !request.provider.startsWith("omp-plugin-")) return;
286
289
  return withOmpSessionOpenEnv(request);
287
290
  });
288
- server.registerProvider(
289
- createOmpProvider({
291
+ server.registerProvider({
292
+ ...createOmpProvider({
290
293
  browserAuthorizationRegistry,
291
294
  sessionLimit,
292
295
  subagentControlRegistry,
@@ -294,7 +297,8 @@ export default function contribute(server: PluginServerContext) {
294
297
  reportOperationalFailure: operationalFailures.report,
295
298
  resolveHostInheritEnv,
296
299
  }),
297
- );
300
+ requiresConfiguration,
301
+ });
298
302
  return () => {
299
303
  browserAuthorizationRegistry.clear();
300
304
  accounts.stop();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-omp",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@omercnet/paseo-omp",
9
- "version": "5.5.0",
9
+ "version": "5.6.0",
10
10
  "dependencies": {
11
11
  "@getpaseo/protocol": "0.15.0",
12
12
  "@modelcontextprotocol/sdk": "1.32.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-omp",
3
- "version": "5.5.0",
3
+ "version": "5.6.0-next.435.1",
4
4
  "type": "module",
5
5
  "description": "Paseo integration for OMP, including its direct provider and workspace tooling.",
6
6
  "license": "MIT",
@@ -71,9 +71,9 @@
71
71
  "@types/react": "^19.2.18",
72
72
  "@vitest/coverage-v8": "^5.0.0",
73
73
  "esbuild": "0.28.2",
74
+ "pino": "10.4.0",
74
75
  "react": "19.1.0",
75
76
  "react-native": "0.81.5",
76
- "pino": "10.4.0",
77
77
  "tsx": "^4.20.6",
78
78
  "typescript": "^7.0.2",
79
79
  "vitest": "^5.0.0",
@@ -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.5.0"; // x-release-please-version
2
+ export const PASEO_OMP_PACKAGE_VERSION = "5.6.0-next.435.1"; // x-release-please-version
@@ -16,11 +16,11 @@ import {
16
16
  utimesSync,
17
17
  writeFileSync,
18
18
  } from "node:fs";
19
- import { homedir } from "node:os";
20
- import { join, resolve } from "node:path";
19
+ import { join } from "node:path";
21
20
  import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
22
21
  import type { getOmpImage } from "../../shared/provider-image";
23
22
  import type { OmpImageMimeType } from "./image";
23
+ import { paseoHomeDir } from "./opt-in";
24
24
 
25
25
  /** Matches the projector's 8 MiB encoded image bound. */
26
26
  export const MAX_CACHED_IMAGE_BYTES = 6 * 1024 * 1024;
@@ -76,9 +76,7 @@ function isPrivateDirectory(stat: Stats): boolean {
76
76
 
77
77
  /** Paseo resolves its home the same way, so an isolated daemon keeps images in its own home. */
78
78
  export function ompImageCacheDir(environment: NodeJS.ProcessEnv = process.env): string {
79
- const raw = environment.PASEO_HOME ?? "~/.paseo";
80
- const home = raw === "~" || raw.startsWith("~/") ? join(homedir(), raw.slice(1)) : raw;
81
- return join(resolve(home), "plugin-data", "paseo-omp", "images");
79
+ return join(paseoHomeDir(environment), "plugin-data", "paseo-omp", "images");
82
80
  }
83
81
 
84
82
  export function ompImageRef(bytes: Uint8Array): string {
@@ -0,0 +1,166 @@
1
+ import {
2
+ closeSync,
3
+ constants,
4
+ fstatSync,
5
+ mkdirSync,
6
+ openSync,
7
+ readdirSync,
8
+ readFileSync,
9
+ writeFileSync,
10
+ } from "node:fs";
11
+ import { homedir } from "node:os";
12
+ import { join, resolve } from "node:path";
13
+ import { z } from "zod";
14
+
15
+ const MARKER_FILE = "provider-opt-in.json";
16
+ const MAX_EVIDENCE_FILES = 10_000;
17
+ const MAX_EVIDENCE_BYTES = 1024 * 1024;
18
+
19
+ const MarkerSchema = z.object({ version: z.literal(1), legacyUse: z.literal(true) });
20
+ const ProviderEntrySchema = z.object({ extends: z.string().optional() });
21
+ const ConfigSchema = z.object({
22
+ agents: z
23
+ .object({
24
+ providers: z.record(z.string(), ProviderEntrySchema).optional(),
25
+ metadataGeneration: z
26
+ .object({ providers: z.array(z.object({ provider: z.string() })).optional() })
27
+ .optional(),
28
+ })
29
+ .optional(),
30
+ daemon: z
31
+ .object({ agentProfiles: z.array(z.object({ provider: z.string() })).optional() })
32
+ .optional(),
33
+ });
34
+ const AgentRecordSchema = z.object({ provider: z.string() });
35
+ const ScheduleSchema = z.object({
36
+ target: z.object({ config: z.object({ provider: z.string() }).optional() }),
37
+ });
38
+
39
+ /** Paseo resolves its home the same way, so an isolated daemon keeps plugin data in its own home. */
40
+ export function paseoHomeDir(environment: NodeJS.ProcessEnv = process.env): string {
41
+ const raw = environment.PASEO_HOME ?? "~/.paseo";
42
+ const home = raw === "~" || raw.startsWith("~/") ? join(homedir(), raw.slice(1)) : raw;
43
+ return resolve(home);
44
+ }
45
+
46
+ function isPluginProviderId(provider: string | undefined): boolean {
47
+ return provider === "omp-plugin" || provider?.startsWith("omp-plugin-") === true;
48
+ }
49
+
50
+ function isMissing(error: unknown): boolean {
51
+ return (error as NodeJS.ErrnoException).code === "ENOENT";
52
+ }
53
+
54
+ /**
55
+ * Parsed JSON, or undefined when the file does not exist. Anything else that is not a small
56
+ * regular file (a symlink, a FIFO that would block startup) throws, which keeps providers on.
57
+ */
58
+ function readJson(path: string): unknown {
59
+ const flags = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);
60
+ let descriptor: number;
61
+ try {
62
+ descriptor = openSync(path, flags);
63
+ } catch (error) {
64
+ if (isMissing(error)) return undefined;
65
+ throw error;
66
+ }
67
+ try {
68
+ const stat = fstatSync(descriptor);
69
+ if (!stat.isFile() || stat.size > MAX_EVIDENCE_BYTES) {
70
+ throw new Error(`${path} cannot be inspected`);
71
+ }
72
+ return JSON.parse(readFileSync(descriptor, "utf8"));
73
+ } finally {
74
+ closeSync(descriptor);
75
+ }
76
+ }
77
+
78
+ function jsonFiles(directory: string): string[] {
79
+ try {
80
+ return readdirSync(directory, { withFileTypes: true })
81
+ .filter((entry) => (entry.isFile() || entry.isSymbolicLink()) && entry.name.endsWith(".json"))
82
+ .map((entry) => join(directory, entry.name));
83
+ } catch (error) {
84
+ if (isMissing(error)) return [];
85
+ throw error;
86
+ }
87
+ }
88
+
89
+ function agentRecordFiles(home: string): string[] {
90
+ const root = join(home, "agents");
91
+ let projects: string[];
92
+ try {
93
+ projects = readdirSync(root, { withFileTypes: true })
94
+ .filter((entry) => entry.isDirectory())
95
+ .map((entry) => join(root, entry.name));
96
+ } catch (error) {
97
+ if (isMissing(error)) return [];
98
+ throw error;
99
+ }
100
+ return [jsonFiles(root), ...projects.map(jsonFiles)].flat();
101
+ }
102
+
103
+ /** Read on every start: a config entry that extends an absent plugin provider breaks the registry. */
104
+ function configUsesPluginProvider(home: string): boolean {
105
+ const raw = readJson(join(home, "config.json"));
106
+ if (raw === undefined) return false;
107
+ const config = ConfigSchema.parse(raw);
108
+ const providers = Object.entries(config.agents?.providers ?? {});
109
+ const referenced = [
110
+ ...(config.agents?.metadataGeneration?.providers ?? []),
111
+ ...(config.daemon?.agentProfiles ?? []),
112
+ ];
113
+ return (
114
+ providers.some(([id, entry]) => isPluginProviderId(id) || isPluginProviderId(entry.extends)) ||
115
+ referenced.some((entry) => isPluginProviderId(entry.provider))
116
+ );
117
+ }
118
+
119
+ /** Schedules and agent records, including archived ones. Throws when evidence cannot be read. */
120
+ function recordsUsePluginProvider(home: string): boolean {
121
+ const schedules = jsonFiles(join(home, "schedules"));
122
+ const agents = agentRecordFiles(home);
123
+ if (schedules.length + agents.length > MAX_EVIDENCE_FILES) {
124
+ throw new Error("too many Paseo records to inspect at startup");
125
+ }
126
+ return (
127
+ schedules.some((file) =>
128
+ isPluginProviderId(ScheduleSchema.parse(readJson(file)).target.config?.provider),
129
+ ) || agents.some((file) => isPluginProviderId(AgentRecordSchema.parse(readJson(file)).provider))
130
+ );
131
+ }
132
+
133
+ /**
134
+ * The plugin's own providers are opt-in for new installs. A host that already used them keeps
135
+ * them registered without configuration. Agent or schedule use is latched in a marker, so
136
+ * deleting the last old agent never hides the providers. Config references are read on every
137
+ * start and never latched. There is no marker for "new install": absence means not latched yet.
138
+ * Anything unreadable keeps the providers on.
139
+ */
140
+ export function pluginProvidersRequireConfiguration(
141
+ environment: NodeJS.ProcessEnv = process.env,
142
+ ): boolean {
143
+ const home = paseoHomeDir(environment);
144
+ const directory = join(home, "plugin-data", "paseo-omp");
145
+ const marker = join(directory, MARKER_FILE);
146
+ try {
147
+ const latched = readJson(marker);
148
+ if (latched !== undefined) {
149
+ MarkerSchema.parse(latched);
150
+ return false;
151
+ }
152
+ if (!recordsUsePluginProvider(home)) return !configUsesPluginProvider(home);
153
+ } catch {
154
+ return false;
155
+ }
156
+ try {
157
+ mkdirSync(directory, { recursive: true, mode: 0o700 });
158
+ writeFileSync(marker, `${JSON.stringify({ version: 1, legacyUse: true })}\n`, {
159
+ flag: "wx",
160
+ mode: 0o600,
161
+ });
162
+ } catch {
163
+ // Unlatched, the next start finds the same evidence.
164
+ }
165
+ return false;
166
+ }