@opengeni/runtime 3.3.0 → 3.3.1-canary.38922642121001

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.
Files changed (47) hide show
  1. package/dist/agent-LJT5NPWT.js +9 -0
  2. package/dist/assets/codemode-client.json +1 -1
  3. package/dist/{chunk-HJSIPTFA.js → chunk-4XDJ4TJA.js} +2 -2
  4. package/dist/{chunk-XQ23VCZ4.js → chunk-6FQ6KEII.js} +3 -3
  5. package/dist/{chunk-7LJ7KDPI.js → chunk-ERD4ICVB.js} +4 -3
  6. package/dist/{chunk-YG26XE7B.js → chunk-JYDG2A7H.js} +2 -2
  7. package/dist/{chunk-RSHQSLEJ.js → chunk-KIL4FGX5.js} +3 -3
  8. package/dist/{chunk-NWS4HPB7.js → chunk-MIAL5I4O.js} +2 -2
  9. package/dist/{chunk-7OUG7WBV.js → chunk-N5EB52EH.js} +3 -3
  10. package/dist/{chunk-Z5U6WE22.js → chunk-PRZPGRIK.js} +2 -2
  11. package/dist/{chunk-KCPW4K7L.js → chunk-PZQUUBEB.js} +2 -2
  12. package/dist/{chunk-XRX57ZQO.js → chunk-XJARX6VV.js} +194 -23
  13. package/dist/chunk-XJARX6VV.js.map +1 -0
  14. package/dist/{chunk-5WJOPANS.js → chunk-Y5THZH5N.js} +7 -7
  15. package/dist/{chunk-EK7IW2FR.js → chunk-ZUHGY36R.js} +5 -5
  16. package/dist/gmail-rest-mcp.js +8 -8
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.js +14 -12
  19. package/dist/interaction-tool-json-schema.d.ts +20 -0
  20. package/dist/{lazy-manifest-AJ6XPJ4F.js → lazy-manifest-BLZ3UZLX.js} +4 -4
  21. package/dist/{localSources-SSIEH5F5.js → localSources-I6SIQ6CX.js} +6 -6
  22. package/dist/model-call.js +3 -3
  23. package/dist/sandbox/index.js +7 -7
  24. package/dist/slack-rest-mcp.js +8 -8
  25. package/dist/workspace-tool-gateway.js +12 -12
  26. package/package.json +14 -14
  27. package/src/index.ts +39 -1
  28. package/src/interaction-tool-json-schema.ts +214 -0
  29. package/src/interaction-tools.ts +6 -6
  30. package/dist/agent-CTPLA3HP.js +0 -9
  31. package/dist/browser-action-json-schema.d.ts +0 -4
  32. package/dist/chunk-XRX57ZQO.js.map +0 -1
  33. package/src/browser-action-json-schema.ts +0 -10
  34. /package/dist/{agent-CTPLA3HP.js.map → agent-LJT5NPWT.js.map} +0 -0
  35. /package/dist/{chunk-HJSIPTFA.js.map → chunk-4XDJ4TJA.js.map} +0 -0
  36. /package/dist/{chunk-XQ23VCZ4.js.map → chunk-6FQ6KEII.js.map} +0 -0
  37. /package/dist/{chunk-7LJ7KDPI.js.map → chunk-ERD4ICVB.js.map} +0 -0
  38. /package/dist/{chunk-YG26XE7B.js.map → chunk-JYDG2A7H.js.map} +0 -0
  39. /package/dist/{chunk-RSHQSLEJ.js.map → chunk-KIL4FGX5.js.map} +0 -0
  40. /package/dist/{chunk-NWS4HPB7.js.map → chunk-MIAL5I4O.js.map} +0 -0
  41. /package/dist/{chunk-7OUG7WBV.js.map → chunk-N5EB52EH.js.map} +0 -0
  42. /package/dist/{chunk-Z5U6WE22.js.map → chunk-PRZPGRIK.js.map} +0 -0
  43. /package/dist/{chunk-KCPW4K7L.js.map → chunk-PZQUUBEB.js.map} +0 -0
  44. /package/dist/{chunk-5WJOPANS.js.map → chunk-Y5THZH5N.js.map} +0 -0
  45. /package/dist/{chunk-EK7IW2FR.js.map → chunk-ZUHGY36R.js.map} +0 -0
  46. /package/dist/{lazy-manifest-AJ6XPJ4F.js.map → lazy-manifest-BLZ3UZLX.js.map} +0 -0
  47. /package/dist/{localSources-SSIEH5F5.js.map → localSources-I6SIQ6CX.js.map} +0 -0
