@opengeni/runtime 4.3.0-canary.36855269964001 → 4.3.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 (51) hide show
  1. package/dist/assets/codemode-client.json +1 -1
  2. package/dist/{chunk-PEEYZDLS.js → chunk-22M75RJF.js} +622 -890
  3. package/dist/chunk-22M75RJF.js.map +1 -0
  4. package/dist/{chunk-BK3S65CI.js → chunk-JUFVYQCY.js} +13 -91
  5. package/dist/chunk-JUFVYQCY.js.map +1 -0
  6. package/dist/claude-subscription-usage.d.ts +1 -3
  7. package/dist/index.d.ts +1 -7
  8. package/dist/index.js +2 -8
  9. package/dist/input-wait-yield.d.ts +0 -4
  10. package/dist/mcp-run-credentials.d.ts +2 -3
  11. package/dist/model-preparation-diagnostics.d.ts +0 -9
  12. package/dist/model-provider-routing.d.ts +0 -4
  13. package/dist/model-provider.d.ts +0 -1
  14. package/dist/model-request-capture.d.ts +0 -9
  15. package/dist/replayable-json-body.d.ts +1 -2
  16. package/dist/sandbox/index.d.ts +1 -1
  17. package/dist/sandbox/index.js +1 -3
  18. package/dist/sandbox/provider-command-session.d.ts +0 -6
  19. package/dist/sandbox/providers/modal-command-router-wire.d.ts +0 -5
  20. package/dist/sandbox/routing/routing-session.d.ts +4 -5
  21. package/dist/workspace-tool-gateway.js +2 -2
  22. package/package.json +12 -12
  23. package/src/bundled_default_skills/opengeni-client/SKILL.md +0 -5
  24. package/src/bundled_default_skills/opengeni-client/references/api-workflows.md +0 -8
  25. package/src/bundled_default_skills/opengeni-client/references/product-shapes-and-ui.md +3 -16
  26. package/src/claude-subscription-usage.ts +4 -23
  27. package/src/index.ts +2 -29
  28. package/src/input-wait-yield.ts +0 -7
  29. package/src/interaction-tools.ts +2 -12
  30. package/src/lazy-tool-transport.ts +14 -22
  31. package/src/mcp-run-credentials.ts +3 -18
  32. package/src/model-preparation-diagnostics.ts +1 -48
  33. package/src/model-provider-client.ts +1 -5
  34. package/src/model-provider-routing.ts +1 -95
  35. package/src/model-provider.ts +0 -1
  36. package/src/model-request-capture.ts +1 -28
  37. package/src/provider-history-adapter.ts +3 -24
  38. package/src/replayable-json-body.ts +2 -19
  39. package/src/sandbox/index.ts +0 -1
  40. package/src/sandbox/provider-command-session.ts +0 -12
  41. package/src/sandbox/providers/modal-command-control.ts +8 -14
  42. package/src/sandbox/providers/modal-command-router-wire.ts +3 -20
  43. package/src/sandbox/providers/modal-command-session.ts +0 -11
  44. package/src/sandbox/providers/modal.ts +1 -5
  45. package/src/sandbox/routing/routing-session.ts +6 -61
  46. package/src/sandbox/turn-tool-cancellation.ts +1 -8
  47. package/dist/chunk-BK3S65CI.js.map +0 -1
  48. package/dist/chunk-PEEYZDLS.js.map +0 -1
  49. package/dist/responses-terminal-error.d.ts +0 -17
  50. package/src/bundled_default_skills/opengeni-client/references/usage-allowances.md +0 -189
  51. package/src/responses-terminal-error.ts +0 -136
@@ -16057,13 +16057,6 @@ var ProviderCommandStartRejectedError = class extends Error {
16057
16057
  this.name = "ProviderCommandStartRejectedError";
16058
16058
  }
16059
16059
  };
16060
- var ProviderCommandStartOutcomeUnknownError = class extends Error {
16061
- constructor(command, cause) {
16062
- super("Provider command Start outcome is unknown; the invocation was not replayed", { cause });
16063
- this.command = command;
16064
- this.name = "ProviderCommandStartOutcomeUnknownError";
16065
- }
16066
- };
16067
16060
  var admission = new AsyncLocalStorage2();
16068
16061
  var pendingSupervision = new AsyncLocalStorage2();
16069
16062
  function withPendingCommandSupervision(state, fn) {
@@ -16159,14 +16152,6 @@ var ModalCommandStartPreDispatchUnavailableError = class _ModalCommandStartPreDi
16159
16152
  });
16160
16153
  }
16161
16154
  };
