@opengeni/runtime 4.6.1 → 4.6.2-canary.39854174564001

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.
@@ -0,0 +1,110 @@
1
+ import type { MCPServer } from "@openai/agents";
2
+ import { type LocalMcpBridgeAdapter, type LocalMcpBridgeServer } from "@opengeni/capabilities";
3
+ import { type FetchLike } from "@opengeni/network";
4
+ import type { McpServerConnectionRef, ToolAuthNeededPayload } from "@opengeni/contracts";
5
+ import type { ResolveConnectionCredentialInput, ResolveConnectionCredentialResult } from "./index.js";
6
+ export declare const OFFICIAL_DRIVE_MCP_URL = "https://drivemcp.googleapis.com/mcp/v1";
7
+ export declare const DRIVE_EXTRA_TOOLS: {
8
+ name: string;
9
+ description: string;
10
+ inputSchema: Awaited<ReturnType<MCPServer["listTools"]>>[number]["inputSchema"];
11
+ annotations: {
12
+ readOnlyHint: boolean;
13
+ destructiveHint: boolean;
14
+ idempotentHint: boolean;
15
+ openWorldHint: boolean;
16
+ };
17
+ }[];
18
+ export declare const DRIVE_MCP_BRIDGE_DESCRIPTOR: Readonly<{
19
+ contractVersion: typeof import("@opengeni/capabilities").LOCAL_MCP_BRIDGE_CONTRACT_VERSION;
20
+ adapterId: string;
21
+ providerId: string;
22
+ catalogIdentity: string;
23
+ transport: "in_process";
24
+ authority: import("@opengeni/capabilities").LocalMcpBridgeAuthority;
25
+ toolSurface: import("@opengeni/capabilities").LocalMcpBridgeToolSurface;
26
+ mutationReplay: "safe_reads_only";
27
+ destinations: readonly import("@opengeni/capabilities").LocalMcpBridgeDestination[];
28
+ }>;
29
+ export type DriveMcpBridgeConfig = {
30
+ readonly url: string;
31
+ readonly connectionRef?: McpServerConnectionRef | undefined;
32
+ };
33
+ export type DriveMcpBridgeContext = {
34
+ workspaceId: string;
35
+ subjectId?: string;
36
+ serverId: string;
37
+ resolveCredential: (input: ResolveConnectionCredentialInput) => Promise<ResolveConnectionCredentialResult>;
38
+ onAuthNeeded?: (payload: ToolAuthNeededPayload) => void | Promise<void>;
39
+ onResolvedConnectionId?: (connectionId: string) => void;
40
+ fetchImpl?: FetchLike;
41
+ createRemoteServer: () => MCPServer;
42
+ };
43
+ type DriveToolResult = Awaited<ReturnType<NonNullable<MCPServer["callToolResult"]>>>;
44
+ export declare class DriveMcpServer implements LocalMcpBridgeServer {
45
+ private readonly config;
46
+ private readonly context;
47
+ readonly bridge: Readonly<{
48
+ contractVersion: typeof import("@opengeni/capabilities").LOCAL_MCP_BRIDGE_CONTRACT_VERSION;
49
+ adapterId: string;
50
+ providerId: string;
51
+ catalogIdentity: string;
52
+ transport: "in_process";
53
+ authority: import("@opengeni/capabilities").LocalMcpBridgeAuthority;
54
+ toolSurface: import("@opengeni/capabilities").LocalMcpBridgeToolSurface;
55
+ mutationReplay: "safe_reads_only";
56
+ destinations: readonly import("@opengeni/capabilities").LocalMcpBridgeDestination[];
57
+ }>;
58
+ readonly cacheToolsList = false;
59
+ readonly name: string;
60
+ private readonly remote;
61
+ constructor(config: DriveMcpBridgeConfig, context: DriveMcpBridgeContext);
62
+ connect(): Promise<void>;
63
+ close(): Promise<void>;
64
+ invalidateToolsCache(): Promise<void>;
65
+ listTools(): Promise<({
66
+ name: string;
67
+ description?: string | undefined;
68
+ inputSchema: {
69
+ type: "object";
70
+ properties: Record<string, any>;
71
+ required: string[];
72
+ additionalProperties: boolean;
73
+ };
74
+ } | {
75
+ name: string;
76
+ description: string;
77
+ inputSchema: Awaited<ReturnType<MCPServer["listTools"]>>[number]["inputSchema"];
78
+ annotations: {
79
+ readOnlyHint: boolean;
80
+ destructiveHint: boolean;
81
+ idempotentHint: boolean;
82
+ openWorldHint: boolean;
83
+ };
84
+ })[]>;
85
+ callTool(name: string, args: Record<string, unknown> | null, meta?: Record<string, unknown> | null, options?: {
86
+ signal?: AbortSignal;
87
+ }): Promise<{
88
+ [key: string]: unknown;
89
+ type: string;
90
+ }[]>;
91
+ callToolResult(name: string, args: Record<string, unknown> | null, meta?: Record<string, unknown> | null, options?: {
92
+ signal?: AbortSignal;
93
+ }): Promise<DriveToolResult>;
94
+ }
95
+ export declare function isOfficialDriveMcpConfig(config: DriveMcpBridgeConfig): boolean;
96
+ export declare function mergeDriveMcpTools<T extends {
97
+ name: string;
98
+ }>(remote: T[]): (T | {
99
+ name: string;
100
+ description: string;
101
+ inputSchema: Awaited<ReturnType<MCPServer["listTools"]>>[number]["inputSchema"];
102
+ annotations: {
103
+ readOnlyHint: boolean;
104
+ destructiveHint: boolean;
105
+ idempotentHint: boolean;
106
+ openWorldHint: boolean;
107
+ };
108
+ })[];
109
+ export declare const DRIVE_MCP_BRIDGE_ADAPTER: LocalMcpBridgeAdapter<DriveMcpBridgeConfig, DriveMcpBridgeContext>;
110
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { isOfficialDriveMcpConfig, mergeDriveMcpTools } from "./drive-mcp.js";
1
2
  import { type InteractionToolErrorResult } from "./interaction-tools.js";