@@ -26,17 +26,17 @@ import {
26
26
  truncateOutput,
27
27
  validateCredentialPair,
28
28
  validateRemoteSandboxPathForManifest
29
- } from "./chunk-YG26XE7B.js";
29
+ } from "./chunk-JYDG2A7H.js";
30
30
  import {
31
31
  isNoopSnapshotSpec,
32
32
  normalizeSandboxClientCreateArgs,
33
33
  resolveSandboxArchiveLimits,
34
34
  validateSandboxArchiveLimits
35
- } from "./chunk-NWS4HPB7.js";
35
+ } from "./chunk-MIAL5I4O.js";
36
36
  import {
37
37
  isSandboxPathNotFoundError,
38
38
  probeSandboxPathExists
39
- } from "./chunk-HJSIPTFA.js";
39
+ } from "./chunk-4XDJ4TJA.js";
40
40
  import {
41
41
  Environment,
42
42
  FileMode,
@@ -94,7 +94,7 @@ import {
94
94
  shellQuote,
95
95
  stableJsonStringify,
96
96
  withSandboxSpan
97
- } from "./chunk-7LJ7KDPI.js";
97
+ } from "./chunk-ERD4ICVB.js";
98
98
 
99
99
  // src/sandbox/selfhosted/control-rpc.ts
100
100
  import { ControlRequest as ControlRequest2, ControlResponse, ErrorCode } from "@opengeni/agent-proto";