16162
- var ModalCommandStartNotDispatchedError = class extends Error {
16163
- constructor(cause) {
16164
- super(cause instanceof Error ? cause.message : "Modal command Start was never dispatched", {
16165
- cause
16166
- });
16167
- this.name = "ModalCommandStartNotDispatchedError";
16168
- }
16169
- };
16170
16155
  function encode(type, value) {
16171
16156
  const codec = modalRouterWire.lookupType(type);
16172
16157
  return Buffer.from(codec.encode(codec.fromObject(value)).finish());
@@ -16224,18 +16209,12 @@ var ModalCommandRouterWire = class {
16224
16209
  });
16225
16210
  }
16226
16211
  async start(request, signal) {
16212
+ if (this.closed) throw new Error("Modal command router is closed");
16227
16213
  try {
16228
- if (this.closed) throw new Error("Modal command router is closed");
16229
16214
  await ModalCommandStartPreDispatchUnavailableError.ensureReady(this.client, signal);
16230
- signal?.throwIfAborted();
16231
- if (this.closed) throw new Error("Modal command router is closed");
16232
16215
  } catch (error) {
16233
- if (this.closed)
16234
- throw new ModalCommandStartNotDispatchedError(
16235
- new Error("Modal command router is closed", { cause: error })
16236
- );
16237
- if (error instanceof ModalCommandStartPreDispatchUnavailableError) throw error;
16238
- throw new ModalCommandStartNotDispatchedError(error);
16216
+ if (this.closed) throw new Error("Modal command router is closed", { cause: error });
16217
+ throw error;
16239
16218
  }
16240
16219
  try {
16241
16220
  await this.unary(
@@ -16902,10 +16881,6 @@ var RoutingRetainedProcessNotFoundError = class extends Error {
16902
16881
  name = "RoutingRetainedProcessNotFoundError";
16903
16882
  retryable = false;
16904
16883
  };
16905
- function renderRoutingMutationOutcomeUnknownToolResult(error) {
16906
- const locator = error.retainedProcess ? ` Inspect the exact invocation with write_stdin using session_id ${error.retainedProcess.providerSessionId} and empty chars.` : " Inspect state before deciding how to proceed.";
16907
- return `Sandbox operation outcome unknown; the operation was not replayed. Do not blindly retry the command.${locator} Error: ${error}`;
16908
- }
16909
16884
  function isFenceError(error) {
16910
16885
  if (!error || typeof error !== "object") {
16911
16886
  return false;
@@ -17274,8 +17249,7 @@ var RoutingSandboxSession = class {
17274
17249
  { cause: error }
17275
17250
  );
17276
17251
  }
17277
- if (pending.result !== void 0)
17278
- await this.captureRetainedOutput(record, formatExecResult(pending.result));
17252
+ await this.captureRetainedOutput(record, formatExecResult(pending.result));
17279
17253
  }
17280
17254
  confirmDurableRejectedPromotion(record, result) {
17281
17255
  if (result.status !== "retained_process_durable_output_rejected" || result.retainedProcess.id !== record.process.id || result.retainedProcess.providerSessionId !== record.process.providerSessionId) {
@@ -17814,43 +17788,8 @@ var RoutingSandboxSession = class {
17814
17788
  );
17815
17789
  }
17816
17790
  } catch (error) {
17817
- if (!reservedProcess && error instanceof ProviderCommandStartOutcomeUnknownError && mutatesWorkspace && this.deps.afterMutation) {
17818
- const handle = this.deps.providerCommandHandle?.(admission2);
17819
- if (!handle) throw error;
17820
- const process2 = {
17821
- id: crypto.randomUUID(),
17822
- providerSessionId: handle,
17823
- providerCommand: error.command
17824
- };
17825
- const record = this.registerRetainedProcess(process2, backend);
17826
- const settlement = {
17827
- op,
17828
- backend,
17829
- admission: admission2,
17830
- outcome: "outcome_unknown",
17831
- retainedProcess: process2
17832
- };
17833
- record.pendingParentPromotion = settlement;
17834
- try {
17835
- const rejected = await this.deps.afterMutation(settlement);
17836
- if (rejected) this.confirmDurableRejectedPromotion(record, rejected);
17837
- else record.durable = true;
17838
- record.pendingParentPromotion = null;
17839
- } catch (cause) {
17840
- throw new RoutingMutationOutcomeUnknownError(
17841
- op,
17842
- "Command Start outcome is unknown and exact invocation promotion remains unresolved; it was not replayed",
17843
- { cause: new AggregateError([error, cause]), retainedProcess: process2 }
17844
- );
17845
- }
17846
- throw new RoutingMutationOutcomeUnknownError(
17847
- op,
17848
- "Command Start outcome is unknown; its exact invocation is retained and was not replayed",
17849
- { cause: error, retainedProcess: process2 }
17850
- );
17851
- }
17852
17791
  if (reservedProcess) {
17853
- if ((error instanceof ProviderCommandStartRejectedError || error instanceof ModalCommandStartNotDispatchedError || error instanceof ModalCommandStartPreDispatchUnavailableError) && reservedProcess.providerCommand?.kind === "modal-router-v1") {
17792
+ if ((error instanceof ProviderCommandStartRejectedError || error instanceof ModalCommandStartPreDispatchUnavailableError) && reservedProcess.providerCommand?.kind === "modal-router-v1") {
17854
17793
  const persistence = this.deps.providerCommandPersistence?.(reservedProcess);
17855
17794
  if (persistence?.rejectSupervisedLaunch) {
17856
17795
  try {
@@ -19083,8 +19022,6 @@ Output:
19083
19022
  }
19084
19023
  } catch {
19085
19024
  }
19086
- if (error instanceof RoutingMutationOutcomeUnknownError)
19087
- return renderRoutingMutationOutcomeUnknownToolResult(error);
19088
19025
  const details = error instanceof Error ? error.toString() : String(error);
19089
19026
  return `An error occurred while running the tool. Please try again. Error: ${details}`;
19090
19027
  }
@@ -19538,8 +19475,6 @@ var TurnToolCancellationControllerImpl = class {
19538
19475
  });
19539
19476
  }
19540
19477
  pendingStart?.settle();
19541
- if (error instanceof RoutingMutationOutcomeUnknownError)
19542
- return renderRoutingMutationOutcomeUnknownToolResult(error);
19543
19478
  throw error;
19544
19479
  } finally {
19545
19480
  remoteExec?.settle();
@@ -23494,16 +23429,6 @@ function installModalCommandSession(session, control) {
23494
23429
  exitCode: null
23495
23430
  });
23496
23431
  }
23497
- } catch (error) {
23498
- if (error instanceof ProviderCommandStartOutcomeUnknownError) {
23499
- const entry = entries.get(handle);
23500
- if (entry && !sameExecution(entry.command, error.command))
23501
- throw new Error("Reserved Modal command changed during failed dispatch", {
23502
- cause: error
23503
- });
23504
- entries.set(handle, entry ?? { command: error.command });
23505
- }
23506
- throw error;
23507
23432
  } finally {
23508
23433
  pendingStarts.delete(cancellation);
23509
23434
  }
@@ -24007,11 +23932,11 @@ var ModalCommandControl2 = class _ModalCommandControl {
24007
23932
  }
24008
23933
  };
