@omercnet/paseo-omp 5.6.1-next.457.1 → 5.6.1-next.459.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-omp",
3
- "version": "5.6.1-next.457.1",
3
+ "version": "5.6.1-next.459.1",
4
4
  "type": "module",
5
5
  "description": "Paseo integration for OMP, including its direct provider and workspace tooling.",
6
6
  "license": "MIT",
@@ -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.6.1-next.457.1"; // x-release-please-version
2
+ export const PASEO_OMP_PACKAGE_VERSION = "5.6.1-next.459.1"; // x-release-please-version
@@ -1,3 +1,4 @@
1
+ import { isDeepStrictEqual } from "node:util";
1
2
  import type { ProviderSessionConfig } from "@getpaseo/plugin/server/provider";
2
3
  import type { OmpStartOptions } from "./omp-rpc-environment";
3
4
 
@@ -15,6 +16,24 @@ import { OmpPublicError } from "./security";
15
16
  import { withoutOmpSessionPurpose } from "./session-purpose";
16
17
  import { OmpModeSchema } from "./settings";
17
18
 
19
+ /**
20
+ * Whether a session asks for provider settings OMP does not expose. Paseo 0.14/0.15 fill
21
+ * `settings` from feature values; Paseo 0.16 mirrors `providerOptions` there instead, so a key
22
+ * that only repeats the same `providerOptions` value is not a setting.
23
+ */
24
+ export function hasOmpProviderSettings(settings: unknown, providerOptions: unknown): boolean {
25
+ if (!settings || typeof settings !== "object") return false;
26
+ const options =
27
+ providerOptions && typeof providerOptions === "object"
28
+ ? (providerOptions as Record<string, unknown>)
29
+ : {};
30
+ for (const [key, value] of Object.entries(settings)) {
31
+ if (!Object.hasOwn(options, key)) return true;
32
+ if (!isDeepStrictEqual(value, options[key])) return true;
33
+ }
34
+ return false;
35
+ }
36
+
18
37
  const OMP_BUILTIN_TOOL_NAMES = [
19
38
  "read",
20
39
  "bash",
@@ -120,7 +139,7 @@ export function normalizeOmpSessionConfig(
120
139
  permissionSupported = false,
121
140
  hostInheritEnv: readonly string[] = [],
122
141
  ): NormalizedOmpStartOptions {
123
- if (Object.keys(config.settings).length > 0) {
142
+ if (hasOmpProviderSettings(config.settings, config.providerOptions)) {
124
143
  throw new OmpPublicError("OMP does not expose live provider settings");
125
144
  }
126
145
  const parsedMode = OmpModeSchema.safeParse(config.mode ?? "full");
@@ -15,7 +15,7 @@ import type {
15
15
  } from "../operational-failure-diagnostics";
16
16
  import type { OmpSubagentControlRegistry } from "../subagents";
17
17
  import { discoverOmpCatalog } from "./catalog";
18
- import { normalizeOmpCatalogOptions } from "./config-normalization";
18
+ import { hasOmpProviderSettings, normalizeOmpCatalogOptions } from "./config-normalization";
19
19
  import type { OmpMcpConnector } from "./host-tools";
20
20
  import type { OmpRuntime } from "./omp-rpc";
21
21
  import {
@@ -77,14 +77,6 @@ const MAX_NESTED_OPTION_BYTES = 256 * 1024;
77
77
  const MAX_ENV_ENTRIES = 256;
78
78
  const MAX_NATIVE_SESSION_RESERVATIONS = 256;
79
79
 
80
- function hasOwnEntries(value: unknown): boolean {
81
- if (!value || typeof value !== "object") return false;
82
- for (const key in value) {
83
- if (Object.hasOwn(value, key)) return true;
84
- }
85
- return false;
86
- }
87
-
88
80
  function providerOptionsExceedPreflightLimits(value: unknown): boolean {
89
81
  if (
90
82
  boundedJsonBytes(value, MAX_NESTED_OPTION_BYTES, MAX_ENV_ENTRIES) === Number.POSITIVE_INFINITY
@@ -143,7 +135,7 @@ function preflightProviderInput(input: unknown): void {
143
135
  if (config?.toolPolicy !== undefined) {
144
136
  throw new OmpPublicError("OMP does not support host tool policies");
145
137
  }
146
- if (hasOwnEntries(config?.settings)) {
138
+ if (hasOmpProviderSettings(config?.settings, config?.providerOptions)) {
147
139
  throw new OmpPublicError("OMP does not expose live provider settings");
148
140
  }
149
141
  }