@@ -15086,7 +15086,7 @@ var CloudflareSandboxSession = class {
15086
15086
  async materializeEntry(args) {
15087
15087
  assertSandboxEntryMetadataSupported("CloudflareSandboxClient", args.path, args.entry, MOUNT_MANIFEST_METADATA_SUPPORT);
15088
15088
  if (entryContainsLocalSource(args.entry)) {
15089
- const { applyLocalSourceManifestEntryToState: applyLocalSourceManifestEntryToState2 } = await import("./localSources-SSIEH5F5.js");
15089
+ const { applyLocalSourceManifestEntryToState: applyLocalSourceManifestEntryToState2 } = await import("./localSources-I6SIQ6CX.js");
15090
15090
  await applyLocalSourceManifestEntryToState2(this.state, args.path, args.entry, "cloudflare", this.writer(), this.remotePathResolver, this.manifestMaterializationOptions(args.runAs));
15091
15091
  return;
15092
15092
  }
@@ -15097,7 +15097,7 @@ var CloudflareSandboxSession = class {
15097
15097
  assertSandboxManifestMetadataSupported("CloudflareSandboxClient", manifest, MOUNT_MANIFEST_METADATA_SUPPORT);
15098
15098
  assertCloudflareManifestMountsSupported(manifest);
15099
15099
  if (manifestContainsLocalSource(manifest)) {
15100
- const { applyLocalSourceManifestToState: applyLocalSourceManifestToState2 } = await import("./localSources-SSIEH5F5.js");
15100
+ const { applyLocalSourceManifestToState: applyLocalSourceManifestToState2 } = await import("./localSources-I6SIQ6CX.js");
15101
15101
  await applyLocalSourceManifestToState2(this.state, manifest, "cloudflare", this.writer(), this.remotePathResolver, this.manifestMaterializationOptions(runAs));
15102
15102
  return;
15103
15103
  }
@@ -26127,4 +26127,4 @@ export {
26127
26127
  renderRoutingMutationOutcomeUnknownToolResult,
26128
26128
  RoutingSandboxSession
26129
26129
  };
26130
- //# sourceMappingURL=chunk-5WJOPANS.js.map
26130
+ //# sourceMappingURL=chunk-Y5THZH5N.js.map
@@ -107,7 +107,7 @@ import {
107
107
  withNativeSynchronousCommandCollection,
108
108
  withProviderError,
109
109
  withSandboxProviderCapture
110
- } from "./chunk-5WJOPANS.js";
110
+ } from "./chunk-Y5THZH5N.js";
111
111
  import {
112
112
  applyLocalSourceManifestEntryToState,
113
113
  applyLocalSourceManifestToState,
@@ -122,13 +122,13 @@ import {
122
122
  truncateOutput,
123
123
  validateCredentialPair,
124
124
  validateRemoteSandboxPathForManifest
125
- } from "./chunk-YG26XE7B.js";
125
+ } from "./chunk-JYDG2A7H.js";
126
126
  import {
127
127
  NoopSnapshotSpec,
128
128
  normalizeSandboxClientCreateArgs,
129
129
  resolveSandboxArchiveLimits,
130
130
  validateSandboxArchiveLimits
131
- } from "./chunk-NWS4HPB7.js";
131
+ } from "./chunk-MIAL5I4O.js";
132
132
  import {
133
133
  Manifest,
134
134
  Permissions,
@@ -160,7 +160,7 @@ import {
160
160
  serializeRuntimeEnvironmentForPersistence,
161
161
  shellQuote,
162
162
  withSandboxSpan
163
- } from "./chunk-7LJ7KDPI.js";
163
+ } from "./chunk-ERD4ICVB.js";
164
164
 
165
165
  // src/sandbox/index.ts
166
166
  import { collectSandboxEnvironment, parseExposedPorts } from "@opengeni/config";
@@ -20554,4 +20554,4 @@ export {
20554
20554
  collectSandboxEnvironment2 as collectSandboxEnvironment,
20555
20555
  parseExposedPorts2 as parseExposedPorts
20556
20556
  };
20557
- //# sourceMappingURL=chunk-EK7IW2FR.js.map
20557
+ //# sourceMappingURL=chunk-ZUHGY36R.js.map
@@ -11,15 +11,15 @@ import {
11
11
  gmailToolAvailableOnDeployment,
12
12
  gmailToolSupportsScopes,
13
13
  isOfficialGmailMcpConfig
14
- } from "./chunk-XQ23VCZ4.js";
15
- import "./chunk-Z5U6WE22.js";
16
- import "./chunk-5WJOPANS.js";
14
+ } from "./chunk-6FQ6KEII.js";
15
+ import "./chunk-PRZPGRIK.js";
16
+ import "./chunk-Y5THZH5N.js";
17
17
  import "./chunk-4A4XTKKX.js";
18
- import "./chunk-YG26XE7B.js";
19
- import "./chunk-NWS4HPB7.js";
20
- import "./chunk-HJSIPTFA.js";
21
- import "./chunk-KCPW4K7L.js";
22
- import "./chunk-7LJ7KDPI.js";
18
+ import "./chunk-JYDG2A7H.js";
19
+ import "./chunk-MIAL5I4O.js";
20
+ import "./chunk-4XDJ4TJA.js";
21
+ import "./chunk-PZQUUBEB.js";
22
+ import "./chunk-ERD4ICVB.js";
23
23
  import "./chunk-LJNCGUMB.js";
24
24
  import "./chunk-PLDDJCW6.js";