24009
23934
  if (supervision) await reserveSupervisedLaunch(command);
24010
- let startAttempted = false;
24011
23935
  try {
24012
- await this.withRouter(taskId, signal, async (router) => {
24013
- startAttempted = true;
24014
- await router.start(
23936
+ await this.withRouter(
23937
+ taskId,
23938
+ signal,
23939
+ (router) => router.start(
24015
23940
  {
24016
23941
  taskId,
24017
23942
  execId,
@@ -24030,12 +23955,11 @@ var ModalCommandControl2 = class _ModalCommandControl {
24030
23955
  } : {}
24031
23956
  },
24032
23957
  signal
24033
- );
24034
- });
23958
+ )
23959
+ );
24035
23960
  } catch (error) {
24036
- if (!startAttempted || error instanceof ModalCommandStartNotDispatchedError || error instanceof ModalCommandStartRejectedError || error instanceof ModalCommandStartPreDispatchUnavailableError)
23961
+ if (!supervision || error instanceof ModalCommandStartRejectedError || error instanceof ModalCommandStartPreDispatchUnavailableError)
24037
23962
  throw error;
24038
- throw new ProviderCommandStartOutcomeUnknownError(command, error);
24039
23963
  }
24040
23964
  return command;
24041
23965
  }
@@ -24669,7 +24593,6 @@ function isModalTaskExecStartPreDispatchUnavailableError(error) {
24669
24593
  try {
24670
24594
  const record = current.value;
24671
24595
  if (isRoutingMutationOutcomeUnknownError(current.value)) return false;
24672
- if (current.value instanceof ModalCommandStartNotDispatchedError) return false;
24673
24596
  if (hasContradictoryModalHttpStatus(record)) return false;
24674
24597
  if (current.value instanceof ModalCommandStartPreDispatchUnavailableError) {
24675
24598
  matchingLeaves += 1;
@@ -40051,7 +39974,6 @@ export {
40051
39974
  RoutingMutationOutcomeUnknownError,
40052
39975
  isRoutingMutationOutcomeUnknownError,
40053
39976
  RoutingRetainedProcessNotFoundError,
40054
- renderRoutingMutationOutcomeUnknownToolResult,
40055
39977
  RoutingSandboxSession,
40056
39978
  ModalCloudBucketMountStrategy,
40057
39979
  captureWorkspaceArchiveForStorage,
@@ -40257,4 +40179,4 @@ export {
40257
40179
  collectSandboxEnvironment2 as collectSandboxEnvironment,
40258
40180
  parseExposedPorts2 as parseExposedPorts
40259
40181
  };
40260
- //# sourceMappingURL=chunk-BK3S65CI.js.map
40182
+ //# sourceMappingURL=chunk-JUFVYQCY.js.map