@opengeni/runtime 4.0.1 → 4.0.3

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 (43) hide show
  1. package/dist/{agent-RJQLKFIW.js → agent-ME6HT4DH.js} +2 -2
  2. package/dist/assets/codemode-client.json +1 -1
  3. package/dist/browser-action-json-schema.d.ts +4 -0
  4. package/dist/{chunk-J5AR5XAJ.js → chunk-GBVN7WSK.js} +377 -210
  5. package/dist/chunk-GBVN7WSK.js.map +1 -0
  6. package/dist/{chunk-ZG2YH25H.js → chunk-JAYHA6BF.js} +2 -2
  7. package/dist/{chunk-J6J3VYFW.js → chunk-LL2YQO5H.js} +527 -48
  8. package/dist/chunk-LL2YQO5H.js.map +1 -0
  9. package/dist/{chunk-UNICCRW5.js → chunk-LZIXCZUV.js} +6 -3
  10. package/dist/{chunk-UNICCRW5.js.map → chunk-LZIXCZUV.js.map} +1 -1
  11. package/dist/{chunk-SPT3PLMX.js → chunk-PRHMSM6C.js} +2 -2
  12. package/dist/index.js +7 -7
  13. package/dist/interaction-tools.d.ts +1 -1
  14. package/dist/{lazy-manifest-OEYEHNVY.js → lazy-manifest-GCGUFIWP.js} +3 -3
  15. package/dist/{localSources-TWHTEKGO.js → localSources-FDH65AFI.js} +4 -4
  16. package/dist/sandbox/browser-control-client.d.ts +28 -1
  17. package/dist/sandbox/index.d.ts +2 -2
  18. package/dist/sandbox/index.js +6 -6
  19. package/dist/sandbox/providers/modal-command-router-wire.d.ts +8 -0
  20. package/dist/sandbox/providers/modal.d.ts +5 -6
  21. package/dist/workspace-tool-gateway.js +5 -5
  22. package/package.json +7 -7
  23. package/src/browser-action-json-schema.ts +10 -0
  24. package/src/bundled_artifact_skills/opengeni-documents/SKILL.md +4 -1
  25. package/src/bundled_artifact_skills/opengeni-documents/references/api.md +20 -0
  26. package/src/bundled_default_skills/opengeni-client/SKILL.md +4 -1
  27. package/src/bundled_default_skills/opengeni-client/references/discovery-and-autonomy.md +31 -0
  28. package/src/bundled_default_skills/opengeni-client/references/runtime-profile-and-verification.md +32 -0
  29. package/src/index.ts +9 -0
  30. package/src/interaction-tools.ts +656 -48
  31. package/src/sandbox/browser-control-client.ts +241 -26
  32. package/src/sandbox/index.ts +3 -1
  33. package/src/sandbox/providers/modal-command-control.ts +7 -1
  34. package/src/sandbox/providers/modal-command-router-wire.ts +47 -6
  35. package/src/sandbox/providers/modal.ts +16 -24
  36. package/src/sandbox/routing/routing-session.ts +4 -2
  37. package/dist/chunk-J5AR5XAJ.js.map +0 -1
  38. package/dist/chunk-J6J3VYFW.js.map +0 -1
  39. /package/dist/{agent-RJQLKFIW.js.map → agent-ME6HT4DH.js.map} +0 -0
  40. /package/dist/{chunk-ZG2YH25H.js.map → chunk-JAYHA6BF.js.map} +0 -0
  41. /package/dist/{chunk-SPT3PLMX.js.map → chunk-PRHMSM6C.js.map} +0 -0
  42. /package/dist/{lazy-manifest-OEYEHNVY.js.map → lazy-manifest-GCGUFIWP.js.map} +0 -0
  43. /package/dist/{localSources-TWHTEKGO.js.map → localSources-FDH65AFI.js.map} +0 -0
@@ -24,7 +24,7 @@ import {
24
24
  randomUUID,
25
25
  relativePosixPathWithinRoot,
26
26
  shellQuote
27
- } from "./chunk-UNICCRW5.js";
27
+ } from "./chunk-LZIXCZUV.js";
28
28
 
29
29
  // ../../node_modules/.bun/@openai+agents-core@0.14.3+933c5e7db4cd33c2/node_modules/@openai/agents-core/dist/mcpServers.mjs
30
30
  var DEFAULT_CONNECT_TIMEOUT_MS = 1e4;
@@ -2054,4 +2054,4 @@ export {
2054
2054
  materializeLocalSourceManifest,
2055
2055
  materializeLocalSourceManifestEntry
2056
2056
  };