25
25
  export {
package/dist/index.d.ts CHANGED
@@ -708,6 +708,9 @@ export declare function buildOpenGeniAgent(settings: Settings, resources: Resour
708
708
  * or writes those rules must derive the identity through this function.
709
709
  */
710
710
  export declare function sessionMcpApprovalConnectionId(serverId: string, url: string): string;
711
+ /** Why interaction_request_human arguments cannot be recorded as an
712
+ * intervention, in words the model can act on, or null when they can. */
713
+ export declare function interactionRequestArgumentsProblem(serialized: string): string | null;
711
714
  /**
712
715
  * Codex and reviewed Responses-compatible Gateway routes accept ordinary
713
716
  * FUNCTION tools plus `input_image` content inside a function_call_output. The
package/dist/index.js CHANGED
@@ -99,6 +99,7 @@ import {
99
99
  identityFromLegacyTemplate,
100
100
  incrementalModelInputProjectionFilter,
101
101
  inspectPersistentAgentInstructions,
102
+ interactionRequestArgumentsProblem,
102
103
  interactionToolErrorOutput,
103
104
  interruptionKindForCallItem,
104
105
  invokePreparedAgentTool,
@@ -187,7 +188,7 @@ import {
187
188
  workspaceEnvironmentInstructions,
188
189
  wrapAttemptToolDefinitions,
189
190
  wrapAttemptToolExecute
190
- } from "./chunk-XRX57ZQO.js";
191
+ } from "./chunk-XJARX6VV.js";
191
192
  import {
192
193
  ActiveBackendUnresolvableError,
193
194
  BROWSER_CONTROL_ADMIN_TOKEN_FILE,
@@ -403,7 +404,7 @@ import {
403
404
  withRunCredentialsSession,
404
405
  withoutSandboxProviderIdentity,
405
406
  workspaceArchiveDownloadTemporaryDirectory
406
- } from "./chunk-EK7IW2FR.js";
407
+ } from "./chunk-ZUHGY36R.js";
407
408
  import {
408
409
  SKILL_MAX_FILES,
409
410
  SKILL_MAX_FILE_BYTES,
@@ -558,7 +559,7 @@ import {
558
559
  toolCallIdFromSdkItem,
559
560
  vercelGatewayRoutingFetch,
560
561
  withClaudeUsageObserver
561
- } from "./chunk-7OUG7WBV.js";
562
+ } from "./chunk-N5EB52EH.js";
562
563
  import {
563
564
  UnsupportedProtocolJsonValueError,
564
565
  normalizeProtocolJsonValue
@@ -572,7 +573,7 @@ import {
572
573
  gmailToolAvailableOnDeployment,
573
574
  gmailToolSupportsScopes,
574
575
  isOfficialGmailMcpConfig
575
- } from "./chunk-XQ23VCZ4.js";
576
+ } from "./chunk-6FQ6KEII.js";
576
577
  import {
577
578
  OFFICIAL_SLACK_MCP_URL,
578
579
  SLACK_REST_API_BASE,
@@ -580,14 +581,14 @@ import {
580
581
  SlackRestMcpServer,
581
582
  isOfficialSlackMcpConfig,
582
583
  slackRestToolIsMutation
583
- } from "./chunk-RSHQSLEJ.js";
584
+ } from "./chunk-KIL4FGX5.js";
584
585
  import {
585
586
  CONNECTOR_ATTACHMENT_PROVIDER_RESULT_MAX_BYTES,
586
587
  CONNECTOR_ATTACHMENT_SANITIZED_RESULT_MAX_BYTES,
587
588
  ConnectorAttachmentTransferError,
588
589
  connectorAttachmentSandboxPath,
589
590
  projectConnectorAttachmentTransfers
590
- } from "./chunk-Z5U6WE22.js";
591
+ } from "./chunk-PRZPGRIK.js";
591
592
  import {
592
593
  CODE_SEARCH_RG_MAX_BYTES,
593
594
  ChannelAConflictError,
@@ -684,15 +685,15 @@ import {
684
685
  validateCodeSearchRipgrepArgs,
685
686
  withModalCommandStartSignal,
686
687
  withRoutingMutationOutputRejectionFence
687
- } from "./chunk-5WJOPANS.js";
688
+ } from "./chunk-Y5THZH5N.js";
688
689
  import "./chunk-4A4XTKKX.js";
689
- import "./chunk-YG26XE7B.js";
690
- import "./chunk-NWS4HPB7.js";
691
- import "./chunk-HJSIPTFA.js";
692
- import "./chunk-KCPW4K7L.js";
690
+ import "./chunk-JYDG2A7H.js";
691
+ import "./chunk-MIAL5I4O.js";
692
+ import "./chunk-4XDJ4TJA.js";
693
+ import "./chunk-PZQUUBEB.js";
693
694
  import {
694
695
  MaxTurnsExceededError
695
- } from "./chunk-7LJ7KDPI.js";
696
+ } from "./chunk-ERD4ICVB.js";
696
697
  import "./chunk-LJNCGUMB.js";
697
698
  import "./chunk-PLDDJCW6.js";
698
699
  export {
@@ -1084,6 +1085,7 @@ export {
1084
1085
  inspectModalSandboxLifecycle,
1085
1086
  inspectPersistentAgentInstructions,
1086
1087
  inspectRecordingArtifact,
1088
+ interactionRequestArgumentsProblem,
1087
1089
  interactionToolErrorOutput,
1088
1090
  interruptionKindForCallItem,
1089
1091
  invokePreparedAgentTool,
@@ -0,0 +1,20 @@
1
+ import type { AttemptToolJsonSchema } from "@opengeni/contracts";
2
+ import { z } from "zod";
3
+ /**
4
+ * The JSON Schema an interaction tool shows the model.
5
+ *
6
+ * Model providers expand every `$ref` when they render a tool, so a tagged
7
+ * union such as a browser action, whose locator union repeats in each of its
8
+ * twenty variants, costs several thousand tokens. Each tagged union of objects
9
+ * is shown as one object instead: the tag lists every variant, each field
10
+ * appears once, and one compact line names the fields each variant takes.
11
+ * Validation-only limits are left out. The tool's own Zod schema stays the
12
+ * authority and rejects any invalid combination with the exact field.
13
+ */
14
+ export declare function interactionToolInputJsonSchema(schema: z.ZodType): AttemptToolJsonSchema;
15
+ /**
16
+ * Name exactly what is wrong with invalid tool arguments. A union failure
17
+ * reports the variant the arguments chose (the one whose tag matched), so a
18
+ * click without a locator role says `action.locator.role`, not only "invalid".
19
+ */
20
+ export declare function describeInvalidToolArguments(error: z.ZodError): string;
@@ -1,9 +1,9 @@
1
1
  import "./chunk-4A4XTKKX.js";
2
- import "./chunk-NWS4HPB7.js";
3
- import "./chunk-HJSIPTFA.js";
2
+ import "./chunk-MIAL5I4O.js";
3
+ import "./chunk-4XDJ4TJA.js";
4
4
  import {
5
5
  Manifest
6
- } from "./chunk-7LJ7KDPI.js";
6
+ } from "./chunk-ERD4ICVB.js";
7
7
  import "./chunk-PLDDJCW6.js";
8
8
 
9
9
  // src/lazy-manifest.ts
@@ -43,4 +43,4 @@ async function recordLazyMaterializedDirectories(session, target) {
43
43
  export {
44
44
  recordLazyMaterializedDirectories
45
45
  };
46
- //# sourceMappingURL=lazy-manifest-AJ6XPJ4F.js.map
46
+ //# sourceMappingURL=lazy-manifest-BLZ3UZLX.js.map
@@ -3,11 +3,11 @@ import {
3
3
  applyLocalSourceManifestToState,
4
4
  materializeLocalSourceManifest,
5
5
  materializeLocalSourceManifestEntry
6
- } from "./chunk-YG26XE7B.js";
7
- import "./chunk-NWS4HPB7.js";
8
- import "./chunk-HJSIPTFA.js";
9
- import "./chunk-KCPW4K7L.js";
10
- import "./chunk-7LJ7KDPI.js";
6
+ } from "./chunk-JYDG2A7H.js";
7
+ import "./chunk-MIAL5I4O.js";
8
+ import "./chunk-4XDJ4TJA.js";
9
+ import "./chunk-PZQUUBEB.js";
10
+ import "./chunk-ERD4ICVB.js";
11
11
  import "./chunk-PLDDJCW6.js";
12
12
  export {
13
13
  applyLocalSourceManifestEntryToState,
@@ -15,4 +15,4 @@ export {
15
15
  materializeLocalSourceManifest,
16
16
  materializeLocalSourceManifestEntry
17
17
  };
18
- //# sourceMappingURL=localSources-SSIEH5F5.js.map
18
+ //# sourceMappingURL=localSources-I6SIQ6CX.js.map
@@ -4,10 +4,10 @@ import {
4
4
  SingleModelCallUnsupportedError,
5
5
  normalizeModelCallUsage,
6
6
  runSingleModelCall
7
- } from "./chunk-7OUG7WBV.js";
7
+ } from "./chunk-N5EB52EH.js";
8
8
  import "./chunk-5ULGMFKR.js";
9
- import "./chunk-KCPW4K7L.js";
10
- import "./chunk-7LJ7KDPI.js";
9
+ import "./chunk-PZQUUBEB.js";
10
+ import "./chunk-ERD4ICVB.js";
11
11
  import "./chunk-LJNCGUMB.js";
12
12
  import "./chunk-PLDDJCW6.js";
13
13
  export {
@@ -213,7 +213,7 @@ import {
213
213
  withRunCredentialsSession,
214
214
  withoutSandboxProviderIdentity,
215
215
  workspaceArchiveDownloadTemporaryDirectory
216
- } from "../chunk-EK7IW2FR.js";
216
+ } from "../chunk-ZUHGY36R.js";
217
217
  import "../chunk-5ULGMFKR.js";
218
218
  import {
219
219
  CODE_SEARCH_RG_MAX_BYTES,
@@ -311,13 +311,13 @@ import {
311
311
  validateCodeSearchRipgrepArgs,
312
312
  withModalCommandStartSignal,
313
313
  withRoutingMutationOutputRejectionFence
314
- } from "../chunk-5WJOPANS.js";
314
+ } from "../chunk-Y5THZH5N.js";
315
315
  import "../chunk-4A4XTKKX.js";
316
- import "../chunk-YG26XE7B.js";
317
- import "../chunk-NWS4HPB7.js";
318
- import "../chunk-HJSIPTFA.js";
319
- import "../chunk-KCPW4K7L.js";
320
- import "../chunk-7LJ7KDPI.js";
316
+ import "../chunk-JYDG2A7H.js";
317
+ import "../chunk-MIAL5I4O.js";
318
+ import "../chunk-4XDJ4TJA.js";
319
+ import "../chunk-PZQUUBEB.js";
320
+ import "../chunk-ERD4ICVB.js";
321
321
  import "../chunk-PLDDJCW6.js";
322
322
  export {
323
323
  ActiveBackendUnresolvableError,
@@ -8,15 +8,15 @@ import {
8
8
  SlackRestMcpServer,
9
9
  isOfficialSlackMcpConfig,
10
10
  slackRestToolIsMutation
11
- } from "./chunk-RSHQSLEJ.js";
12
- import "./chunk-Z5U6WE22.js";
13
- import "./chunk-5WJOPANS.js";
11
+ } from "./chunk-KIL4FGX5.js";
12
+ import "./chunk-PRZPGRIK.js";
13
+ import "./chunk-Y5THZH5N.js";
14
14
  import "./chunk-4A4XTKKX.js";
15
- import "./chunk-YG26XE7B.js";
16
- import "./chunk-NWS4HPB7.js";
17
- import "./chunk-HJSIPTFA.js";
18
- import "./chunk-KCPW4K7L.js";
19
- import "./chunk-7LJ7KDPI.js";
15
+ import "./chunk-JYDG2A7H.js";
16
+ import "./chunk-MIAL5I4O.js";
17
+ import "./chunk-4XDJ4TJA.js";
18
+ import "./chunk-PZQUUBEB.js";
19
+ import "./chunk-ERD4ICVB.js";
20
20
  import "./chunk-LJNCGUMB.js";
21
21
  import "./chunk-PLDDJCW6.js";
22
22
  export {
@@ -3,21 +3,21 @@ import {
3
3
  prepareAgentTools,
4
4
  secretArgumentMode,
5
5
  sessionMcpApprovalConnectionId
6
- } from "./chunk-XRX57ZQO.js";
7
- import "./chunk-EK7IW2FR.js";
6
+ } from "./chunk-XJARX6VV.js";
7
+ import "./chunk-ZUHGY36R.js";
8
8
  import "./chunk-4KFT2G3W.js";
9
- import "./chunk-7OUG7WBV.js";
9
+ import "./chunk-N5EB52EH.js";
10
10
  import "./chunk-5ULGMFKR.js";
11
- import "./chunk-XQ23VCZ4.js";
12
- import "./chunk-RSHQSLEJ.js";
13
- import "./chunk-Z5U6WE22.js";
14
- import "./chunk-5WJOPANS.js";
11
+ import "./chunk-6FQ6KEII.js";
12
+ import "./chunk-KIL4FGX5.js";
13
+ import "./chunk-PRZPGRIK.js";
14
+ import "./chunk-Y5THZH5N.js";
15
15
  import "./chunk-4A4XTKKX.js";
16
- import "./chunk-YG26XE7B.js";
17
- import "./chunk-NWS4HPB7.js";
18
- import "./chunk-HJSIPTFA.js";
19
- import "./chunk-KCPW4K7L.js";
20
- import "./chunk-7LJ7KDPI.js";
16
+ import "./chunk-JYDG2A7H.js";
17
+ import "./chunk-MIAL5I4O.js";
18
+ import "./chunk-4XDJ4TJA.js";
19
+ import "./chunk-PZQUUBEB.js";
20
+ import "./chunk-ERD4ICVB.js";
21
21
  import "./chunk-LJNCGUMB.js";
22
22
  import "./chunk-PLDDJCW6.js";
23
23
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/runtime",
3
- "version": "3.3.0",
3
+ "version": "3.3.1-canary.38922642121001",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -75,19 +75,19 @@
75
75
  "@openai/agents": "0.14.3",
76
76
  "@openai/agents-core": "0.14.3",
77
77
  "@openai/agents-extensions": "0.14.3",
78
- "@opengeni/agent-proto": "3.3.0",
79
- "@opengeni/capabilities": "3.3.0",
80
- "@opengeni/codemode": "3.3.0",
81
- "@opengeni/codex": "3.3.0",
82
- "@opengeni/config": "3.3.0",
83
- "@opengeni/contracts": "3.3.0",
84
- "@opengeni/interaction": "3.3.0",
85
- "@opengeni/network": "3.3.0",
86
- "@opengeni/observability": "3.3.0",
87
- "@opengeni/sdk": "3.3.0",
88
- "@opengeni/tool-gateway": "3.3.0",
89
- "@opengeni/vaults": "3.3.0",
90
- "@opengeni/xai-subscription": "3.3.0",
78
+ "@opengeni/agent-proto": "3.3.1-canary.38922642121001",
79
+ "@opengeni/capabilities": "3.3.1-canary.38922642121001",
80
+ "@opengeni/codemode": "3.3.1-canary.38922642121001",
81
+ "@opengeni/codex": "3.3.1-canary.38922642121001",
82
+ "@opengeni/config": "3.3.1-canary.38922642121001",
83
+ "@opengeni/contracts": "3.3.1-canary.38922642121001",
84
+ "@opengeni/interaction": "3.3.1-canary.38922642121001",
85
+ "@opengeni/network": "3.3.1-canary.38922642121001",
86
+ "@opengeni/observability": "3.3.1-canary.38922642121001",
87
+ "@opengeni/sdk": "3.3.1-canary.38922642121001",
88
+ "@opengeni/tool-gateway": "3.3.1-canary.38922642121001",
89
+ "@opengeni/vaults": "3.3.1-canary.38922642121001",
90
+ "@opengeni/xai-subscription": "3.3.1-canary.38922642121001",
91
91
  "debug": "4.4.3",
92
92
  "modal": "0.9.0",
93
93
  "openai": "6.47.0",
package/src/index.ts CHANGED
@@ -117,6 +117,7 @@ import { createSecretArgumentResolver } from "./secret-argument-resolution";
117
117
  import {
118
118
  approvalIdentifier,
119
119
  INTERACTION_REQUEST_HUMAN_MODEL_TOOL_NAME,
120
+ RequestHumanInteractionToolInput,
120
121
  CAPABILITY_DESCRIPTORS,
121
122
  DEFAULT_FIRST_PARTY_MCP_PERMISSIONS,
122
123
  DEFAULT_FIRST_PARTY_MCP_TOOLS,
@@ -303,6 +304,7 @@ import {
303
304
  applyDiff,
304
305
  RunContext,
305
306
  ToolGuardrailFunctionOutputFactory,
307
+ defineToolInputGuardrail,
306
308
  type AgentInputItem,
307
309
  type CallModelInputFilter,
308
310
  type MCPServer,
@@ -3881,6 +3883,23 @@ function activeModelToolInvocation(modelName: string): ModelToolInvocation | nul
3881
3883
  return invocation?.modelName === modelName ? invocation : null;
3882
3884
  }
3883
3885
 
3886
+ /** Why interaction_request_human arguments cannot be recorded as an
3887
+ * intervention, in words the model can act on, or null when they can. */
3888
+ export function interactionRequestArgumentsProblem(serialized: string): string | null {
3889
+ let value: unknown;
3890
+ try {
3891
+ value = JSON.parse(serialized);
3892
+ } catch {
3893
+ return "Invalid interaction_request_human arguments: they are not valid JSON. Nothing was requested; call it again with a JSON object matching its schema.";
3894
+ }
3895
+ const parsed = RequestHumanInteractionToolInput.safeParse(value);
3896
+ if (parsed.success) return null;
3897
+ const issues = parsed.error.issues
3898
+ .slice(0, 5)
3899
+ .map((issue) => `${issue.path.join(".") || "arguments"}: ${issue.message}`);
3900
+ return `Invalid interaction_request_human arguments: ${issues.join("; ")}. Nothing was requested; call it again with corrected arguments.`;
3901
+ }
3902
+
3884
3903
  /**
3885
3904
  * Turn the canonical interaction-request tool into a typed SDK interruption.
3886
3905
  * Its MCP/Codemode catalog entry and execution stay unchanged; this projection
@@ -3903,6 +3922,22 @@ function installInteractionInterventionPolicy(
3903
3922
  const originalInvoke = tool.invoke.bind(tool);
3904
3923
  return {
3905
3924
  ...tool,
3925
+ // Runs before the approval pause, so invalid arguments come back to
3926
+ // the model as a correctable tool result. Without it the call would
3927
+ // pause first, the intervention could never be recorded, and the
3928
+ // turn would fail.
3929
+ inputGuardrails: [
3930
+ ...(tool.inputGuardrails ?? []),
3931
+ defineToolInputGuardrail({
3932
+ name: "validate_interaction_request_human",
3933
+ run: async ({ toolCall }) => {
3934
+ const problem = interactionRequestArgumentsProblem(toolCall.arguments);
3935
+ return problem
3936
+ ? ToolGuardrailFunctionOutputFactory.rejectContent(problem)
3937
+ : ToolGuardrailFunctionOutputFactory.allow();
3938
+ },
3939
+ }),
3940
+ ],
3906
3941
  needsApproval: async (
3907
3942
  _runContext: Parameters<typeof originalNeedsApproval>[0],
3908
3943
  _parsedInput: Parameters<typeof originalNeedsApproval>[1],
@@ -8469,7 +8504,10 @@ export class PrefixedMcpServer implements MCPServer {
8469
8504
  return {
8470
8505
  ...tool,
8471
8506
  name,
8472
- ...(this.accountLabel
8507
+ // Name the account only when the turn has several accounts of this
8508
+ // connector to tell apart. With one account the line adds nothing
8509
+ // the model can act on, and it would repeat on every tool.
8510
+ ...(this.accountLabel?.account
8473
8511
  ? {
8474
8512
  description:
8475
8513
  `Account: ${this.accountLabel.model}. Use only this account; if the intended account for a write is unclear, ask before calling.\n${tool.description ?? ""}`.trimEnd(),