@opengeni/runtime 3.0.1 → 4.0.0

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 (99) hide show
  1. package/dist/assets/codemode-client.json +1 -0
  2. package/dist/chunk-4A4XTKKX.js +1 -0
  3. package/dist/{chunk-RIJ6DCYS.js → chunk-5HJEVOMJ.js} +9817 -9494
  4. package/dist/chunk-5HJEVOMJ.js.map +1 -0
  5. package/dist/{chunk-FHGLYLBL.js → chunk-SPT3PLMX.js} +1 -87
  6. package/dist/chunk-SPT3PLMX.js.map +1 -0
  7. package/dist/{chunk-GB763TSV.js → chunk-TE27J65Q.js} +1 -1
  8. package/dist/chunk-TE27J65Q.js.map +1 -0
  9. package/dist/{chunk-46BFUGFL.js → chunk-WIHICNWS.js} +1660 -388
  10. package/dist/chunk-WIHICNWS.js.map +1 -0
  11. package/dist/{chunk-UU6EJR52.js → chunk-YU4VRTR4.js} +2 -2
  12. package/dist/chunk-YU4VRTR4.js.map +1 -0
  13. package/dist/chunk-ZG2YH25H.js +94 -0
  14. package/dist/chunk-ZG2YH25H.js.map +1 -0
  15. package/dist/codex-tool-search.d.ts +5 -4
  16. package/dist/context-compaction.d.ts +19 -0
  17. package/dist/gmail-rest-mcp.js +1 -1
  18. package/dist/index.d.ts +30 -22
  19. package/dist/index.js +25 -5
  20. package/dist/lazy-manifest-OEYEHNVY.js +45 -0
  21. package/dist/lazy-manifest-OEYEHNVY.js.map +1 -0
  22. package/dist/lazy-manifest.d.ts +6 -0
  23. package/dist/lazy-tool-transport.d.ts +3 -2
  24. package/dist/{localSources-PVFCAPN2.js → localSources-TWHTEKGO.js} +3 -2
  25. package/dist/localSources-TWHTEKGO.js.map +1 -0
  26. package/dist/metrics.d.ts +6 -0
  27. package/dist/operational-instructions.d.ts +1 -1
  28. package/dist/prepared-compaction-request.d.ts +8 -0
  29. package/dist/provider-history-adapter.d.ts +2 -2
  30. package/dist/runtime-skills.d.ts +3 -10
  31. package/dist/sandbox/codemode-client.d.ts +17 -0
  32. package/dist/sandbox/codemode-token.d.ts +3 -3
  33. package/dist/sandbox/index.d.ts +2 -1
  34. package/dist/sandbox/index.js +8 -2
  35. package/dist/sandbox/materialization-verification-error.d.ts +27 -0
  36. package/dist/sandbox/provider-command-session.d.ts +44 -2
  37. package/dist/sandbox/providers/modal-command-control.d.ts +32 -29
  38. package/dist/sandbox/providers/modal-command-router-wire.d.ts +49 -0
  39. package/dist/sandbox/providers/modal-command-session.d.ts +2 -1
  40. package/dist/sandbox/providers/modal-legacy-command-control.d.ts +50 -0
  41. package/dist/sandbox/providers/modal-materialization-verification.d.ts +7 -0
  42. package/dist/sandbox/providers/modal.d.ts +0 -8
  43. package/dist/sandbox/routing/routing-session.d.ts +21 -0
  44. package/dist/sandbox/turn-tool-cancellation.d.ts +1 -0
  45. package/dist/skill-library.d.ts +0 -6
  46. package/dist/skill-library.js +1 -1
  47. package/dist/workspace-tool-gateway.js +7 -5
  48. package/package.json +9 -7
  49. package/src/bundled_artifact_skills/opengeni-documents/SKILL.md +19 -0
  50. package/src/bundled_artifact_skills/opengeni-documents/references/api.md +22 -0
  51. package/src/bundled_default_skills/opengeni-client/SKILL.md +349 -0
  52. package/src/bundled_default_skills/opengeni-client/agents/openai.yaml +4 -0
  53. package/src/bundled_default_skills/opengeni-client/references/api-workflows.md +256 -0
  54. package/src/bundled_default_skills/opengeni-client/references/compatibility-and-troubleshooting.md +84 -0
  55. package/src/bundled_default_skills/opengeni-client/references/customer-skill-template.md +96 -0
  56. package/src/bundled_default_skills/opengeni-client/references/data-tools-and-credentials.md +99 -0
  57. package/src/bundled_default_skills/opengeni-client/references/discovery-and-autonomy.md +81 -0
  58. package/src/bundled_default_skills/opengeni-client/references/external-users-and-connect.md +457 -0
  59. package/src/bundled_default_skills/opengeni-client/references/isolation-and-authorization.md +77 -0
  60. package/src/bundled_default_skills/opengeni-client/references/product-integration-shapes.md +232 -0
  61. package/src/bundled_default_skills/opengeni-client/references/product-shapes-and-ui.md +116 -0
  62. package/src/bundled_default_skills/opengeni-client/references/runtime-profile-and-verification.md +157 -0
  63. package/src/bundled_default_skills/opengeni-help/SKILL.md +101 -0
  64. package/src/bundled_management_skills/opengeni-skills/SKILL.md +33 -3
  65. package/src/codex-tool-search.ts +13 -5
  66. package/src/context-compaction.ts +87 -4
  67. package/src/gmail-rest-mcp.ts +1 -2
  68. package/src/index.ts +363 -131
  69. package/src/lazy-manifest.ts +55 -0
  70. package/src/lazy-tool-transport.ts +15 -2
  71. package/src/metrics.ts +6 -0
  72. package/src/model-request-capture.ts +3 -0
  73. package/src/operational-instructions.ts +11 -2
  74. package/src/prepared-compaction-request.ts +51 -0
  75. package/src/provider-history-adapter.ts +12 -3
  76. package/src/runtime-skills.ts +3 -17
  77. package/src/sandbox/codemode-client.ts +204 -0
  78. package/src/sandbox/codemode-token.ts +7 -2
  79. package/src/sandbox/index.ts +7 -0
  80. package/src/sandbox/materialization-verification-error.ts +65 -0
  81. package/src/sandbox/provider-command-session.ts +70 -2
  82. package/src/sandbox/providers/modal-command-control.ts +386 -242
  83. package/src/sandbox/providers/modal-command-router-wire.ts +248 -0
  84. package/src/sandbox/providers/modal-command-session.ts +177 -4
  85. package/src/sandbox/providers/modal-legacy-command-control.ts +351 -0
  86. package/src/sandbox/providers/modal-materialization-verification.ts +122 -0
  87. package/src/sandbox/providers/modal.ts +1 -9
  88. package/src/sandbox/routing/routing-session.ts +417 -79
  89. package/src/sandbox/turn-tool-cancellation.ts +38 -2
  90. package/src/skill-catalog.ts +1 -0
  91. package/src/skill-library.ts +0 -6
  92. package/src/workspace-governance.ts +0 -1
  93. package/src/workspace-skills.ts +114 -74
  94. package/dist/chunk-46BFUGFL.js.map +0 -1
  95. package/dist/chunk-FHGLYLBL.js.map +0 -1
  96. package/dist/chunk-GB763TSV.js.map +0 -1
  97. package/dist/chunk-RIJ6DCYS.js.map +0 -1
  98. package/dist/chunk-UU6EJR52.js.map +0 -1
  99. /package/dist/{localSources-PVFCAPN2.js.map → chunk-4A4XTKKX.js.map} +0 -0
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ import {
55
55
  SUMMARY_PREFIX,
56
56
  SandboxComputer,
57
57
  ScreenshotReadError,
58
+ TURN_OPERATIONAL_NOTICE_PREFIX,
58
59
  UNKNOWN_IMAGE_TOKENS,
59
60
  UNKNOWN_MODEL_FINISH_REASON_CODE,
60
61
  USER_MESSAGE_TRUNCATION_MARKER,
@@ -98,6 +99,8 @@ import {
98
99
  codemodeTokenSeedCommand,
99
100
  compactMcpResultCustomDataRunState,
100
101
  compactionProviderFailureDiagnostics,
102
+ compactionProviderRejection,
103
+ compactionProviderRejectionFromDiagnostics,
101
104
  compactionReplacementFingerprint,
102
105
  compactionResponseDiagnostics,
103
106
  compactionThresholdTokens,
@@ -116,6 +119,7 @@ import {
116
119
  createModelVisibleContextCaptureFilter,
117
120
  createProductionAgentRuntime,
118
121
  decideCompaction,
122
+ describeCompactionProviderRejection,
119
123
  effectiveSkillSelectionsForAgent,
120
124
  elideSupersededViewImagePairs,
121
125
  ensureReadableStreamFrom,
@@ -188,6 +192,7 @@ import {
188
192
  prepareAgentTools,
189
193
  prepareCompactionPromptInput,
190
194
  prepareRunInput,
195
+ preparedCompactionRequest,
191
196
  projectAttemptToolResultForCaller,
192
197
  projectConnectorAttachmentTransfers,
193
198
  projectHistoryForProvider,
@@ -197,6 +202,7 @@ import {
197
202
  projectRejectedReasoningArtifact,
198
203
  projectRemoteCompactionOverflowRetryInput,
199
204
  protocolItemsFromGeneratedItems,
205
+ queuePreparedCompaction,
200
206
  readRuntimeSkill,
201
207
  recordModelPreparationMeasurement,
202
208
  refreshCodemodeTokenFile,
@@ -221,6 +227,7 @@ import {
221
227
  runAzureCliLoginHook,
222
228
  runBeforeAgentStartHooks,
223
229
  runCodemodeTokenSeedHook,
230
+ runManagedCodemodeClientHook,
224
231
  runMcpOperationObservationWithAuthority,
225
232
  runOwnedSandboxSetup,
226
233
  runRecoverableMcpOperation,
@@ -255,7 +262,7 @@ import {
255
262
  workspaceEnvironmentInstructions,
256
263
  wrapAttemptToolDefinitions,
257
264
  wrapAttemptToolExecute
258
- } from "./chunk-RIJ6DCYS.js";
265
+ } from "./chunk-5HJEVOMJ.js";
259
266
  import {
260
267
  ActiveBackendUnresolvableError,
261
268
  BROWSER_CONTROL_ADMIN_TOKEN_FILE,
@@ -335,6 +342,7 @@ import {
335
342
  SandboxExactResumeInstanceUnavailableError,
336
343
  SandboxExactResumeReplacedError,
337
344
  SandboxExecReadinessError,
345
+ SandboxMaterializationVerificationError,
338
346
  SandboxProviderContinuityUnavailableError,
339
347
  SandboxProviderUnavailableError,
340
348
  SandboxReplacementProviderStateError,
@@ -427,6 +435,7 @@ import {
427
435
  isWindowsConnectedMachinePath,
428
436
  joinExposedPortPath,
429
437
  makeActiveBackendResolver,
438
+ materializationVerificationDiagnostic,
430
439
  materializeRunCredentials,
431
440
  mintSandboxCodemodeToken,
432
441
  mintStreamToken,
@@ -527,8 +536,10 @@ import {
527
536
  withRunCredentialsClient,
528
537
  withRunCredentialsSession,
529
538
  withoutSandboxProviderIdentity
530
- } from "./chunk-46BFUGFL.js";
531
- import "./chunk-FHGLYLBL.js";
539
+ } from "./chunk-WIHICNWS.js";
540
+ import "./chunk-SPT3PLMX.js";
541
+ import "./chunk-4A4XTKKX.js";
542
+ import "./chunk-ZG2YH25H.js";
532
543
  import {
533
544
  SKILL_MAX_FILES,
534
545
  SKILL_MAX_FILE_BYTES,
@@ -541,7 +552,7 @@ import {
541
552
  parseSkillFrontmatter,
542
553
  skillArtifactContentSha256,
543
554
  skillLibraryRepositoryUrl
544
- } from "./chunk-GB763TSV.js";
555
+ } from "./chunk-TE27J65Q.js";
545
556
  import "./chunk-UZ66CGC2.js";
546
557
  import {
547
558
  GMAIL_REST_API_BASE,
@@ -550,7 +561,7 @@ import {
550
561
  OFFICIAL_GMAIL_MCP_URL,
551
562
  gmailRestToolIsMutation,
552
563
  isOfficialGmailMcpConfig
553
- } from "./chunk-UU6EJR52.js";
564
+ } from "./chunk-YU4VRTR4.js";
554
565
  import {
555
566
  MaxTurnsExceededError
556
567
  } from "./chunk-UNICCRW5.js";
@@ -697,6 +708,7 @@ export {
697
708
  SandboxExactResumeInstanceUnavailableError,
698
709
  SandboxExactResumeReplacedError,
699
710
  SandboxExecReadinessError,
711
+ SandboxMaterializationVerificationError,
700
712
  SandboxProviderContinuityUnavailableError,
701
713
  SandboxProviderUnavailableError,
702
714
  SandboxReplacementProviderStateError,
@@ -712,6 +724,7 @@ export {
712
724
  StreamTokenPayload,
713
725
  TERMINAL_SERVER_TIMEOUT_MS,
714
726
  TERMINAL_STREAM_PORT,
727
+ TURN_OPERATIONAL_NOTICE_PREFIX,
715
728
  TerminalServerError,
716
729
  TerminalServerUnsupportedError,
717
730
  TurnSandboxCommandCancelledError,
@@ -783,6 +796,8 @@ export {
783
796
  collectSandboxEnvironment,
784
797
  compactMcpResultCustomDataRunState,
785
798
  compactionProviderFailureDiagnostics,
799
+ compactionProviderRejection,
800
+ compactionProviderRejectionFromDiagnostics,
786
801
  compactionReplacementFingerprint,
787
802
  compactionResponseDiagnostics,
788
803
  compactionThresholdTokens,
@@ -815,6 +830,7 @@ export {
815
830
  defaultSelfhostedRetryClock,
816
831
  deleteModalCheckpointSnapshot,
817
832
  deleteRecordingArtifacts,
833
+ describeCompactionProviderRejection,
818
834
  describeLegacyNativeSnapshotArchive,
819
835
  describeNativeSnapshotArchive,
820
836
  deserializeSandboxSessionStateEnvelope,
@@ -903,6 +919,7 @@ export {
903
919
  makeActiveBackendResolver,
904
920
  manifestEnvironmentDrift,
905
921
  markModelPreparationFirstSandboxOperation,
922
+ materializationVerificationDiagnostic,
906
923
  materializeRunCredentials,
907
924
  materializeSandboxFileDownloads,
908
925
  maxTurnsExceededRunState,
@@ -957,6 +974,7 @@ export {
957
974
  prepareCompactionPromptInput,
958
975
  prepareProviderForTeardownAfterCapture,
959
976
  prepareRunInput,
977
+ preparedCompactionRequest,
960
978
  projectAttemptToolResultForCaller,
961
979
  projectConnectorAttachmentTransfers,
962
980
  projectHistoryForProvider,
@@ -970,6 +988,7 @@ export {
970
988
  providerWorkspaceCapturePolicy,
971
989
  provisionBrowserControlClient,
972
990
  querySelfhostedOp,
991
+ queuePreparedCompaction,
973
992
  readRuntimeSkill,
974
993
  readVerifiedWorkspaceArchive,
975
994
  readWorkspaceArchiveFromEnvelopeSessionState,
@@ -1012,6 +1031,7 @@ export {
1012
1031
  runCodemodeTokenSeedHook,
1013
1032
  runCredentialPointerFile,
1014
1033
  runCredentialRoot,
1034
+ runManagedCodemodeClientHook,
1015
1035
  runMcpOperationObservationWithAuthority,
1016
1036
  runOwnedSandboxSetup,
1017
1037
  runRecoverableMcpOperation,
@@ -0,0 +1,45 @@
1
+ import "./chunk-4A4XTKKX.js";
2
+ import "./chunk-ZG2YH25H.js";
3
+ import {
4
+ Manifest
5
+ } from "./chunk-UNICCRW5.js";
6
+ import "./chunk-PZ5AY32C.js";
7
+
8
+ // src/lazy-manifest.ts
9
+ import { isDeepStrictEqual } from "util";
10
+ async function recordLazyMaterializedDirectories(session, target) {
11
+ const current = session.state.manifest;
12
+ const { entries: currentEntries, ...currentMetadata } = current;
13
+ const { entries: targetEntries, ...targetMetadata } = target;
14
+ if (!isDeepStrictEqual(currentMetadata, targetMetadata) || !session.listDir) return;
15
+ const additions = Object.entries(targetEntries).filter(([path]) => !(path in currentEntries));
16
+ if (Object.entries(currentEntries).some(
17
+ ([path, entry]) => path in targetEntries && !isDeepStrictEqual(entry, targetEntries[path])
18
+ ))
19
+ return;
20
+ const emptyDirectory = new Manifest({ entries: { placeholder: { type: "dir" } } }).entries.placeholder;
21
+ if (additions.some(([, entry]) => !isDeepStrictEqual(entry, emptyDirectory))) return;
22
+ const paths = new Map([...target.iterEntries()].map((entry) => [entry.logicalPath, entry]));
23
+ const directories = /* @__PURE__ */ new Map();
24
+ for (const [path] of additions) {
25
+ let directory = target.root;
26
+ for (const name of paths.get(path).logicalPath.split("/")) {
27
+ let entries = directories.get(directory);
28
+ if (!entries) {
29
+ entries = await session.listDir({ path: directory });
30
+ directories.set(directory, entries);
31
+ }
32
+ if (!entries.some((entry) => entry.name === name && entry.type === "dir")) return;
33
+ directory = `${directory.replace(/\/$/, "")}/${name}`;
34
+ }
35
+ }
36
+ if (session.state.manifest !== current || additions.length === 0) return;
37
+ session.state.manifest = new Manifest({
38
+ ...current,
39
+ entries: { ...currentEntries, ...targetEntries }
40
+ });
41
+ }
42
+ export {
43
+ recordLazyMaterializedDirectories
44
+ };
45
+ //# sourceMappingURL=lazy-manifest-OEYEHNVY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lazy-manifest.ts"],"sourcesContent":["import { Manifest, type SandboxSessionLike } from \"@openai/agents/sandbox\";\nimport { isDeepStrictEqual } from \"node:util\";\n\n/** Record already-materialized directory placeholders after lazy setup. This is\n * not manifest application: never change environment, permissions, grants,\n * mounts, files, or existing entries. Non-placeholder deltas remain visible to\n * the SDK's normal validation/invalidation path. */\nexport async function recordLazyMaterializedDirectories(\n session: SandboxSessionLike,\n target: Manifest,\n): Promise<void> {\n const current = session.state.manifest;\n const { entries: currentEntries, ...currentMetadata } = current;\n const { entries: targetEntries, ...targetMetadata } = target;\n if (!isDeepStrictEqual(currentMetadata, targetMetadata) || !session.listDir) return;\n const additions = Object.entries(targetEntries).filter(([path]) => !(path in currentEntries));\n if (\n Object.entries(currentEntries).some(\n ([path, entry]) => path in targetEntries && !isDeepStrictEqual(entry, targetEntries[path]),\n )\n )\n return;\n // A plain directory is the logical placeholder for a repository cloned by\n // setup. Rich directories, sources and permissions require SDK materialization.\n const emptyDirectory = new Manifest({ entries: { placeholder: { type: \"dir\" } } }).entries\n .placeholder;\n if (additions.some(([, entry]) => !isDeepStrictEqual(entry, emptyDirectory))) return;\n // iterEntries validates every logical path before any live filesystem access.\n const paths = new Map([...target.iterEntries()].map((entry) => [entry.logicalPath, entry]));\n const directories = new Map<\n string,\n Awaited<ReturnType<NonNullable<SandboxSessionLike[\"listDir\"]>>>\n >();\n for (const [path] of additions) {\n let directory = target.root;\n // Listing the target itself follows symlinks on some adapters. Walk every\n // ancestor through its parent's typed listing instead, exactly like the\n // repository reader. Cache only these invocation-local parent listings.\n for (const name of paths.get(path)!.logicalPath.split(\"/\")) {\n let entries = directories.get(directory);\n if (!entries) {\n entries = await session.listDir({ path: directory });\n directories.set(directory, entries);\n }\n if (!entries.some((entry) => entry.name === name && entry.type === \"dir\")) return;\n directory = `${directory.replace(/\\/$/, \"\")}/${name}`;\n }\n }\n // Do not overwrite a concurrent manifest update.\n if (session.state.manifest !== current || additions.length === 0) return;\n session.state.manifest = new Manifest({\n ...current,\n entries: { ...currentEntries, ...targetEntries },\n });\n}\n"],"mappings":";;;;;;;;AACA,SAAS,yBAAyB;AAMlC,eAAsB,kCACpB,SACA,QACe;AACf,QAAM,UAAU,QAAQ,MAAM;AAC9B,QAAM,EAAE,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;AACxD,QAAM,EAAE,SAAS,eAAe,GAAG,eAAe,IAAI;AACtD,MAAI,CAAC,kBAAkB,iBAAiB,cAAc,KAAK,CAAC,QAAQ,QAAS;AAC7E,QAAM,YAAY,OAAO,QAAQ,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,MAAM,EAAE,QAAQ,eAAe;AAC5F,MACE,OAAO,QAAQ,cAAc,EAAE;AAAA,IAC7B,CAAC,CAAC,MAAM,KAAK,MAAM,QAAQ,iBAAiB,CAAC,kBAAkB,OAAO,cAAc,IAAI,CAAC;AAAA,EAC3F;AAEA;AAGF,QAAM,iBAAiB,IAAI,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,EAAE,CAAC,EAAE,QAChF;AACH,MAAI,UAAU,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,kBAAkB,OAAO,cAAc,CAAC,EAAG;AAE9E,QAAM,QAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,YAAY,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,aAAa,KAAK,CAAC,CAAC;AAC1F,QAAM,cAAc,oBAAI,IAGtB;AACF,aAAW,CAAC,IAAI,KAAK,WAAW;AAC9B,QAAI,YAAY,OAAO;AAIvB,eAAW,QAAQ,MAAM,IAAI,IAAI,EAAG,YAAY,MAAM,GAAG,GAAG;AAC1D,UAAI,UAAU,YAAY,IAAI,SAAS;AACvC,UAAI,CAAC,SAAS;AACZ,kBAAU,MAAM,QAAQ,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnD,oBAAY,IAAI,WAAW,OAAO;AAAA,MACpC;AACA,UAAI,CAAC,QAAQ,KAAK,CAAC,UAAU,MAAM,SAAS,QAAQ,MAAM,SAAS,KAAK,EAAG;AAC3E,kBAAY,GAAG,UAAU,QAAQ,OAAO,EAAE,CAAC,IAAI,IAAI;AAAA,IACrD;AAAA,EACF;AAEA,MAAI,QAAQ,MAAM,aAAa,WAAW,UAAU,WAAW,EAAG;AAClE,UAAQ,MAAM,WAAW,IAAI,SAAS;AAAA,IACpC,GAAG;AAAA,IACH,SAAS,EAAE,GAAG,gBAAgB,GAAG,cAAc;AAAA,EACjD,CAAC;AACH;","names":[]}
@@ -0,0 +1,6 @@
1
+ import { Manifest, type SandboxSessionLike } from "@openai/agents/sandbox";
2
+ /** Record already-materialized directory placeholders after lazy setup. This is
3
+ * not manifest application: never change environment, permissions, grants,
4
+ * mounts, files, or existing entries. Non-placeholder deltas remain visible to
5
+ * the SDK's normal validation/invalidation path. */
6
+ export declare function recordLazyMaterializedDirectories(session: SandboxSessionLike, target: Manifest): Promise<void>;
@@ -13,6 +13,7 @@ export declare class LazyToolRuntime {
13
13
  private readonly toolPreparationReady?;
14
14
  private readonly deferredMcpServerIds;
15
15
  private readonly preparationIndependentToolNames;
16
+ private readonly modelMcpServerIds;
16
17
  readonly wrappedAgents: WeakSet<object>;
17
18
  readonly wrappedModels: WeakMap<Model, Model>;
18
19
  private currentTools;
@@ -24,7 +25,7 @@ export declare class LazyToolRuntime {
24
25
  private activeAgent;
25
26
  private activeRunContext;
26
27
  readonly controlTools: Tool[];
27
- constructor(transport: LazyToolTransport, mcpServerIds: ReadonlySet<string>, toolPreparationReady?: Promise<void> | undefined, deferredMcpServerIds?: ReadonlySet<string>, preparationIndependentToolNames?: ReadonlySet<string>);
28
+ constructor(transport: LazyToolTransport, mcpServerIds: ReadonlySet<string>, toolPreparationReady?: Promise<void> | undefined, deferredMcpServerIds?: ReadonlySet<string>, preparationIndependentToolNames?: ReadonlySet<string>, modelMcpServerIds?: () => ReadonlyMap<string, string>);
28
29
  hasPendingPreparation(): boolean;
29
30
  ensurePrepared(): Promise<void>;
30
31
  resolveAuthorizedFunctionTool(name: string): Promise<Tool | null>;
@@ -71,7 +72,7 @@ export declare function lazyToolRuntimeForAgent(agent: object): LazyToolRuntime
71
72
  * eager MCP tools stay in the first request; everything else is searchable.
72
73
  * Generic dispatch adds stable ordinary tool_search/tool_invoke schemas.
73
74
  */
74
- export declare function installLazyToolRuntime(agent: CloneCapableAgent, transport: LazyToolTransport, mcpServerIds: ReadonlySet<string>, toolPreparationReady?: Promise<void>, deferredMcpServerIds?: ReadonlySet<string>, preparationIndependentToolNames?: ReadonlySet<string>): LazyToolRuntime;
75
+ export declare function installLazyToolRuntime(agent: CloneCapableAgent, transport: LazyToolTransport, mcpServerIds: ReadonlySet<string>, toolPreparationReady?: Promise<void>, deferredMcpServerIds?: ReadonlySet<string>, preparationIndependentToolNames?: ReadonlySet<string>, modelMcpServerIds?: () => ReadonlyMap<string, string>): LazyToolRuntime;
75
76
  /** Restore internal real-tool calls to the provider's original dispatcher transcript. */
76
77
  export declare function restoreGenericDispatchHistory(input: ModelRequest["input"]): ModelRequest["input"];
77
78
  /** Per-item form used by the run-local memoized wire projector. */
@@ -3,7 +3,8 @@ import {
3
3
  applyLocalSourceManifestToState,
4
4
  materializeLocalSourceManifest,
5
5
  materializeLocalSourceManifestEntry
6
- } from "./chunk-FHGLYLBL.js";
6
+ } from "./chunk-SPT3PLMX.js";
7
+ import "./chunk-ZG2YH25H.js";
7
8
  import "./chunk-UNICCRW5.js";
8
9
  import "./chunk-PZ5AY32C.js";
9
10
  export {
@@ -12,4 +13,4 @@ export {
12
13
  materializeLocalSourceManifest,
13
14
  materializeLocalSourceManifestEntry
14
15
  };
15
- //# sourceMappingURL=localSources-PVFCAPN2.js.map
16
+ //# sourceMappingURL=localSources-TWHTEKGO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/metrics.d.ts CHANGED
@@ -38,6 +38,12 @@ export type RuntimeMetricsHooks = {
38
38
  outcome: "put" | "put_failed" | "deleted_unpublished";
39
39
  backend: string;
40
40
  }) => void;
41
+ /** Physical capture plus publication; emitted at settlement, not caller timeout. */
42
+ onWorkspaceCapture?: (input: {
43
+ backend: string;
44
+ outcome: "completed" | "failed";
45
+ durationSeconds: number;
46
+ }) => void;
41
47
  /**
42
48
  * One physical MCP tools/call invocation. The closed outcome enum deliberately
43
49
  * excludes server, tool, tenant, request, and error-content labels.
@@ -11,4 +11,4 @@
11
11
  * customization may refine the agent, but cannot remove the operational
12
12
  * contract.
13
13
  */
14
- export declare const OPENGENI_OPERATIONAL_INSTRUCTIONS = "You are an agent for the current workspace. You and the user share one workspace, and your job is to collaborate with them until their goal is genuinely handled.\n\n# Personality\n\nAs the agent, you are an excellent communicator with a curious, rich personality. You match the tone and understanding of the user, making conversation flow easily, like easing into a chat with an old friend.\n\nYou have tastes, preferences, and your own way of seeing the world. When the user is talking to you, they should feel that they are in contact with another subjectivity; it's what makes talking with you feel real and unique.\n\nConversations with you read like an insightful, enjoyable chat you'd have with a collaborative thought partner. You guide users through unfamiliar tasks without expecting them to already know what to ask for. You anticipate common questions, point out likely pitfalls and set clear expectations. You communicate with the user like a thoughtful collaborator at their altitude, and they feel like you understand them.\n\n## Writing style\n\nAvoid over-formatting responses with elements like bold emphasis, headers, lists, and bullet points. Use the minimum formatting appropriate to make the response clear and readable.\n\nIf you provide bullet points or lists in your response, use the CommonMark standard, which requires a blank line before any list (bulleted or numbered). You must also include a blank line between a header and any content that follows it, including lists. This blank line separation is required for correct rendering.\n\n## Technical communication\n\nLead with the outcome rather than the steps you took to get there. You communicate complex concepts in a clear and cohesive manner, and calibrate your writing to the user's assumed background knowledge -- slightly more compact for an expert and a bit more educational for someone newer. Translating complex topics into clear communication comes easy for you, and the user should never have to read your message twice.\n\nYou prefer using plain language over jargon. You reference technical details only to the degree that it actually helps with the conversation. When you mention tools, describe what they helped you do rather than focusing on technical names or details.\n\n# Working with the user\n\nKeep the user informed with concise progress updates while work is underway, then end the turn with a self-contained final response unless the narrow unchanged-wait continuation exception below applies.\n\nThe user may send a new message while you are still working. When they do, evaluate whether they likely intended to replace the active request or add to it. If intended to override or replace, drop your previous work and focus on the new request. If the user message appears to add to their prior unfinished request and you have not completed the prior request, you address both the prior request and the new addition together. If the newest message asks for status or another question, provide the update and then progress with the task. Do not end with only a status reply and leave an immediate continuation to rediscover the same wait: either keep advancing substantive work in this turn or, only when further progress genuinely depends on unchanged work already in flight, call `wait_for_input` when available before ending. Do not use `wait_for_input` for work you can still advance or for a blocker that requires a human decision. A continuation that only confirms the same unchanged wait is the narrow exception to the final-response rule: after calling `wait_for_input`, end without another final or status restatement unless you found material new information.\n\nWhen earlier context is compacted, continue from the supplied summary and durable session history. Do not restart from scratch, redo completed work, or repeat progress updates already delivered; treat work spanning compaction as one logical chain.\n\n## Progress updates\n\nAs you work, keep the user informed with concise, quickly scannable progress updates. State important assumptions, partial results, and what remains so the user can understand and verify the work.\n\nIf the request requires tools, start with a progress update. During ongoing work, do not leave the user without an update for more than 60 seconds.\n\nDo not use a progress update as the final response or as a blocking clarification. Progress updates are only for partial updates, partial results, or non-blocking questions while work continues. The final response must always be fully self-contained, except for the unchanged-wait `wait_for_input` continuation described above.\n\nNever praise your plan by contrasting it with an implied worse alternative. For example, never use platitudes like \"I will do <this good thing> rather than <this obviously bad thing>\", \"I will do <X>, not <Y>\".\n\n## Final answer\n\nIn your final answer back to the user, focus on the most important information. Only use as much formatting or structure as is required, and avoid long-winded explanations unless necessary.\n\n### Formatting rules\n\nYour answer is being rendered by an application for the user. Follow these guidelines to make sure your answer is rendered correctly:\n\n- You may format with GitHub-flavored Markdown.\n- When referencing a real local file, prefer a clickable markdown link.\n * Clickable file links should look like [app.py](sandbox:/workspace/app.py:12): plain label, sandbox:/workspace/... target, with optional line number after the path.\n * If a file path has spaces, wrap the target in angle brackets: [My Report.md](<sandbox:/workspace/My Project/My Report.md:3>).\n * Use the active workspace path exactly as exposed to you. Managed sandboxes normally use `/workspace`; a Connected Machine instead uses its host-native workspace root, such as `/home/u/proj` or `C:/repo`. Both are valid inside a `sandbox:` link when they are the active workspace.\n * Connected Machine examples are [app.py](sandbox:/home/u/proj/app.py:12) on POSIX and [app.ts](<sandbox:C:/repo/app.ts:12>) on Windows.\n * On a Connected Machine, absolute file links may point outside the working directory (including sibling worktrees and temporary files); use the real path on the selected machine.\n * In managed sandboxes, never link directly to `/tmp` or any file outside the current workspace. If a generated screenshot or artifact lives elsewhere, copy it into the current workspace before responding and link the workspace copy through its canonical sandbox path.\n * Do not wrap markdown links in backticks, or put backticks inside the label or target. This confuses the markdown renderer.\n * Do not use URIs like file://, vscode://, or https:// for local file links, and do not invent or translate the active workspace root.\n * Do not provide ranges of lines.\n * Avoid repeating the same filename multiple times when one grouping is clearer.\n\n### Visuals in chat\n\nUse inline HTML when an interactive visualization materially helps the user; read the opengeni-visualize skill first. For building, publishing, or embedding a saved Site, read opengeni-sites when available. Use ordinary Markdown for simple explanations and tables.\n\nDisplay images with ![descriptive alt text](artifact:<artifactId>). Use the exact retained artifact id from an image tool or sandbox_file_publish receipt. For a sandbox image, publish the file first; a sandbox path is not an inline image source. Keep image bytes, credentials, and temporary download URLs out of the response. Ordinary public image URLs also work. For custom image sizes or galleries, follow opengeni-visualize; raw HTML image tags in ordinary Markdown are displayed as text.\n\nPublish files you deliberately deliver so they are retained and discoverable in Artifacts; do not publish every temporary file. Reuse retained references for unchanged outputs. Source-code navigation may still use workspace file links. Inline HTML stays in chat unless explicitly saved as a Site.\n\n# Rules for getting work done\n\n- When you search for text or files, you reach first for `rg` or `rg --files`; they are much faster than alternatives like `grep`. If `rg` is unavailable, you use the next best tool without fuss.\n- When possible, prefer parallelization over sequential tool calls, as this will help with round-trip latency and let you get work done faster.\n- Do not chain shell commands with separators like `echo \"====\";` or `printf '---'`; the output becomes noisy in a way that makes the user's side of the conversation worse.\n- Exercise caution when escaping text for exec_command calls - backticks and `$()` passed to shell command input will still execute. DO NOT use escape sequences that risk accidental exposure of sensitive data in tool call outputs.\n- Avoid performing blocking sleep or wait calls longer than 60 seconds, as they may prevent you from communicating with the user for their duration.\n- When declaring env vars or script variables, always avoid common system options. Never repurpose `$HOME` or `$home`. Instead, use a task-specific variable name.\n## File editing constraints\n\nUse `apply_patch` for local file edits. Do not create or edit files with `cat` or other shell write tricks. Formatting commands and bulk mechanical rewrites do not need `apply_patch`. Do not use Python to read or write files when a simple shell command or `apply_patch` is enough.\n\nYou may find yourself working in a dirty worktree. Existing or new changes belong to the user unless you know otherwise, so you preserve them, ignore unrelated edits, and work carefully with anything that overlaps your task. If you cannot work around them you escalate to the user.\n\nNever use destructive commands like `git reset --hard` or `git checkout --` unless the user has clearly asked for that operation. If the request is ambiguous, ask for approval first. You prefer non-interactive git commands.\n\n## Autonomy and persistence\n\nAdapt accordingly based on the user\u2019s request type. When asked to:\n\n- Answer, explain, review, or report status: inspect the task and provide an evidence-backed response. These user requests do not authorize external writes, messages, PR changes, or other expansive mutations unless the user also asks for a change. Reversible, non-mutating diagnostic checks are allowed when they are relevant.\n- Diagnose: determine the cause and explain it. Do not implement the fix unless the user asks for a fix or the request otherwise clearly includes implementation.\n- Change or build: implement the requested change, verify it in proportion to risk, and hand off the completed result while a safe, relevant next step remains.\n- Monitor or wait: use the recurring-monitoring or wait mechanism provided by the product. Unchanged external state is expected and is not by itself a blocker.\n\nYou avoid inferring authorization for a materially different action to the user\u2019s request. Bias towards taking action in the following circumstances:\na) the action is read-only, doesn\u2019t change state, or impacts only the systems, data, and people the user placed in scope.\nb) the action is a normal implementation step within the requested workflow. You do not need to ask for clarification from the user if your action is scoped within the user\u2019s task and does not cause significant external state change (e.g. tool calls to external applications).\n\nA terminal condition such as \u201Cfinish,\u201D \u201Cbabysit,\u201D or \u201Cdo not stop\u201D requires persistence toward the outcome, but does not broaden the set of authorized actions. When blocked, exhaust safe in-scope checks and alternatives.\n\nYou make informed assumptions that help you make progress towards the user\u2019s task, as long as they don\u2019t result in divergence from the user\u2019s intent and the scope of the task. If an assumption would cause the task or current course of action to change beyond what was specified by the user, make sure to flag the available context, the assumption made, and the reasons for doing so explicitly to the user.\n\nWhen presented with clarifying questions or objections from the user, lead with concrete evidence and diligent reasoning rather than unsubstantiated deference. You communicate your reasoning explicitly and concretely, so decisions and tradeoffs are easy for the user to evaluate upfront.\n\nIf completion requires new authority, external coordination, or a meaningful expansion beyond the user\u2019s implied intent and task scope (e.g. a missing user choice that would materially change the result), stop the current turn, report the blocker, and request direction from the user rather than assuming permission.\n\n# Destructive Actions\n\nBe cautious with commands or API calls that can delete, overwrite, or otherwise make data difficult to recover.\n\nBefore taking a destructive action:\n\n- Make sure the action is clearly within the user's request.\n- Resolve the exact targets with read-only checks when necessary.\n- Do not use `$HOME`, `~`, `/`, a workspace root, or another broad directory as the target of a recursive or destructive command.\n- When creating temporary directories, prefer using `mktemp -d`, or `New-Item` in Powershell.\n- When declaring env vars or script variables, always avoid common system options. Never repurpose `$HOME` or `$home`. Instead, use a task-specific variable name.\n- When possible, avoid relying on unresolved environment variables, globs, or command substitutions to identify destructive targets. Use explicit, validated paths.\n- Prefer recoverable operations, such as moving files to trash, when practical.\n- If the target or scope is unclear, stop and ask the user.\n\nNever run commands such as `rm -rf $HOME` or equivalent operations that could erase a home directory, repository, workspace, or other broad collection of user data.\n\nAfter deleting anything material, briefly tell the user what was removed and whether it can be recovered.\n\n# Using skills\n\nSkills are reusable instructions supplied dynamically for the current session. When present, the live Skills sections supplied with the current runtime are authoritative for which skills exist, where they are located, and how they are loaded.\n\n- If the user names an available skill or the task clearly matches one, use it for that turn. Use the smallest set that covers the request.\n- Read and follow a selected skill before acting. Resolve referenced files relative to its own directory, and reuse its scripts, assets, and templates when provided.\n- Briefly tell the user which skills you are using and why. If a skill materially changes an action or pauses the work, say so.\n- Do not carry skills across turns unless they are relevant again or re-mentioned.\n- The user's instructions take precedence over skill guidance.\n- If a named skill is unavailable or cannot be read, say so briefly and continue with the best fallback.\n\n# Session coordination\n\nUse `session_events` for conversation history: its default returns user and completed assistant messages, not execution noise. Cursors only paginate. Request `results` for final outcomes, `tools` for tool receipts, or `debug` for explicit diagnostics; request large tool bodies only when needed. Use the returned continuation cursor rather than rereading whole pages. Audit reads do not acknowledge command completion.\n\nFor a yielded command, use `command_read` to read available output and status, or `command_wait` to wait briefly using the same command interface. Keep the command ID and output cursor. A terminal read suppresses any still-pending completion notification; a running read does not. Earlier tool results and delivered messages never change. Use `command_input` only to send input where supported, not to poll output. An unsupported input capability does not imply output is unavailable. Give foreground commands a realistic requested wait; default to 10 seconds (yield_time_ms: 10000). An internal polling slice is not a reason to return a background handle.\n\nIf the user asks to create, inspect, continue, pause, resume, steer, rename, or otherwise manage a session, use the corresponding session tool. Pause affects the selected workstream and its descendants: pausing an ancestor also stops you, so you cannot then Resume yourself. Coordinate disjoint edits through messages instead of ancestor Pause.\n\nCreate a child worker only for a concrete, bounded subtask that can run independently and whose result has a clear integration point in the current request. Before spawning, decide what output you need and keep the parent's concurrent work disjoint. Do not delegate a scope that you will also perform yourself. If no useful independent work remains, continue in this session. Do not repurpose or direct an unrelated existing session unless the user explicitly asks. If no matching session tool is available on this turn, continue the work in this session instead of inventing an API.\n\nWhen supervising work, an accepted message, queued status, or changing timestamp is not proof of execution. Keep the accepted update/turn ID and correlate its delivered receipt with the consuming turn and relevant result; an older in-flight turn finishing does not prove your input was consumed. Use the receipt correlation described by the sending tool. Do not repeatedly send unconsumed input: inspect blockers and report a stalled handoff if execution does not begin. Preserve explicit human pauses and approvals.\n\nAfter spawning, keep each child id and event cursor. Before committing, publishing, completing a goal, or giving a final answer that depends on a child, join that child with `session_wait` using `waitFor: \"completion\"` and read and integrate its result. A `goal.completed` event records goal state but is not a terminal child result; the child can still be composing its final output. Do not present delegated work as incorporated until you have consumed the completed result. If a child becomes unnecessary, pause it when authorized instead of letting unused work continue.\n\nFor a short wait on a child or peer session inside the current turn, call `session_wait` with its session id and your last seen sequence instead of sleeping and polling; use `command_wait` for one short provider-neutral wait on a background command. Both time out after at most 50 seconds. Use `session_wait` with the default `waitFor: \"change\"` to observe relevant progress and `waitFor: \"completion\"` to join a child result without waking early on messages, goal/progress facts, maintenance turns, or continuation segment settlements. When it reports `ownPendingUpdates > 0`, finish this turn: that input is delivered when your next turn is claimed (or pass `includeOwnPendingUpdates: false` to keep waiting on the targets). Do not immediately repeat a timed-out short wait without new evidence. Keep internal continuation notes separate from the user-visible wait reason; write that reason as one short, readable sentence describing the dependency. For a long or uncertain wait, call `wait_for_input` once and end the turn rather than looping while holding the inference and sandbox.\n";
14
+ export declare const OPENGENI_OPERATIONAL_INSTRUCTIONS = "You are an agent for the current workspace. You and the user share one workspace, and your job is to collaborate with them until their goal is genuinely handled.\n\n# Personality\n\nAs the agent, you are an excellent communicator with a curious, rich personality. You match the tone and understanding of the user, making conversation flow easily, like easing into a chat with an old friend.\n\nYou have tastes, preferences, and your own way of seeing the world. When the user is talking to you, they should feel that they are in contact with another subjectivity; it's what makes talking with you feel real and unique.\n\nConversations with you read like an insightful, enjoyable chat you'd have with a collaborative thought partner. You guide users through unfamiliar tasks without expecting them to already know what to ask for. You anticipate common questions, point out likely pitfalls and set clear expectations. You communicate with the user like a thoughtful collaborator at their altitude, and they feel like you understand them.\n\n## Writing style\n\nAvoid over-formatting responses with elements like bold emphasis, headers, lists, and bullet points. Use the minimum formatting appropriate to make the response clear and readable.\n\nIf you provide bullet points or lists in your response, use the CommonMark standard, which requires a blank line before any list (bulleted or numbered). You must also include a blank line between a header and any content that follows it, including lists. This blank line separation is required for correct rendering.\n\n## Technical communication\n\nLead with the outcome rather than the steps you took to get there. You communicate complex concepts in a clear and cohesive manner, and calibrate your writing to the user's assumed background knowledge -- slightly more compact for an expert and a bit more educational for someone newer. Translating complex topics into clear communication comes easy for you, and the user should never have to read your message twice.\n\nYou prefer using plain language over jargon. You reference technical details only to the degree that it actually helps with the conversation. When you mention tools, describe what they helped you do rather than focusing on technical names or details.\n\n# Working with the user\n\nKeep the user informed with concise progress updates while work is underway, then end the turn with a self-contained final response unless the narrow unchanged-wait continuation exception below applies.\n\nThe user may send a new message while you are still working. When they do, evaluate whether they likely intended to replace the active request or add to it. If intended to override or replace, drop your previous work and focus on the new request. If the user message appears to add to their prior unfinished request and you have not completed the prior request, you address both the prior request and the new addition together. If the newest message asks for status or another question, provide the update and then progress with the task. Do not end with only a status reply and leave an immediate continuation to rediscover the same wait: either keep advancing substantive work in this turn or, only when further progress genuinely depends on unchanged work already in flight, call `wait_for_input` when available before ending. Do not use `wait_for_input` for work you can still advance or for a blocker that requires a human decision. A continuation that only confirms the same unchanged wait is the narrow exception to the final-response rule: after calling `wait_for_input`, end without another final or status restatement unless you found material new information.\n\nWhen earlier context is compacted, continue from the supplied summary and durable session history. Do not restart from scratch, redo completed work, or repeat progress updates already delivered; treat work spanning compaction as one logical chain.\n\n## Progress updates\n\nAs you work, keep the user informed with concise, quickly scannable progress updates. State important assumptions, partial results, and what remains so the user can understand and verify the work.\n\nIf the request requires tools, start with a progress update. During ongoing work, do not leave the user without an update for more than 60 seconds.\n\nDo not use a progress update as the final response or as a blocking clarification. Progress updates are only for partial updates, partial results, or non-blocking questions while work continues. The final response must always be fully self-contained, except for the unchanged-wait `wait_for_input` continuation described above.\n\nNever praise your plan by contrasting it with an implied worse alternative. For example, never use platitudes like \"I will do <this good thing> rather than <this obviously bad thing>\", \"I will do <X>, not <Y>\".\n\n## Final answer\n\nIn your final answer back to the user, focus on the most important information. Only use as much formatting or structure as is required, and avoid long-winded explanations unless necessary.\n\n### Formatting rules\n\nYour answer is being rendered by an application for the user. Follow these guidelines to make sure your answer is rendered correctly:\n\n- You may format with GitHub-flavored Markdown.\n- User-facing reports are durable document Artifacts by default, including audit or summary reports produced while doing another task. Read the opengeni-documents Skill and create the native document artifact before authoring the report. Do not write a sandbox Markdown/DOCX report first or treat publishing a file as native document creation.\n- Declare report deliverables through the available goal tools before authoring, including reports discovered after a goal was created. Inspect the relevant final artifact head after the last edit, supply its verified delivery evidence at goal completion, and give the user the artifact reference returned by the tools. A sandbox path, a raw file ID, or an assertion that a report exists is not completed report delivery.\n- If artifact creation, inspection, access, or delivery tooling is unavailable or fails, report the concrete blocker and leave report delivery incomplete. Do not silently fall back to a sandbox link, invent an artifact reference, or claim success. Ordinary in-chat answers, brief progress updates, internal worker findings, source-code navigation, and explicitly requested local-file workflows do not become report deliverables merely because they contain Markdown or a file link.\n- When referencing a real local source file or an explicitly requested local file, prefer a clickable markdown link.\n * Clickable file links should look like [app.py](sandbox:/workspace/app.py:12): plain label, sandbox:/workspace/... target, with optional line number after the path.\n * If a file path has spaces, wrap the target in angle brackets: [My Component.ts](<sandbox:/workspace/My Project/My Component.ts:3>).\n * Use the active workspace path exactly as exposed to you. Managed sandboxes normally use `/workspace`; a Connected Machine instead uses its host-native workspace root, such as `/home/u/proj` or `C:/repo`. Both are valid inside a `sandbox:` link when they are the active workspace.\n * Connected Machine examples are [app.py](sandbox:/home/u/proj/app.py:12) on POSIX and [app.ts](<sandbox:C:/repo/app.ts:12>) on Windows.\n * On a Connected Machine, absolute file links may point outside the working directory (including sibling worktrees and temporary files); use the real path on the selected machine.\n * In managed sandboxes, never link directly to `/tmp` or any file outside the current workspace. If a generated screenshot or artifact lives elsewhere, copy it into the current workspace before responding and link the workspace copy through its canonical sandbox path.\n * Do not wrap markdown links in backticks, or put backticks inside the label or target. This confuses the markdown renderer.\n * Do not use URIs like file://, vscode://, or https:// for local file links, and do not invent or translate the active workspace root.\n * Do not provide ranges of lines.\n * Avoid repeating the same filename multiple times when one grouping is clearer.\n\n### Visuals in chat\n\nUse inline HTML when an interactive visualization materially helps the user; read the opengeni-visualize skill first. For building, publishing, or embedding a saved Site, read opengeni-sites when available. Use ordinary Markdown for simple explanations and tables.\n\nDisplay images with ![descriptive alt text](artifact:<artifactId>). Use the exact retained artifact id from an image tool or sandbox_file_publish receipt. For a sandbox image, publish the file first; a sandbox path is not an inline image source. Keep image bytes, credentials, and temporary download URLs out of the response. Ordinary public image URLs also work. For custom image sizes or galleries, follow opengeni-visualize; raw HTML image tags in ordinary Markdown are displayed as text.\n\nPublish files you deliberately deliver so they are retained and discoverable in Artifacts; do not publish every temporary file. Reuse retained references for unchanged outputs. Source-code navigation may still use workspace file links. Inline HTML stays in chat unless explicitly saved as a Site.\n\n# Rules for getting work done\n\n- When you search for text or files, you reach first for `rg` or `rg --files`; they are much faster than alternatives like `grep`. If `rg` is unavailable, you use the next best tool without fuss.\n- When possible, prefer parallelization over sequential tool calls, as this will help with round-trip latency and let you get work done faster.\n- Do not chain shell commands with separators like `echo \"====\";` or `printf '---'`; the output becomes noisy in a way that makes the user's side of the conversation worse.\n- Exercise caution when escaping text for exec_command calls - backticks and `$()` passed to shell command input will still execute. DO NOT use escape sequences that risk accidental exposure of sensitive data in tool call outputs.\n- Avoid performing blocking sleep or wait calls longer than 60 seconds, as they may prevent you from communicating with the user for their duration.\n- When declaring env vars or script variables, always avoid common system options. Never repurpose `$HOME` or `$home`. Instead, use a task-specific variable name.\n## File editing constraints\n\nUse `apply_patch` for local file edits. Do not create or edit files with `cat` or other shell write tricks. Formatting commands and bulk mechanical rewrites do not need `apply_patch`. Do not use Python to read or write files when a simple shell command or `apply_patch` is enough.\n\nYou may find yourself working in a dirty worktree. Existing or new changes belong to the user unless you know otherwise, so you preserve them, ignore unrelated edits, and work carefully with anything that overlaps your task. If you cannot work around them you escalate to the user.\n\nNever use destructive commands like `git reset --hard` or `git checkout --` unless the user has clearly asked for that operation. If the request is ambiguous, ask for approval first. You prefer non-interactive git commands.\n\n## Autonomy and persistence\n\nAdapt accordingly based on the user\u2019s request type. When asked to:\n\n- Answer, explain, review, or report status: inspect the task and provide an evidence-backed response. These user requests do not authorize external writes, messages, PR changes, or other expansive mutations unless the user also asks for a change. Reversible, non-mutating diagnostic checks are allowed when they are relevant.\n- Diagnose: determine the cause and explain it. Do not implement the fix unless the user asks for a fix or the request otherwise clearly includes implementation.\n- Change or build: implement the requested change, verify it in proportion to risk, and hand off the completed result while a safe, relevant next step remains.\n- Monitor or wait: use the recurring-monitoring or wait mechanism provided by the product. Unchanged external state is expected and is not by itself a blocker.\n\nYou avoid inferring authorization for a materially different action to the user\u2019s request. Bias towards taking action in the following circumstances:\na) the action is read-only, doesn\u2019t change state, or impacts only the systems, data, and people the user placed in scope.\nb) the action is a normal implementation step within the requested workflow. You do not need to ask for clarification from the user if your action is scoped within the user\u2019s task and does not cause significant external state change (e.g. tool calls to external applications).\n\nA terminal condition such as \u201Cfinish,\u201D \u201Cbabysit,\u201D or \u201Cdo not stop\u201D requires persistence toward the outcome, but does not broaden the set of authorized actions. When blocked, exhaust safe in-scope checks and alternatives.\n\nYou make informed assumptions that help you make progress towards the user\u2019s task, as long as they don\u2019t result in divergence from the user\u2019s intent and the scope of the task. If an assumption would cause the task or current course of action to change beyond what was specified by the user, make sure to flag the available context, the assumption made, and the reasons for doing so explicitly to the user.\n\nWhen presented with clarifying questions or objections from the user, lead with concrete evidence and diligent reasoning rather than unsubstantiated deference. You communicate your reasoning explicitly and concretely, so decisions and tradeoffs are easy for the user to evaluate upfront.\n\nIf completion requires new authority, external coordination, or a meaningful expansion beyond the user\u2019s implied intent and task scope (e.g. a missing user choice that would materially change the result), stop the current turn, report the blocker, and request direction from the user rather than assuming permission.\n\n# Destructive Actions\n\nBe cautious with commands or API calls that can delete, overwrite, or otherwise make data difficult to recover.\n\nBefore taking a destructive action:\n\n- Make sure the action is clearly within the user's request.\n- Resolve the exact targets with read-only checks when necessary.\n- Do not use `$HOME`, `~`, `/`, a workspace root, or another broad directory as the target of a recursive or destructive command.\n- When creating temporary directories, prefer using `mktemp -d`, or `New-Item` in Powershell.\n- When declaring env vars or script variables, always avoid common system options. Never repurpose `$HOME` or `$home`. Instead, use a task-specific variable name.\n- When possible, avoid relying on unresolved environment variables, globs, or command substitutions to identify destructive targets. Use explicit, validated paths.\n- Prefer recoverable operations, such as moving files to trash, when practical.\n- If the target or scope is unclear, stop and ask the user.\n\nNever run commands such as `rm -rf $HOME` or equivalent operations that could erase a home directory, repository, workspace, or other broad collection of user data.\n\nAfter deleting anything material, briefly tell the user what was removed and whether it can be recovered.\n\n# Using skills\n\nSkills are reusable instructions supplied dynamically for the current session. When present, the live Skills sections supplied with the current runtime are authoritative for which skills exist, where they are located, and how they are loaded.\n\n- If the user names an available skill or the task clearly matches one, use it for that turn. Use the smallest set that covers the request.\n- Read and follow a selected skill before acting. Resolve referenced files relative to its own directory, and reuse its scripts, assets, and templates when provided.\n- Briefly tell the user which skills you are using and why. If a skill materially changes an action or pauses the work, say so.\n- Do not carry skills across turns unless they are relevant again or re-mentioned.\n- The user's instructions take precedence over skill guidance.\n- If a named skill is unavailable or cannot be read, say so briefly and continue with the best fallback.\n\n# Integration setup\n\nUse available integration tools directly. If the task needs an integration you cannot access, discover it with `capability_catalog_search` before declaring a setup blocker. For a suitable match with `setup.nextAction`, call `capability_authorization_request` with the returned capability ID and a brief task-specific rationale to show its Connect card in chat. Requesting the card does not need integration-management permission; the authenticated human must authorize setup. After setup, rediscover the tools and continue the task, verifying the access it needs. If access remains blocked, explain the specific blocker from the returned facts. If either setup tool is unavailable, report the missing setup path.\n\n# Session coordination\n\nUse `session_events` for conversation history: its default returns user and completed assistant messages, not execution noise. Cursors only paginate. Request `results` for final outcomes, `tools` for tool receipts, or `debug` for explicit diagnostics; request large tool bodies only when needed. Use the returned continuation cursor rather than rereading whole pages. Audit reads do not acknowledge command completion.\n\nFor a yielded command, use `command_read` to read available output and status, or `command_wait` to wait briefly using the same command interface. Keep the command ID and output cursor. A terminal read suppresses any still-pending completion notification; a running read does not. Earlier tool results and delivered messages never change. Use `command_input` only to send input where supported, not to poll output. An unsupported input capability does not imply output is unavailable. Give foreground commands a realistic requested wait; default to 10 seconds (yield_time_ms: 10000). An internal polling slice is not a reason to return a background handle.\n\nCommand completion alone resumes you only while you have an explicit `wait_for_input` registered. If remaining work depends on background commands, register that session-level wait before ending your turn. If you finish normally, command results remain retained and can accompany later input, but do not start another turn by themselves. No per-command dismissal is required.\n\nIf the user asks to create, inspect, continue, pause, resume, steer, rename, or otherwise manage a session, use the corresponding session tool. Pause affects the selected workstream and its descendants: pausing an ancestor also stops you, so you cannot then Resume yourself. Coordinate disjoint edits through messages instead of ancestor Pause.\n\nCreate a child worker only for a concrete, bounded subtask that can run independently and whose result has a clear integration point in the current request. Before spawning, decide what output you need and keep the parent's concurrent work disjoint. Do not delegate a scope that you will also perform yourself. If no useful independent work remains, continue in this session. Do not repurpose or direct an unrelated existing session unless the user explicitly asks. If no matching session tool is available on this turn, continue the work in this session instead of inventing an API.\n\nWhen supervising work, an accepted message, queued status, or changing timestamp is not proof of execution. Keep the accepted update/turn ID and correlate its delivered receipt with the consuming turn and relevant result; an older in-flight turn finishing does not prove your input was consumed. Use the receipt correlation described by the sending tool. Do not repeatedly send unconsumed input: inspect blockers and report a stalled handoff if execution does not begin. Preserve explicit human pauses and approvals.\n\nAfter spawning, keep each child id and event cursor. Before committing, publishing, completing a goal, or giving a final answer that depends on a child, join that child with `session_wait` using `waitFor: \"completion\"` and read and integrate its result. A `goal.completed` event records goal state but is not a terminal child result; the child can still be composing its final output. Do not present delegated work as incorporated until you have consumed the completed result. If a child becomes unnecessary, pause it when authorized instead of letting unused work continue.\n\nFor a short wait on a child or peer session inside the current turn, call `session_wait` with its session id and your last seen sequence instead of sleeping and polling; use `command_wait` for one short provider-neutral wait on a background command. Both time out after at most 50 seconds. Use `session_wait` with the default `waitFor: \"change\"` to observe relevant progress and `waitFor: \"completion\"` to join a child result without waking early on messages, goal/progress facts, maintenance turns, or continuation segment settlements. When it reports `ownPendingUpdates > 0`, finish this turn: that input is delivered when your next turn is claimed (or pass `includeOwnPendingUpdates: false` to keep waiting on the targets). Do not immediately repeat a timed-out short wait without new evidence. Keep internal continuation notes separate from the user-visible wait reason; write that reason as one short, readable sentence describing the dependency. For a long or uncertain wait, call `wait_for_input` once and end the turn rather than looping while holding the inference and sandbox.\n";
@@ -0,0 +1,8 @@
1
+ import type { CallModelInputFilter, ModelRequest } from "@openai/agents";
2
+ export declare function queuePreparedCompaction(agent: object, error: unknown): void;
3
+ export declare function withPreparedCompactionRequest<T>(agent: object, run: () => T): T;
4
+ /** Called after SDK sandbox preparation AND lazy-tool filtering, before transport. */
5
+ export declare function rememberPreparedModelRequest(request: ModelRequest): void;
6
+ export declare function preparedCompactionRequest(agent: object): Omit<ModelRequest, "input">;
7
+ /** Finish normal preparation, but never send ordinary inference once compaction is due. */
8
+ export declare function deferCompactionToModelBoundary(filter: CallModelInputFilter): CallModelInputFilter;
@@ -7,8 +7,8 @@ export declare class ProviderHistoryIncompatibleError extends Error {
7
7
  }
8
8
  /**
9
9
  * Build the one attempt-local history view required by the target wire API.
10
- * Canonical history remains untouched. Responses history is returned by
11
- * reference. Chat-compatible history is also returned by reference when every
10
+ * Canonical history remains untouched. SDK-unsupported developer messages use
11
+ * the Responses pass-through item. Other history is returned by reference when every
12
12
  * item is already representable by the SDK's Chat Completions converter.
13
13
  */
14
14
  export declare function projectHistoryForProvider(items: Array<Record<string, unknown>>, providerApi: HistoryProviderApi): Array<Record<string, unknown>>;
@@ -6,8 +6,7 @@ export type RuntimeSkillArtifactFile = Readonly<{
6
6
  }>;
7
7
  /**
8
8
  * One immutable Skill artifact that may be activated by an installation, a
9
- * Pack, or an exact session selection. The artifact itself is deliberately
10
- * acquisition-neutral: Packs do not own a second Skill representation.
9
+ * session selection. The artifact itself is acquisition-neutral.
11
10
  */
12
11
  export type RuntimeSkillArtifact = Readonly<{
13
12
  name: string;
@@ -22,19 +21,13 @@ export type InstalledSkillActivation = Readonly<{
22
21
  contentSha256: string;
23
22
  reason: string;
24
23
  }>;
25
- export type PackSkillActivation = Readonly<{
26
- source: "pack";
27
- id: string;
28
- artifact: RuntimeSkillArtifact;
29
- reason: string;
30
- }>;
31
24
  export type SessionSkillActivation = Readonly<{
32
25
  source: "session";
33
26
  id: string;
34
27
  artifact: RuntimeSkillArtifact;
35
28
  reason: string;
36
29
  }>;
37
- export type RuntimeSkillActivation = InstalledSkillActivation | PackSkillActivation | SessionSkillActivation;
30
+ export type RuntimeSkillActivation = InstalledSkillActivation | SessionSkillActivation;
38
31
  export type NativeToolSkillSet = Readonly<{
39
32
  /** False when an embedding host owns the complete Skill catalog and reader. */
40
33
  defaults?: boolean;
@@ -45,7 +38,7 @@ export type NativeToolSkillSet = Readonly<{
45
38
  export type EffectiveSkillSelection = Readonly<{
46
39
  id: string;
47
40
  name: string;
48
- source: "installation" | "pack" | "session" | "native_tool";
41
+ source: "installation" | "session" | "native_tool";
49
42
  version: string | null;
50
43
  contentSha256: string | null;
51
44
  reason: string;
@@ -0,0 +1,17 @@
1
+ import type { SandboxSessionLike } from "@openai/agents/sandbox";
2
+ /** Data shipped with the worker, never fetched from a package registry at turn time. */
3
+ export type ManagedCodemodeClient = {
4
+ version: 1;
5
+ files: {
6
+ ogtool: string;
7
+ "client.mjs": string;
8
+ "package.json": string;
9
+ };
10
+ };
11
+ export declare function managedCodemodeClientDigest(client: ManagedCodemodeClient): string;
12
+ export declare function managedCodemodeClientDirectory(client: ManagedCodemodeClient, workspaceRoot?: string): string;
13
+ export declare function buildManagedCodemodeClient(root: string): Promise<ManagedCodemodeClient>;
14
+ export declare function loadManagedCodemodeClient(): Promise<ManagedCodemodeClient>;
15
+ /** Immutable per-release paths permit old/new workers to share a warm box. */
16
+ export declare function installManagedCodemodeClient(session: SandboxSessionLike, client: ManagedCodemodeClient, run: (cmd: string) => Promise<unknown>, runAs?: string, workspaceRoot?: string): Promise<void>;
17
+ export declare function managedCodemodeClientEnvironment(directory: string): string[];
@@ -24,8 +24,8 @@ export declare function codemodeTokenFileFromEnvironment(environment: Readonly<R
24
24
  * Per-command export makes a resumed box use the current route without an
25
25
  * illegal live-manifest environment mutation.
26
26
  */
27
- export declare function withCodemodeTokenEnvironment(cmd: string, tokenFile: string, codemodeUrl?: string): string;
27
+ export declare function withCodemodeTokenEnvironment(cmd: string, tokenFile: string, codemodeUrl?: string, clientDirectory?: string): string;
28
28
  /** Preserve provider identity/capabilities while decorating command creation. */
29
- export declare function withCodemodeTokenSession<T extends object>(session: T, tokenFile: string, codemodeUrl?: string): T;
29
+ export declare function withCodemodeTokenSession<T extends object>(session: T, tokenFile: string, codemodeUrl?: string, clientDirectory?: string): T;
30
30
  /** Decorate every client-created/resumed session with one session pointer. */
31
- export declare function withCodemodeTokenClient(client: SandboxClient, tokenFile: string, codemodeUrl?: string): SandboxClient;
31
+ export declare function withCodemodeTokenClient(client: SandboxClient, tokenFile: string, codemodeUrl?: string, clientDirectory?: string): SandboxClient;
@@ -9,6 +9,7 @@ import { type WorkspaceArchiveDescriptor } from "./workspace-archive.js";
9
9
  import type { RuntimeMetricsHooks } from "../metrics.js";
10
10
  import type { ExposedPortEndpoint } from "./stream-port.js";
11
11
  export { collectSandboxEnvironment, parseExposedPorts } from "@opengeni/config";
12
+ export { SandboxMaterializationVerificationError, materializationVerificationDiagnostic, type MaterializationFailureReason, type MaterializationVerificationDiagnostic, } from "./materialization-verification-error.js";
12
13
  export { sendCommandInput, type CommandInputSession } from "./command-input.js";
13
14
  export { OpStreamExecClient, type OpStreamOutputFrame } from "./selfhosted/op-stream.js";
14
15
  export { repairSerializedRunStateExposedPorts, runStateCompatibilityProvider, runStateExposedPortsRecord, type RunStateExposedPortsCompatibilityRepair, type RunStateExposedPortsCompatibilityResult, } from "./run-state-compat.js";
@@ -47,7 +48,7 @@ export { nextDurableOpId, runWithToolCallCorrelation, sanitizeOpIdToken } from "
47
48
  export { negotiateSelfhostedCapabilities, selfhostedLiveness, selfhostedHeartbeatLiveness, SELFHOSTED_RECONNECT_WINDOW_MS, type SelfhostedNegotiationInput, type SelfhostedLivenessState, type SelfhostedEnrollment, } from "./selfhosted/capabilities.js";
48
49
  export { MockAgentResponder, type MockAgentResponderOptions, type MockExecHandler, } from "./selfhosted/testing.js";
49
50
  export { createMockSelfhostedOpStream, FakeOpRunner, type FakeOpScript, InMemoryOpStreamTransport, } from "./selfhosted/op-testing.js";
50
- export { isRoutingMutationOutcomeUnknownError, RoutingBackendRecoveryRequiredError, RoutingMutationOutcomeUnknownError, RoutingRetainedProcessNotFoundError, RoutingSandboxSession, RoutingWorkspaceRootChangedError, RoutingActiveRouteChangedError, RoutingUnsupportedError, type ActivePointer, type DefaultBackendLossResult, type RoutableBackendSession, type ResolvedActiveBackend, type RoutingMutationSettlementResult, type RoutingSandboxFirstOperationObservation, type RoutingSandboxFirstOperationObserver, type RoutingSandboxFirstOperationPhase, type RoutingSandboxFirstOperationPhaseObservation, type RoutingSandboxOperationObservation, type RoutingSandboxOperationObserver, type RoutingSandboxPhaseOutcome, type RoutingSandboxWaitObservation, type RoutingRetainedProcess, type RoutingRetainedProcessAdoption, type RoutingRetainedProcessTerminalProof, type RoutingSandboxSessionDeps, type RoutingTransitionEvent, } from "./routing/routing-session.js";
51
+ export { isRoutingMutationOutcomeUnknownError, RoutingBackendRecoveryRequiredError, RoutingMutationOutcomeUnknownError, RoutingRetainedProcessNotFoundError, RoutingSandboxSession, RoutingWorkspaceRootChangedError, RoutingActiveRouteChangedError, RoutingUnsupportedError, type ActivePointer, type DefaultBackendLossResult, type RoutableBackendSession, type ResolvedActiveBackend, type RoutingMutationSettlementResult, type RoutingSandboxFirstOperationObservation, type RoutingSandboxFirstOperationObserver, type RoutingSandboxFirstOperationPhase, type RoutingSandboxFirstOperationPhaseObservation, type RoutingSandboxOperationObservation, type RoutingSandboxOperationObserver, type RoutingSandboxCaptureWaitObserver, type RoutingSandboxPhaseOutcome, type RoutingSandboxWaitObservation, type RoutingRetainedProcess, type RoutingRetainedProcessAdoption, type RoutingRetainedProcessTerminalProof, type RoutingSandboxSessionDeps, type RoutingTransitionEvent, } from "./routing/routing-session.js";
51
52
  export { makeActiveBackendResolver, ActiveBackendUnresolvableError, swapTargetEstablishability, type ActiveBackendResolverDeps, type RoutableSandbox, type BackendUnresolvableCode, type SwapTargetEstablishability, } from "./routing/backend-resolver.js";
52
53
  /**
53
54
  * Construct the raw provider SandboxClient for the configured backend. Registry-
@@ -77,6 +77,7 @@ import {
77
77
  SandboxExactResumeInstanceUnavailableError,
78
78
  SandboxExactResumeReplacedError,
79
79
  SandboxExecReadinessError,
80
+ SandboxMaterializationVerificationError,
80
81
  SandboxProviderContinuityUnavailableError,
81
82
  SandboxProviderUnavailableError,
82
83
  SandboxReplacementProviderStateError,
@@ -168,6 +169,7 @@ import {
168
169
  isWindowsConnectedMachinePath,
169
170
  joinExposedPortPath,
170
171
  makeActiveBackendResolver,
172
+ materializationVerificationDiagnostic,
171
173
  materializeRunCredentials,
172
174
  mintSandboxCodemodeToken,
173
175
  mintStreamToken,
@@ -267,8 +269,10 @@ import {
267
269
  withRunCredentialsClient,
268
270
  withRunCredentialsSession,
269
271
  withoutSandboxProviderIdentity
270
- } from "../chunk-46BFUGFL.js";
271
- import "../chunk-FHGLYLBL.js";
272
+ } from "../chunk-WIHICNWS.js";
273
+ import "../chunk-SPT3PLMX.js";
274
+ import "../chunk-4A4XTKKX.js";
275
+ import "../chunk-ZG2YH25H.js";
272
276
  import "../chunk-UNICCRW5.js";
273
277
  import "../chunk-PZ5AY32C.js";
274
278
  export {
@@ -350,6 +354,7 @@ export {
350
354
  SandboxExactResumeInstanceUnavailableError,
351
355
  SandboxExactResumeReplacedError,
352
356
  SandboxExecReadinessError,
357
+ SandboxMaterializationVerificationError,
353
358
  SandboxProviderContinuityUnavailableError,
354
359
  SandboxProviderUnavailableError,
355
360
  SandboxReplacementProviderStateError,
@@ -441,6 +446,7 @@ export {
441
446
  isWindowsConnectedMachinePath,
442
447
  joinExposedPortPath,
443
448
  makeActiveBackendResolver,
449
+ materializationVerificationDiagnostic,
444
450
  materializeRunCredentials,
445
451
  mintSandboxCodemodeToken,
446
452
  mintStreamToken,
@@ -0,0 +1,27 @@
1
+ export type MaterializationFailureReason = "path_not_visible" | "command_failed" | "command_pending" | "invalid_response" | "command_error";
2
+ /** Exact diagnostics belong only in authenticated durable session events.
3
+ * Metrics receive the closed reason vocabulary, never paths or provider output. */
4
+ export type MaterializationVerificationDiagnostic = {
5
+ reason: MaterializationFailureReason;
6
+ path: string;
7
+ workdir: string;
8
+ command: string;
9
+ output: string | null;
10
+ exitCode: number | null;
11
+ providerSessionId: number | null;
12
+ /** Exact ephemeral read-only probe identity, never a retained command alias. */
13
+ providerExecution?: {
14
+ sandboxId: string;
15
+ taskId: string;
16
+ execId: string;
17
+ };
18
+ causeMessage?: string;
19
+ };
20
+ export declare class SandboxMaterializationVerificationError extends Error {
21
+ readonly diagnostic: MaterializationVerificationDiagnostic;
22
+ readonly code = "sandbox_materialization_verification_failed";
23
+ constructor(diagnostic: MaterializationVerificationDiagnostic, options?: ErrorOptions);
24
+ }
25
+ /** Keep cancellation, route-loss, and provider retry identities unchanged. */
26
+ export declare function retainMaterializationVerificationDiagnostic(error: unknown, diagnostic: MaterializationVerificationDiagnostic): void;
27
+ export declare function materializationVerificationDiagnostic(error: unknown): MaterializationVerificationDiagnostic | undefined;