@opengeni/runtime 6.5.2-canary.41607687019001 → 6.7.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 (60) hide show
  1. package/dist/agent-instructions/modules/subagents.d.ts +4 -1
  2. package/dist/agent-instructions/tool-availability.d.ts +12 -0
  3. package/dist/agent-instructions/types.d.ts +16 -2
  4. package/dist/assets/codemode-client.json +1 -1
  5. package/dist/{chunk-HYSMFK7K.js → chunk-3MNZZ2B4.js} +34 -12
  6. package/dist/chunk-3MNZZ2B4.js.map +1 -0
  7. package/dist/{chunk-PZPM6Z62.js → chunk-77NQGL66.js} +4 -2
  8. package/dist/chunk-77NQGL66.js.map +1 -0
  9. package/dist/{chunk-AE7DWNDQ.js → chunk-FNAYH3SN.js} +572 -278
  10. package/dist/chunk-FNAYH3SN.js.map +1 -0
  11. package/dist/{chunk-RYNEQOTX.js → chunk-GFAFQMZV.js} +3 -3
  12. package/dist/{chunk-ZNFEE7S5.js → chunk-JF5UTPEU.js} +2 -2
  13. package/dist/{chunk-GRNURW7Y.js → chunk-JY5NSZ37.js} +294 -36
  14. package/dist/chunk-JY5NSZ37.js.map +1 -0
  15. package/dist/{chunk-XXCIHKHP.js → chunk-OAW6MMSY.js} +3 -3
  16. package/dist/{chunk-F62XZWUW.js → chunk-RZJXTSVA.js} +2 -2
  17. package/dist/command-completion-delivery.d.ts +130 -0
  18. package/dist/gmail-rest-mcp.js +3 -3
  19. package/dist/google-calendar-rest-mcp.js +2 -2
  20. package/dist/index.d.ts +8 -0
  21. package/dist/index.js +20 -8
  22. package/dist/interaction-tools.d.ts +9 -0
  23. package/dist/lazy-tool-transport.d.ts +2 -0
  24. package/dist/metrics.d.ts +9 -0
  25. package/dist/model-call.js +1 -1
  26. package/dist/provider-history-adapter.d.ts +6 -0
  27. package/dist/provider-invalid-request.d.ts +16 -0
  28. package/dist/provider-tool-names.d.ts +54 -0
  29. package/dist/sandbox/index.js +2 -2
  30. package/dist/sandbox/providers/modal-command-router-wire.d.ts +2 -0
  31. package/dist/slack-rest-mcp.js +3 -3
  32. package/dist/workspace-tool-gateway.js +8 -8
  33. package/package.json +16 -17
  34. package/src/agent-instructions/PROMPT_CHANGELOG.md +75 -3
  35. package/src/agent-instructions/modules/subagents.ts +43 -30
  36. package/src/agent-instructions/runtime-mechanics.ts +20 -2
  37. package/src/agent-instructions/tool-availability.ts +23 -2
  38. package/src/agent-instructions/types.ts +16 -2
  39. package/src/anthropic-messages.ts +4 -1
  40. package/src/command-completion-delivery.ts +388 -0
  41. package/src/index.ts +47 -7
  42. package/src/interaction-tools.ts +19 -2
  43. package/src/lazy-tool-transport.ts +48 -2
  44. package/src/metrics.ts +5 -0
  45. package/src/model-provider-client.ts +20 -0
  46. package/src/model-provider-routing.ts +2 -0
  47. package/src/provider-history-adapter.ts +23 -2
  48. package/src/provider-invalid-request.ts +77 -0
  49. package/src/provider-tool-names.ts +340 -0
  50. package/src/sandbox/providers/modal-command-control.ts +2 -1
  51. package/src/sandbox/providers/modal-command-router-wire.ts +3 -1
  52. package/src/sandbox/providers/modal-command-session.ts +54 -11
  53. package/dist/chunk-AE7DWNDQ.js.map +0 -1
  54. package/dist/chunk-GRNURW7Y.js.map +0 -1
  55. package/dist/chunk-HYSMFK7K.js.map +0 -1
  56. package/dist/chunk-PZPM6Z62.js.map +0 -1
  57. /package/dist/{chunk-RYNEQOTX.js.map → chunk-GFAFQMZV.js.map} +0 -0
  58. /package/dist/{chunk-ZNFEE7S5.js.map → chunk-JF5UTPEU.js.map} +0 -0
  59. /package/dist/{chunk-XXCIHKHP.js.map → chunk-OAW6MMSY.js.map} +0 -0
  60. /package/dist/{chunk-F62XZWUW.js.map → chunk-RZJXTSVA.js.map} +0 -0