2057
- //# sourceMappingURL=chunk-SPT3PLMX.js.map
2057
+ //# sourceMappingURL=chunk-PRHMSM6C.js.map
package/dist/index.js CHANGED
@@ -264,7 +264,7 @@ import {
264
264
  workspaceEnvironmentInstructions,
265
265
  wrapAttemptToolDefinitions,
266
266
  wrapAttemptToolExecute
267
- } from "./chunk-J6J3VYFW.js";
267
+ } from "./chunk-LL2YQO5H.js";
268
268
  import {
269
269
  ActiveBackendUnresolvableError,
270
270
  BROWSER_CONTROL_ADMIN_TOKEN_FILE,
@@ -426,7 +426,7 @@ import {
426
426
  inspectRecordingArtifact,
427
427
  isConnectedMachineAbsolutePath,
428
428
  isExecSessionLostBanner,
429
- isModalTaskExecStartDnsResolutionError,
429
+ isModalTaskExecStartPreDispatchUnavailableError,
430
430
  isOpenSandboxLifecycleProxyPath,
431
431
  isProviderApiThrottleError,
432
432
  isProviderSandboxGoneDuringRoutedOperation,
@@ -538,10 +538,10 @@ import {
538
538
  withRunCredentialsClient,
539
539
  withRunCredentialsSession,
540
540
  withoutSandboxProviderIdentity
541
- } from "./chunk-J5AR5XAJ.js";
542
- import "./chunk-SPT3PLMX.js";
541
+ } from "./chunk-GBVN7WSK.js";
542
+ import "./chunk-PRHMSM6C.js";
543
543
  import "./chunk-4A4XTKKX.js";
544
- import "./chunk-ZG2YH25H.js";
544
+ import "./chunk-JAYHA6BF.js";
545
545
  import {
546
546
  SKILL_MAX_FILES,
547
547
  SKILL_MAX_FILE_BYTES,
@@ -566,7 +566,7 @@ import {
566
566
  } from "./chunk-YU4VRTR4.js";
567
567
  import {
568
568
  MaxTurnsExceededError
569
- } from "./chunk-UNICCRW5.js";
569
+ } from "./chunk-LZIXCZUV.js";
570
570
  import "./chunk-PZ5AY32C.js";
571
571
  export {
572
572
  ActiveBackendUnresolvableError,
@@ -898,7 +898,7 @@ export {
898
898
  isExecSessionLostBanner,
899
899
  isMcpRequestTimeoutError,
900
900
  isMcpTransportConnectivityError,
901
- isModalTaskExecStartDnsResolutionError,
901
+ isModalTaskExecStartPreDispatchUnavailableError,
902
902
  isOfficialGmailMcpConfig,
903
903
  isOpenSandboxLifecycleProxyPath,
904
904
  isProviderApiThrottleError,
@@ -3,7 +3,7 @@ import { type Settings } from "@opengeni/config";
3
3
  import type { AttemptToolDefinition, AttemptToolScope } from "@opengeni/codemode";
4
4
  import { type InteractionTransport } from "@opengeni/sdk";
5
5
  import { z } from "zod";
6
- export declare const INTERACTION_ATTEMPT_TOOL_NAMES: readonly ["interaction_discover", "browser_open", "browser_tabs", "browser_observe", "browser_act", "browser_clipboard", "browser_debug", "browser_auth", "interaction_request_human", "browser_identity", "browser_publish", "browser_lifecycle", "computer_open", "computer_targets", "computer_observe", "computer_clipboard", "computer_act", "computer_lifecycle"];
6
+ export declare const INTERACTION_ATTEMPT_TOOL_NAMES: readonly ["interaction_discover", "browser_open", "browser_tabs", "browser_observe", "browser_read", "browser_screenshot", "browser_act", "browser_clipboard", "browser_debug", "browser_auth", "interaction_request_human", "browser_identity", "browser_publish", "browser_lifecycle", "computer_open", "computer_targets", "computer_observe", "computer_clipboard", "computer_act", "computer_lifecycle"];
7
7
  export type InteractionAttemptToolName = (typeof INTERACTION_ATTEMPT_TOOL_NAMES)[number];
8
8
  export type InteractionInterventionResume = {
9
9
  toolCallId: string;
@@ -1,8 +1,8 @@
1
1
  import "./chunk-4A4XTKKX.js";
2
- import "./chunk-ZG2YH25H.js";
2
+ import "./chunk-JAYHA6BF.js";
3
3
  import {
4
4
  Manifest
5
- } from "./chunk-UNICCRW5.js";
5
+ } from "./chunk-LZIXCZUV.js";
6
6
  import "./chunk-PZ5AY32C.js";
7
7
 
8
8
  // src/lazy-manifest.ts
@@ -42,4 +42,4 @@ async function recordLazyMaterializedDirectories(session, target) {
42
42
  export {
43
43
  recordLazyMaterializedDirectories
44
44
  };
45
- //# sourceMappingURL=lazy-manifest-OEYEHNVY.js.map
45
+ //# sourceMappingURL=lazy-manifest-GCGUFIWP.js.map
@@ -3,9 +3,9 @@ import {
3
3
  applyLocalSourceManifestToState,
4
4
  materializeLocalSourceManifest,
5
5
  materializeLocalSourceManifestEntry
6
- } from "./chunk-SPT3PLMX.js";
7
- import "./chunk-ZG2YH25H.js";
8
- import "./chunk-UNICCRW5.js";
6
+ } from "./chunk-PRHMSM6C.js";
7
+ import "./chunk-JAYHA6BF.js";
8
+ import "./chunk-LZIXCZUV.js";
9
9
  import "./chunk-PZ5AY32C.js";
10
10
  export {
11
11
  applyLocalSourceManifestEntryToState,
@@ -13,4 +13,4 @@ export {
13
13
  materializeLocalSourceManifest,
14
14
  materializeLocalSourceManifestEntry
15
15
  };
16
- //# sourceMappingURL=localSources-TWHTEKGO.js.map
16
+ //# sourceMappingURL=localSources-FDH65AFI.js.map
@@ -1,4 +1,5 @@
1
- import { BROWSER_PROFILE_ARTIFACT_FORMAT, type BrowserActionCommand as BrowserActionCommandValue, type BrowserActionReceipt as BrowserActionReceiptValue, type BrowserClipboard as BrowserClipboardValue, type BrowserDiagnosticBatch as BrowserDiagnosticBatchValue, type BrowserDownload as BrowserDownloadValue, type BrowserDownloadExportReceipt as BrowserDownloadExportReceiptValue, type BrowserDownloadExportRequest as BrowserDownloadExportRequestValue, type BrowserDownloadListResponse as BrowserDownloadListResponseValue, type BrowserExternalAuthCommand as BrowserExternalAuthCommandValue, type BrowserExternalAuthResult as BrowserExternalAuthResultValue, type BrowserDiagnosticKind, type BrowserObservation as BrowserObservationValue, type BrowserProtectedAuthFillCommand as BrowserProtectedAuthFillCommandValue, type BrowserProtectedAuthFillReceipt as BrowserProtectedAuthFillReceiptValue, type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue, type BrowserTarget as BrowserTargetValue, type BrowserWorkspaceFileStageRequest as BrowserWorkspaceFileStageRequestValue, type BrowserWorkspaceFileStageResponse as BrowserWorkspaceFileStageResponseValue, type ComputerActionCommand as ComputerActionCommandValue, type ComputerActionReceipt as ComputerActionReceiptValue, type ComputerClipboard as ComputerClipboardValue, type ComputerObservation as ComputerObservationValue, type ComputerSessionCapabilities as ComputerSessionCapabilitiesValue, type ComputerTarget as ComputerTargetValue, type InteractionError as InteractionErrorValue, type NetworkRouteConsistency as NetworkRouteConsistencyValue } from "@opengeni/contracts";
1
+ import { type BrowserFrameMetadata } from "@opengeni/sdk";
2
+ import { BROWSER_PROFILE_ARTIFACT_FORMAT, type BrowserActionCommand as BrowserActionCommandValue, type BrowserActionReceipt as BrowserActionReceiptValue, type BrowserClipboard as BrowserClipboardValue, type BrowserDiagnosticBatch as BrowserDiagnosticBatchValue, type BrowserDownload as BrowserDownloadValue, type BrowserDownloadExportReceipt as BrowserDownloadExportReceiptValue, type BrowserDownloadExportRequest as BrowserDownloadExportRequestValue, type BrowserDownloadListResponse as BrowserDownloadListResponseValue, type BrowserDomReadRequest as BrowserDomReadRequestValue, type BrowserDomReadResponse as BrowserDomReadResponseValue, type BrowserExternalAuthCommand as BrowserExternalAuthCommandValue, type BrowserExternalAuthResult as BrowserExternalAuthResultValue, type BrowserDiagnosticKind, type BrowserObservation as BrowserObservationValue, type BrowserProtectedAuthFillCommand as BrowserProtectedAuthFillCommandValue, type BrowserProtectedAuthFillReceipt as BrowserProtectedAuthFillReceiptValue, type BrowserRevisionMaterialization as BrowserRevisionMaterializationValue, type BrowserTarget as BrowserTargetValue, type BrowserTargetState as BrowserTargetStateValue, type BrowserWorkspaceFileStageRequest as BrowserWorkspaceFileStageRequestValue, type BrowserWorkspaceFileStageResponse as BrowserWorkspaceFileStageResponseValue, type ComputerActionCommand as ComputerActionCommandValue, type ComputerActionReceipt as ComputerActionReceiptValue, type ComputerClipboard as ComputerClipboardValue, type ComputerObservation as ComputerObservationValue, type ComputerSessionCapabilities as ComputerSessionCapabilitiesValue, type ComputerTarget as ComputerTargetValue, type InteractionError as InteractionErrorValue, type NetworkRouteConsistency as NetworkRouteConsistencyValue } from "@opengeni/contracts";
2
3
  import type { BrowserControlEnsureRequest, BrowserControlEnsureResponse, BrowserFramesOpenRequest, ComputerFramesOpenRequest, StreamChannel } from "@opengeni/agent-proto";
3
4
  import { type EnsureBrowserControlServerResult } from "./browser-control-server.js";
4
5
  import { type ExposedPortEndpoint } from "./stream-port.js";
@@ -70,6 +71,22 @@ export type ComputerControlFrame = {
70
71
  metadataHeader: string;
71
72
  metadata: ComputerControlFrameMetadata;
72
73
  };
74
+ export type BrowserControlFrame = {
75
+ data: Uint8Array;
76
+ mediaType: "image/jpeg" | "image/png";
77
+ metadataHeader: string;
78
+ metadata: BrowserFrameMetadata;
79
+ };
80
+ export type BrowserControlScreenshotOptions = {
81
+ fullPage?: boolean;
82
+ format?: "jpeg" | "png";
83
+ quality?: number;
84
+ };
85
+ type ExpectedBrowserFrameEvidence = {
86
+ browserSessionId: string;
87
+ controllerGeneration: string;
88
+ targetId: string;
89
+ };
73
90
  export type ComputerControlFrameMetadata = {
74
91
  frameId: string;
75
92
  computerSessionId: string;
@@ -378,6 +395,13 @@ export declare class BrowserControlClient {
378
395
  expectedFrameEvidence: ExpectedComputerFrameEvidence;
379
396
  timeoutMs?: number;
380
397
  }): Promise<ComputerControlFrame>;
398
+ requestBrowserBytesForSession(input: {
399
+ method: "GET";
400
+ path: string;
401
+ token: string;
402
+ expectedFrameEvidence: ExpectedBrowserFrameEvidence;
403
+ timeoutMs?: number;
404
+ }): Promise<BrowserControlFrame>;
381
405
  private requestJson;
382
406
  private requestBytes;
383
407
  private controllerPort;
@@ -400,6 +424,9 @@ export declare class BrowserControlSessionClient {
400
424
  selectTarget(targetId: string): Promise<BrowserObservationValue>;
401
425
  closeTarget(targetId: string): Promise<BrowserTargetValue[]>;
402
426
  observe(targetId: string): Promise<BrowserObservationValue>;
427
+ targetState(targetId: string): Promise<BrowserTargetStateValue>;
428
+ readDom(targetId: string, requestInput: BrowserDomReadRequestValue): Promise<BrowserDomReadResponseValue>;
429
+ capture(targetId: string, options?: BrowserControlScreenshotOptions): Promise<BrowserControlFrame>;
403
430
  readClipboard(): Promise<BrowserClipboardValue>;
404
431
  action(command: BrowserActionCommandValue): Promise<BrowserActionReceiptValue>;
405
432
  /** API-broker-only file authority path. Signed read URLs are materialized by
@@ -18,7 +18,7 @@ export { SandboxConfigError, SandboxExactResumeInstanceUnavailableError, Sandbox
18
18
  export { PROVIDER_REGISTRY, assertProviderRegistryInvariants, buildImmutableProviderImage, isProviderApiThrottleError, prepareProviderForTeardownAfterCapture, providerSupportsImmutableImageBuild, renewSandboxProviderExpiration, providerWorkspaceCapturePolicy, type ProviderRegistration, type ProviderConstructionContext, type ProviderExactResumeMode, type ProviderImmutableImageBuildInput, type ProviderImmutableImageBuildResult, type ProviderExpirationRenewalInput, type ProviderWorkspaceCapturePolicy, type ProviderWorkspaceCaptureTakeover, } from "./providers/index.js";
19
19
  export { classifyProviderSandboxFailure, isProviderSandboxGoneDuringRoutedOperation, isProviderSandboxNotFoundError, isProviderSandboxTransientError, type ProviderSandboxFailure, type ProviderSandboxFailureKind, } from "./provider-errors.js";
20
20
  export { WORKSPACE_ARCHIVE_DESCRIPTOR_VERSION, WorkspaceArchiveIntegrityError, captureVerifiedWorkspaceArchive, decodeNativeSnapshotRef, encodeNativeSnapshotRef, describeLegacyNativeSnapshotArchive, describeNativeSnapshotArchive, fingerprintSandboxWorkspace, inlineWorkspaceArchiveForRestore, parseWorkspaceArchiveDescriptor, readVerifiedWorkspaceArchive, verifyRestoredWorkspace, type NativeSnapshotDescriptor, type NativeSnapshotProvider, type NativeSnapshotRef, type TarWorkspaceArchiveDescriptor, type VerifiedWorkspaceArchive, type WorkspaceArchiveDescriptor, type WorkspaceArchiveIntegrityCode, type WorkspaceTreeFingerprint, } from "./workspace-archive.js";
21
- export { ensureModalRegistryImage, deleteModalCheckpointSnapshot, inspectModalSandboxLifecycle, isModalTaskExecStartDnsResolutionError, modalSessionMatchesCheckpointProviderBinding, modalSandboxAttributionEnvironment, modalSandboxAttributionTags, resolveModalCheckpointProviderBinding, resolveModalCheckpointProviderBindingForLiveSandbox, resolveModalCheckpointProviderBindingForSession, sweepModalOrphanSandboxes, tagModalSandbox, terminateModalSandboxById, type LiveModalSandboxLeaseAttribution, type ModalModuleLoader, type ModalCheckpointProviderBinding, type ModalOrphanSweepResult, type ModalOrphanSweepTermination, type ModalSandboxAttribution, type RevalidateModalOrphanTermination, } from "./providers/modal.js";
21
+ export { ensureModalRegistryImage, deleteModalCheckpointSnapshot, inspectModalSandboxLifecycle, isModalTaskExecStartPreDispatchUnavailableError, modalSessionMatchesCheckpointProviderBinding, modalSandboxAttributionEnvironment, modalSandboxAttributionTags, resolveModalCheckpointProviderBinding, resolveModalCheckpointProviderBindingForLiveSandbox, resolveModalCheckpointProviderBindingForSession, sweepModalOrphanSandboxes, tagModalSandbox, terminateModalSandboxById, type LiveModalSandboxLeaseAttribution, type ModalModuleLoader, type ModalCheckpointProviderBinding, type ModalOrphanSweepResult, type ModalOrphanSweepTermination, type ModalSandboxAttribution, type RevalidateModalOrphanTermination, } from "./providers/modal.js";
22
22
  export { OpenSandboxClient, OpenSandboxSession, setOpenSandboxApplyDiff, type OpenSandboxApplyDiff, type OpenSandboxClientOptions, type OpenSandboxEditor, type OpenSandboxSessionState, } from "./providers/opensandbox-adapter.js";
23
23
  export { selectBackend, sdkBackendIdForSandboxBackend, sandboxBackendForSdkBackendId, backendSupportsOs, desktopCapableBackend, negotiateCapabilities, type NegotiationContext, } from "./select.js";
24
24
  export { STREAM_TOKEN_DEFAULT_TTL_SECONDS, mintStreamToken, verifyStreamToken, StreamTokenPayload, type MintStreamTokenInput, type StreamTokenPayloadType, } from "./stream-token.js";
@@ -28,7 +28,7 @@ export { createTurnToolCancellationController, TurnSandboxCommandCancelledError,
28
28
  export type { TurnSandboxCommandArgs, TurnSandboxCommandSession, TurnToolCancellationController, TurnToolCancellationFence, } from "./turn-tool-cancellation.js";
29
29
  export { TERMINAL_STREAM_PORT, TERMINAL_SERVER_TIMEOUT_MS, TerminalServerError, TerminalServerUnsupportedError, buildTerminalServerScript, ensureTerminalServer, tearDownTerminalServer, type EnsureTerminalServerOptions, type EnsureTerminalServerResult, } from "./terminal-server.js";
30
30
  export { BROWSER_CONTROL_PORT, BROWSER_CONTROL_SERVER_TIMEOUT_MS, BrowserControlServerError, BrowserControlServerUnsupportedError, buildBrowserControlServerScript, ensureBrowserControlServer, tearDownBrowserControlServer, type EnsureBrowserControlServerOptions, type EnsureBrowserControlServerResult, } from "./browser-control-server.js";
31
- export { BROWSER_CONTROL_ADMIN_TOKEN_FILE, BrowserControlClient, BrowserControlProtocolError, BrowserControlRequestError, BrowserControlSessionClient, BrowserControlTransportError, BrowserControlUnsupportedError, ComputerFrameEvidenceMismatchError, decodeComputerControlFrameMetadataHeader, provisionBrowserControlClient, validateComputerControlFrameEvidence, type BrowserControlPlacementSession, type BrowserStateDownloadGrant, type BrowserStateUploadGrant, type BrowserViewGrant, type CapturePlacementBrowserStateInput, type CreatePlacementBrowserSessionInput, type PlacementBrowserSession, type PlacementBrowserSessionReference, type PlacementBrowserNetworkRoute, type PlacementBrowserTransport, type PlacementBrowserStateCaptureReceipt, type ComputerControlFrame, type ComputerControlFrameMetadata, type ComputerFrameEvidenceMismatchReason, type ExpectedComputerFrameEvidence, type ProvisionBrowserControlClientInput, type ProvisionBrowserControlClientResult, type RestorePlacementBrowserStateInput, } from "./browser-control-client.js";
31
+ export { BROWSER_CONTROL_ADMIN_TOKEN_FILE, BrowserControlClient, BrowserControlProtocolError, BrowserControlRequestError, BrowserControlSessionClient, BrowserControlTransportError, BrowserControlUnsupportedError, ComputerFrameEvidenceMismatchError, decodeComputerControlFrameMetadataHeader, provisionBrowserControlClient, validateComputerControlFrameEvidence, type BrowserControlPlacementSession, type BrowserControlScreenshotOptions, type BrowserControlFrame, type BrowserStateDownloadGrant, type BrowserStateUploadGrant, type BrowserViewGrant, type CapturePlacementBrowserStateInput, type CreatePlacementBrowserSessionInput, type PlacementBrowserSession, type PlacementBrowserSessionReference, type PlacementBrowserNetworkRoute, type PlacementBrowserTransport, type PlacementBrowserStateCaptureReceipt, type ComputerControlFrame, type ComputerControlFrameMetadata, type ComputerFrameEvidenceMismatchReason, type ExpectedComputerFrameEvidence, type ProvisionBrowserControlClientInput, type ProvisionBrowserControlClientResult, type RestorePlacementBrowserStateInput, } from "./browser-control-client.js";
32
32
  export { RunCredentialValidationError, normalizeRunCredentialsResolution, runCredentialRoot, runCredentialPointerFile, materializeRunCredentials, clearRunCredentials, clearRunCredentialsForAttempt, withRunCredentialEnvironment, withRunCredentialsSession, withRunCredentialsClient, type RunCredentialExpectedScope, type NormalizedRunCredentialMaterial, type RunCredentialCommandSession, type RunCredentialCommandRunner, type RunCredentialSessionReady, type MaterializeRunCredentialsOptions, } from "./run-credentials.js";
33
33
  export { CodemodeTokenPathError, codemodeTokenFileForSession, codemodeTokenFileFromEnvironment, withCodemodeTokenEnvironment, withCodemodeTokenSession, withCodemodeTokenClient, } from "./codemode-token.js";
34
34
  export { CODEMODE_TOKEN_TTL_SECONDS, mintSandboxCodemodeToken, type CodemodeAuthorityScope, type SandboxCodemodeAuthority, type MintedSandboxCodemodeToken, } from "./codemode-authority.js";
@@ -158,7 +158,7 @@ import {
158
158
  inspectRecordingArtifact,
159
159
  isConnectedMachineAbsolutePath,
160
160
  isExecSessionLostBanner,
161
- isModalTaskExecStartDnsResolutionError,
161
+ isModalTaskExecStartPreDispatchUnavailableError,
162
162
  isOpenSandboxLifecycleProxyPath,
163
163
  isProviderApiThrottleError,
164
164
  isProviderSandboxGoneDuringRoutedOperation,
@@ -269,11 +269,11 @@ import {
269
269
  withRunCredentialsClient,
270
270
  withRunCredentialsSession,
271
271
  withoutSandboxProviderIdentity
272
- } from "../chunk-J5AR5XAJ.js";
273
- import "../chunk-SPT3PLMX.js";
272
+ } from "../chunk-GBVN7WSK.js";
273
+ import "../chunk-PRHMSM6C.js";
274
274
  import "../chunk-4A4XTKKX.js";
275
- import "../chunk-ZG2YH25H.js";
276
- import "../chunk-UNICCRW5.js";
275
+ import "../chunk-JAYHA6BF.js";
276
+ import "../chunk-LZIXCZUV.js";
277
277
  import "../chunk-PZ5AY32C.js";
278
278
  export {
279
279
  ActiveBackendUnresolvableError,
@@ -435,7 +435,7 @@ export {
435
435
  inspectRecordingArtifact,
436
436
  isConnectedMachineAbsolutePath,
437
437
  isExecSessionLostBanner,
438
- isModalTaskExecStartDnsResolutionError,
438
+ isModalTaskExecStartPreDispatchUnavailableError,
439
439
  isOpenSandboxLifecycleProxyPath,
440
440
  isProviderApiThrottleError,
441
441
  isProviderSandboxGoneDuringRoutedOperation,
@@ -1,3 +1,4 @@
1
+ import { Client } from "@grpc/grpc-js";
1
2
  import protobuf from "protobufjs";
2
3
  import { ProviderCommandStartRejectedError } from "../provider-command-session.js";
3
4
  export declare const modalRouterWire: protobuf.Root;
@@ -7,6 +8,13 @@ export declare class ModalCommandStartRejectedError extends ProviderCommandStart
7
8
  readonly code: number;
8
9
  constructor(code: number, cause: unknown);
9
10
  }
11
+ /** Only a local channel-readiness failure BEFORE TaskExecStart is issued can
12
+ * prove that start was never dispatched. RPC status/details, even if they look
13
+ * like a DNS resolver error, can originate from an accepting server. */
14
+ export declare class ModalCommandStartPreDispatchUnavailableError extends Error {
15
+ private constructor();
16
+ static ensureReady(client: Client, signal?: AbortSignal): Promise<void>;
17
+ }
10
18
  export type ModalRouterIdentity = {
11
19
  taskId: string;
12
20
  execId: string;
@@ -27,13 +27,12 @@ export type RevalidateModalOrphanTermination = (candidate: ModalOrphanSweepTermi
27
27
  export declare function modalSandboxAttributionEnvironment(input: ModalSandboxAttribution): Record<string, string>;
28
28
  export declare function modalSandboxAttributionTags(input: ModalSandboxAttribution): Record<string, string>;
29
29
  /**
30
- * Modal exhausted its own retries before failing to resolve the exact command
31
- * router DNS name, so TaskExecStart never connected and replay is safe. Keep
32
- * this fail-closed across Agents SDK wrappers: every reachable structural leaf
33
- * must be that exact ClientError with no HTTP status metadata, and any incomplete
34
- * or mixed graph is rejected.
30
+ * Only the native client's pre-dispatch readiness gate proves Start was not
31
+ * sent. Server-controlled gRPC/SDK status and DNS-looking details prove nothing.
32
+ * Any retained or outcome-unknown routing boundary vetoes recovery even when
33
+ * it contains a genuine pre-dispatch error among its causes.
35
34
  */
36
- export declare function isModalTaskExecStartDnsResolutionError(error: unknown): boolean;
35
+ export declare function isModalTaskExecStartPreDispatchUnavailableError(error: unknown): boolean;
37
36
  /**
38
37
  * Modal proves that the exact exec has already terminated with a typed
39
38
  * FAILED_PRECONDITION from its stdin-write RPC. Keep this deliberately
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  prepareAgentTools
3
- } from "./chunk-J6J3VYFW.js";
4
- import "./chunk-J5AR5XAJ.js";
5
- import "./chunk-SPT3PLMX.js";
3
+ } from "./chunk-LL2YQO5H.js";
4
+ import "./chunk-GBVN7WSK.js";
5
+ import "./chunk-PRHMSM6C.js";
6
6
  import "./chunk-4A4XTKKX.js";
7
- import "./chunk-ZG2YH25H.js";
7
+ import "./chunk-JAYHA6BF.js";
8
8
  import "./chunk-TE27J65Q.js";
9
9
  import "./chunk-UZ66CGC2.js";
10
10
  import "./chunk-YU4VRTR4.js";
11
- import "./chunk-UNICCRW5.js";
11
+ import "./chunk-LZIXCZUV.js";
12
12
  import "./chunk-PZ5AY32C.js";
13
13
  export {
14
14
  prepareAgentTools as prepareWorkspaceToolGatewayTools
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/runtime",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,13 +65,13 @@
65
65
  "@openai/agents-extensions": "0.14.3",
66
66
  "@opengeni/agent-proto": "^0.6.0",
67
67
  "@opengeni/capabilities": "^0.3.4",
68
- "@opengeni/codemode": "^0.6.1",
69
- "@opengeni/codex": "^0.2.25",
70
- "@opengeni/config": "^2.1.0",
71
- "@opengeni/contracts": "^5.1.0",
68
+ "@opengeni/codemode": "^0.6.2",
69
+ "@opengeni/codex": "^0.2.26",
70
+ "@opengeni/config": "^2.1.1",
71
+ "@opengeni/contracts": "^5.1.1",
72
72
  "@opengeni/network": "^0.3.1",
73
- "@opengeni/sdk": "^7.1.0",
74
- "@opengeni/tool-gateway": "^0.1.12",
73
+ "@opengeni/sdk": "^7.1.1",
74
+ "@opengeni/tool-gateway": "^0.1.13",
75
75
  "@opengeni/xai-subscription": "^0.1.4",
76
76
  "debug": "4.4.3",
77
77
  "modal": "0.9.0",
@@ -0,0 +1,10 @@
1
+ import type { AttemptToolJsonSchema } from "@opengeni/contracts";
2
+ import { z } from "zod";
3
+
4
+ /** Keep repeated browser action and locator variants once in the model schema. */
5
+ export function browserActionInputJsonSchema(schema: z.ZodType): AttemptToolJsonSchema {
6
+ return z.toJSONSchema(schema, {
7
+ target: "draft-2020-12",
8
+ reused: "ref",
9
+ }) as AttemptToolJsonSchema;
10
+ }
@@ -44,7 +44,10 @@ Skill was installed or explicitly checked out to the filesystem.
44
44
  2. Make the smallest coherent edit. One `opengeni__editable_artifact_apply`
45
45
  call is one atomic command batch. Use stable ids from inspection for existing
46
46
  objects and `openGeni.artifacts.ids.document(...)` for new objects in
47
- CodeMode. A direct call must pass the inspected `headSequence` and
47
+ CodeMode. On a Connected Machine without the JS client, use the offline native
48
+ `codemode document-id <kind> <namespace>` helper described in `references/api.md`;
49
+ copy the exact namespace from the inspected summary, never invent it.
50
+ A direct call must pass the inspected `headSequence` and
48
51
  `stateHash`; CodeMode carries its last read head automatically.
49
52
  3. For one simple edit, call the artifact tools directly. For loops, several
50
53
  inspections, generated ids, or a multi-part batch, write auditable Bun code
@@ -37,6 +37,26 @@ artifactId: document.id, inspectionReceiptId }]` with the completion evidence to
37
37
  If the document changes, inspect it again and use the new receipt. Include the
38
38
  returned artifact reference in the user handoff.
39
39
 
40
+ ## Native Connected Machine ID helper
41
+
42
+ When the JavaScript client is unavailable, the native client can generate IDs
43
+ offline. Inspect the document summary with the artifact tools first. Copy its
44
+ exact decimal `idNamespace` string into `DOCUMENT_NAMESPACE`, then run:
45
+
46
+ ```sh
47
+ "$OPENGENI_CODEMODE_NATIVE_CLIENT" codemode document-id paragraph "$DOCUMENT_NAMESPACE"
48
+ ```
49
+
50
+ The result is JSON with an `id` field. Kinds are `paragraph`, `table`, `page-break`,
51
+ `section`, `header`, `footer`, `comment`, and `tracked-change`. The helper uses the
52
+ same ID format as `openGeni.artifacts.ids.document`; it needs no credentials or
53
+ network and does not mutate an artifact. Keep uint64 namespaces as decimal strings,
54
+ not JavaScript numbers. Direct apply calls still require the inspected
55
+ `headSequence` and `stateHash`. Reuse inspected IDs for existing objects.
56
+ If the installed native client lacks `document-id`, use the deployment-selected
57
+ JavaScript helper when available; otherwise report the missing client capability
58
+ rather than inventing IDs or claiming an edit succeeded.
59
+
40
60
  ## Authoring example
41
61
 
42
62
  ```js
@@ -55,7 +55,10 @@ Embedded products may narrow bundled guidance with `bundledSkillIds`.
55
55
  missing access is configured. Read
56
56
  [Discovery and autonomy](references/discovery-and-autonomy.md) for that workflow.
57
57
  - Ask only for consequential product choices or external authority that cannot
58
- be inferred. Do not ask the customer to restate facts the system proves.
58
+ be inferred. Offer a recommended setup and use the existing structured question
59
+ UI, when available, for the few unresolved choices about chat sharing, learning
60
+ across chats, or data access. Skip choices already settled; do not impose an
61
+ onboarding questionnaire. See [Discovery and autonomy](references/discovery-and-autonomy.md).
59
62
  - Use a reversible, clearly stated default when an unresolved choice is
60
63
  low-risk. Resolve privacy, tenant authority, data writes, cost exposure, and
61
64
  ambiguous external mutations before crossing those boundaries.
@@ -52,6 +52,37 @@ Group tightly related unresolved decisions when that makes them easier to answer
52
52
 
53
53
  For a missing privacy answer, default provisionally to the smaller sharing boundary and explain the operational cost. Do not silently weaken isolation to reduce workspace count.
54
54
 
55
+ ### Keep product choices lightweight
56
+
57
+ When meaningful choices remain, group them into one short question interaction
58
+ using the host's existing structured human-input UI when available, or a concise
59
+ chat question otherwise. Recommend the setup that fits the product and let the
60
+ user accept it or adjust individual choices. Do not build a new questionnaire or
61
+ ask every integration the same questions. A suggested answer is not consent to
62
+ send data, share private content, or perform an external action.
63
+
64
+ Use product language for the relevant unresolved choices:
65
+
66
+ - **Learning across chats:** no new lasting learning, remember for each person,
67
+ or shared team knowledge. Explain briefly that chat history/retention is separate
68
+ and disabling learning does not delete history or existing authorized Knowledge.
69
+ - **Who can open chats:** only their owner, the team, or a choice on each chat.
70
+ Keep human visibility separate from agent access and Knowledge scope. Choose the
71
+ workspace mapping from the actual sharing boundary; private chats alone do not
72
+ require a workspace per person.
73
+ - **How the agent gets data:** current-page snapshots, read-only tools to fetch
74
+ more reports, or controlled queries for deeper analysis. State the meaningful
75
+ limitation of the recommendation. Confirm broader access or writes separately
76
+ only when they are part of the requested product.
77
+
78
+ For example, if all three choices are unresolved for a simple dashboard, propose
79
+ “Private chats, no learning between chats, and current-page data only” with a short
80
+ explanation that the agent cannot fetch another report on its own. Do not reuse
81
+ that default for a team assistant whose requirements already imply shared work.
82
+ Continue independent discovery while awaiting an answer; ask again only when new
83
+ information introduces a material decision. Summarize any provisional choices in
84
+ the handoff so they do not become invisible product decisions.
85
+
55
86
  ## Follow the wanted autonomy
56
87
 
57
88
  Infer the delivery mode from explicit user language first, then repository guidance and established team workflow:
@@ -154,4 +154,36 @@ silently linking identities or widening membership. Complete discoverable setup
154
154
  before handoff; identify operator-only blockers separately and do not depend on
155
155
  internal source, cluster access, prior chat memory, or undocumented local helpers.
156
156
 
157
+ ### Make the next step easy
158
+
159
+ Keep the user-facing handoff short: what works, what was verified, and the next
160
+ action needed to make it usable. Put detailed commands and configuration in the
161
+ repository setup guide and link it. When setup is blocked, show a compact checklist
162
+ in the conversation using existing text/link UI; no new setup-card renderer is
163
+ required.
164
+
165
+ For missing OpenGeni credentials, point to the selected deployment's Organization
166
+ settings: the overview shows **Organization ID** with a copy control, and
167
+ **Developer** contains **Create Organization API Key** plus another ID copy
168
+ control. Prefer a verified settings link or returned setup action over an invented
169
+ URL. Verify older/self-hosted UI availability before promising these controls.
170
+ Explain the key type and required access for the implemented calls: workspace
171
+ provisioning and chat writes need a write-capable organization key, not a read-only
172
+ key. State its actual scope without inventing granular permission switches.
173
+
174
+ Name the exact server configuration variables and secret-store destination. Fill
175
+ verified non-secret IDs yourself when authorized and unambiguous. Give a secure
176
+ interactive command or secret-manager action for the key; never ask the user to
177
+ paste a secret into chat or put it in a browser variable. Follow with the actual
178
+ deployment command/target and a first-question smoke test, including model/billing
179
+ readiness when unverified. Complete authorized steps yourself; clearly identify
180
+ any remaining owner login, secret entry, or deployment approval.
181
+
182
+ Resolve ordinary missing tools using the project's supported installation or
183
+ package-runner path where possible. Investigate dependency warnings enough to
184
+ state their effect and available fix. Surface only material unresolved risks or
185
+ user actions in plain language; keep routine audit counts and logs in the setup
186
+ or verification notes. Do not claim a warning is harmless without evidence, or
187
+ make unrelated upgrades merely to silence the report.
188
+
157
189
  If a durable customer integration Skill would reduce future rediscovery, generate one beside the integration code containing only stable, non-secret project facts and smoke probes. Do not turn the generic implementation Skill into the customer's analytics prompt, and do not make generated runtime behavior depend on the implementation workspace retaining this implementation Skill.
package/src/index.ts CHANGED
@@ -262,6 +262,7 @@ import {
262
262
  } from "./context-compaction";
263
263
  import {
264
264
  createSandboxClient,
265
+ isModalTaskExecStartPreDispatchUnavailableError,
265
266
  isRoutingMutationOutcomeUnknownError,
266
267
  repairSerializedRunStateExposedPorts,
267
268
  restoredSandboxSessionStateFromEntry,
@@ -3630,6 +3631,14 @@ function buildAgentCapabilitiesFromComposition(
3630
3631
  const caps: ReturnType<typeof Capabilities.default> = [
3631
3632
  filesystemCapability,
3632
3633
  shell({
3634
+ // The SDK normally renders every shell error into model-facing text.
3635
+ // Preserve that behavior except for client-side, pre-dispatch Modal
3636
+ // readiness proof, which reaches bounded same-turn recovery.
3637
+ execCommandErrorFunction: (_context, error) => {
3638
+ if (isModalTaskExecStartPreDispatchUnavailableError(error)) throw error;
3639
+ const details = error instanceof Error ? error.toString() : String(error);
3640
+ return `An error occurred while running the tool. Please try again. Error: ${details}`;
3641
+ },
3633
3642
  ...(toolCancellation ? {} : { configureTools: withExecOpCorrelation }),
3634
3643
  }),
3635
3644
  ];