2
3
  export { preparedCompactionRequest, queuePreparedCompaction } from "./prepared-compaction-request.js";
3
4
  export { createAnthropicCompactionSizer, fitCompactionPrefix, compactionPrefixCuts, } from "./anthropic-compaction.js";
package/dist/index.js CHANGED
@@ -109,6 +109,7 @@ import {
109
109
  isMcpServiceUnavailableError,
110
110
  isMcpToolMetricLabel,
111
111
  isMcpTransportConnectivityError,
112
+ isOfficialDriveMcpConfig,
112
113
  joinPersistentAgentInstructionLayers,
113
114
  loadNativeToolSkillArtifacts,
114
115
  materializeSandboxFileDownloads,
@@ -119,6 +120,7 @@ import {
119
120
  mcpToolMetricLabel,
120
121
  mcpTransportErrorWithRetryMetadata,
121
122
  mcpUnavailableReason,
123
+ mergeDriveMcpTools,
122
124
  modelResponseHasVisibleText,
123
125
  modelToolResultFits,
124
126
  modelToolResultOverflowError,
@@ -193,7 +195,7 @@ import {
193
195
  workspaceEnvironmentInstructions,
194
196
  wrapAttemptToolDefinitions,
195
197
  wrapAttemptToolExecute
196
- } from "./chunk-L6CVIN52.js";
198
+ } from "./chunk-LOWZTPW3.js";
197
199
  import {
198
200
  BROWSER_CONTROL_ADMIN_TOKEN_FILE,
199
201
  BROWSER_CONTROL_PORT,
@@ -568,7 +570,7 @@ import {
568
570
  warmCodexResponsesWebSocket,
569
571
  withClaudeUsageObserver,
570
572
  withModelTransportStartedObserver
571
- } from "./chunk-YXNCKAJS.js";
573
+ } from "./chunk-TVZD7HHB.js";
572
574
  import {
573
575
  UnsupportedProtocolJsonValueError,
574
576
  normalizeProtocolJsonValue
@@ -1205,6 +1207,7 @@ export {
1205
1207
  isModalCommandStartOutcomeUnknownError,
1206
1208
  isModalTaskExecStartPreDispatchUnavailableError,
1207
1209
  isModelPreempted,
1210
+ isOfficialDriveMcpConfig,
1208
1211
  isOfficialGmailMcpConfig,
1209
1212
  isOfficialSlackMcpConfig,
1210
1213
  isOpTombstone,
@@ -1248,6 +1251,7 @@ export {
1248
1251
  mcpToolMetricLabel,
1249
1252
  mcpTransportErrorWithRetryMetadata,
1250
1253
  mcpUnavailableReason,
1254
+ mergeDriveMcpTools,
1251
1255
  mintSandboxCodemodeToken,
1252
1256
  mintStreamToken,
1253
1257
  modalAppHasRunningSandboxes,
@@ -4,7 +4,7 @@ import {
4
4
  SingleModelCallUnsupportedError,
5
5
  normalizeModelCallUsage,
6
6
  runSingleModelCall
7
- } from "./chunk-YXNCKAJS.js";
7
+ } from "./chunk-TVZD7HHB.js";
8
8
  import "./chunk-5ULGMFKR.js";
9
9
  import "./chunk-INTURRTP.js";
10
10
  import "./chunk-GYATCWJ2.js";
@@ -3,11 +3,11 @@ import {
3
3
  prepareAgentTools,
4
4
  secretArgumentMode,
5
5
  sessionMcpApprovalConnectionId
6
- } from "./chunk-L6CVIN52.js";
6
+ } from "./chunk-LOWZTPW3.js";
7
7
  import "./chunk-3NFAQEVC.js";
8
8
  import "./chunk-2BWFHS64.js";
9
9
  import "./chunk-P2QDPLC3.js";
10
- import "./chunk-YXNCKAJS.js";
10
+ import "./chunk-TVZD7HHB.js";
11
11
  import "./chunk-5ULGMFKR.js";
12
12
  import "./chunk-KRRPJI2K.js";
13
13
  import "./chunk-XPWBGFFV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/runtime",
3
- "version": "4.6.1",
3
+ "version": "4.6.2-canary.39854174564001",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -76,20 +76,20 @@
76
76
  "@openai/agents": "0.14.3",
77
77
  "@openai/agents-core": "0.14.3",
78
78
  "@openai/agents-extensions": "0.14.3",
79
- "@opengeni/agent-proto": "4.6.1",
80
- "@opengeni/capabilities": "4.6.1",
81
- "@opengeni/codemode": "4.6.1",
82
- "@opengeni/codex": "4.6.1",
83
- "@opengeni/config": "4.6.1",
84
- "@opengeni/contracts": "4.6.1",
85
- "@opengeni/decisions": "4.6.1",
86
- "@opengeni/interaction": "4.6.1",
87
- "@opengeni/network": "4.6.1",
88
- "@opengeni/observability": "4.6.1",
89
- "@opengeni/sdk": "4.6.1",
90
- "@opengeni/tool-gateway": "4.6.1",
91
- "@opengeni/vaults": "4.6.1",
92
- "@opengeni/xai-subscription": "4.6.1",
79
+ "@opengeni/agent-proto": "4.6.2-canary.39854174564001",
80
+ "@opengeni/capabilities": "4.6.2-canary.39854174564001",
81
+ "@opengeni/codemode": "4.6.2-canary.39854174564001",
82
+ "@opengeni/codex": "4.6.2-canary.39854174564001",
83
+ "@opengeni/config": "4.6.2-canary.39854174564001",
84
+ "@opengeni/contracts": "4.6.2-canary.39854174564001",
85
+ "@opengeni/decisions": "4.6.2-canary.39854174564001",
86
+ "@opengeni/interaction": "4.6.2-canary.39854174564001",
87
+ "@opengeni/network": "4.6.2-canary.39854174564001",
88
+ "@opengeni/observability": "4.6.2-canary.39854174564001",
89
+ "@opengeni/sdk": "4.6.2-canary.39854174564001",
90
+ "@opengeni/tool-gateway": "4.6.2-canary.39854174564001",
91
+ "@opengeni/vaults": "4.6.2-canary.39854174564001",
92
+ "@opengeni/xai-subscription": "4.6.2-canary.39854174564001",
93
93
  "debug": "4.4.3",
94
94
  "e2b": "2.56.0",
95
95
  "modal": "0.9.0",
@@ -124,14 +124,27 @@ function interactionToolName(name: string): string | null {
124
124
  return name.startsWith(prefix) ? name.slice(prefix.length) : null;
125
125
  }
126
126
 
127
+ /**
128
+ * Native CUA tools (`cua_<name>`) come with the two an agent needs to use any
129
+ * of them well: the window read and the batch tool. Without the batch tool in
130
+ * hand, an agent that found `cua_click` sends every field as its own call.
131
+ */
132
+ const CUA_TOOL_PREFIX = "cua_";
133
+ const CUA_WORKING_SET: readonly string[] = ["cua_get_window_state", "cua_run_steps"];
134
+
127
135
  /** The other members of every family a disclosed tool belongs to, in family order. */
128
136
  function familyCompanions<T extends Tool & { name: string }>(disclosed: T[], pool: T[]): T[] {
129
137
  const disclosedShort = new Set(
130
138
  disclosed.map((tool) => interactionToolName(tool.name)).filter((name) => name !== null),
131
139
  );
132
- const wanted = INTERACTION_TOOL_FAMILIES.filter((family) =>
133
- family.some((member) => disclosedShort.has(member)),
134
- ).flat();
140
+ const wanted = [
141
+ ...INTERACTION_TOOL_FAMILIES.filter((family) =>
142
+ family.some((member) => disclosedShort.has(member)),
143
+ ).flat(),
144
+ ...([...disclosedShort].some((name) => name.startsWith(CUA_TOOL_PREFIX))
145
+ ? CUA_WORKING_SET
146
+ : []),
147
+ ];
135
148
  const companions: T[] = [];
136
149
  for (const member of wanted) {
137
150
  if (disclosedShort.has(member)) continue;
@@ -359,11 +359,15 @@ export function computerObservationText(observation: ComputerTextObservation): s
359
359
  : `Changed elements since ${semantic.baseObservationId}; elements not listed are unchanged and keep their refs:`,
360
360
  );
361
361
  } else if (rendered.listed === 0) {
362
- lines.push("The accessibility tree has no readable elements; use the screenshot.");
362
+ lines.push(
363
+ rendered.omitted
364
+ ? `No element is listed: the accessibility tree's ${plural(rendered.omitted, "element")} are all hidden, unlabeled or repeated; use the screenshot.`
365
+ : "The accessibility tree has no readable elements; use the screenshot.",
366
+ );
363
367
  }
364
368
  lines.push(...rendered.lines);
365
369
  const notes = [
366
- rendered.omitted
370
+ rendered.omitted && rendered.listed > 0
367
371
  ? `${plural(rendered.omitted, "hidden, unlabeled or repeated element")} not shown`
368
372
  : null,
369
373
  semantic.kind === "diff" && semantic.removedRefs.length > 0