@@ -14,6 +14,7 @@ import {
14
14
  DockerSandboxSession,
15
15
  E2BSandboxClient,
16
16
  MAX_PROVIDER_COMMAND_HANDLE,
17
+ MODAL_ROUTER_READ_MAX_WAIT_MS,
17
18
  MODAL_ROUTER_READ_PAGE_BYTES,
18
19
  MOUNT_MANIFEST_METADATA_SUPPORT,
19
20
  ModalCommandRouterWire,
@@ -106,7 +107,7 @@ import {
106
107
  withNativeSynchronousCommandCollection,
107
108
  withProviderError,
108
109
  withSandboxProviderCapture
109
- } from "./chunk-PZPM6Z62.js";
110
+ } from "./chunk-77NQGL66.js";
110
111
  import {
111
112
  applyLocalSourceManifestEntryToState,
112
113
  applyLocalSourceManifestToState,
@@ -8220,6 +8221,11 @@ function sameExecution(a, b) {
8220
8221
  "supervision" in b ? b.supervision : void 0
8221
8222
  ) && Boolean(a.pty) === Boolean(b.pty);
8222
8223
  }
8224
+ var SLICE_PAUSE_MS = 25;
8225
+ function unchangedCursor(page) {
8226
+ const { command, expected } = page;
8227
+ return command.kind === "modal-router-v1" && expected?.kind === "modal-router-v1" && command.streams.stdout.byteOffset === expected.streams.stdout.byteOffset && command.streams.stderr.byteOffset === expected.streams.stderr.byteOffset && command.streams.stdout.utf8Remainder === expected.streams.stdout.utf8Remainder && command.streams.stderr.utf8Remainder === expected.streams.stderr.utf8Remainder;
8228
+ }
8223
8229
  function installModalCommandSession(session, control) {
8224
8230
  markTypedExecHandleLoss(session);
8225
8231
  const originalExec = session.execCommand?.bind(session);
@@ -8324,17 +8330,33 @@ function installModalCommandSession(session, control) {
8324
8330
  entry.command = retained;
8325
8331
  await supervise(entry).catch(() => void 0);
8326
8332
  }
8327
- let page = await control.read(entry.command, yieldTimeMs, signal);
8328
- if (entry.persistence && page.command.kind === "modal-router-v1") {
8329
- let captured = false;
8330
- for (let attempt = 0; attempt < 3; attempt++) {
8331
- if (await captureRouterPage(entry, page)) {
8332
- captured = true;
8333
- break;
8333
+ const deadline = performance.now() + yieldTimeMs;
8334
+ const readSlice = () => control.read(
8335
+ entry.command,
8336
+ Math.min(
8337
+ MODAL_ROUTER_READ_MAX_WAIT_MS,
8338
+ Math.max(0, Math.ceil(deadline - performance.now()))
8339
+ ),
8340
+ signal
8341
+ );
8342
+ let page;
8343
+ while (true) {
8344
+ page = await readSlice();
8345
+ if (entry.persistence && page.command.kind === "modal-router-v1") {
8346
+ let captured = false;
8347
+ for (let attempt = 0; attempt < 3; attempt++) {
8348
+ if (await captureRouterPage(entry, page)) {
8349
+ captured = true;
8350
+ break;
8351
+ }
8352
+ if (attempt < 2) page = await readSlice();
8334
8353
  }
8335
- if (attempt < 2) page = await control.read(entry.command, yieldTimeMs, signal);
8354
+ if (!captured)
8355
+ throw new Error("Modal command output cursor changed during bounded capture");
8336
8356
  }
8337
- if (!captured) throw new Error("Modal command output cursor changed during bounded capture");
8357
+ if (page.exitCode !== null || page.chunks.length > 0 || !unchangedCursor(page) || deadline - performance.now() <= SLICE_PAUSE_MS)
8358
+ break;
8359
+ await new Promise((resolve4) => setTimeout(resolve4, SLICE_PAUSE_MS));
8338
8360
  }
8339
8361
  if (page.command.kind === "modal-router-v1" && page.command.supervision) {
8340
8362
  const receipt = await entry.persistence?.loadSupervisionReceipt?.();
@@ -9192,7 +9214,7 @@ var ModalCommandControl = class _ModalCommandControl {
9192
9214
  const command = structuredClone(ModalRouterProviderCommand2.parse(input));
9193
9215
  if (command.sandboxId !== this.sandboxId)
9194
9216
  throw new Error("Modal command does not belong to this sandbox");
9195
- if (!Number.isFinite(waitMs) || waitMs < 0 || waitMs > 5e4)
9217
+ if (!Number.isFinite(waitMs) || waitMs < 0 || waitMs > MODAL_ROUTER_READ_MAX_WAIT_MS)
9196
9218
  throw new Error("Invalid Modal output read bounds");
9197
9219
  signal?.throwIfAborted();
9198
9220
  const stdout = command.streams.stdout;
@@ -19183,4 +19205,4 @@ export {
19183
19205
  collectSandboxEnvironment2 as collectSandboxEnvironment,
19184
19206
  parseExposedPorts2 as parseExposedPorts
19185
19207
  };
19186
- //# sourceMappingURL=chunk-HYSMFK7K.js.map
19208
+ //# sourceMappingURL=chunk-3MNZZ2B4.js.map