@opengeni/runtime 4.0.1 → 4.0.3-canary.36199476632001

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 (61) hide show
  1. package/dist/{agent-RJQLKFIW.js → agent-ME6HT4DH.js} +2 -2
  2. package/dist/assets/codemode-client.json +1 -1
  3. package/dist/browser-action-json-schema.d.ts +4 -0
  4. package/dist/{chunk-J5AR5XAJ.js → chunk-FAFZCSN7.js} +695 -210
  5. package/dist/chunk-FAFZCSN7.js.map +1 -0
  6. package/dist/{chunk-ZG2YH25H.js → chunk-JAYHA6BF.js} +2 -2
  7. package/dist/{chunk-UNICCRW5.js → chunk-LZIXCZUV.js} +6 -3
  8. package/dist/{chunk-UNICCRW5.js.map → chunk-LZIXCZUV.js.map} +1 -1
  9. package/dist/{chunk-J6J3VYFW.js → chunk-P4V7JGQ2.js} +1037 -105
  10. package/dist/chunk-P4V7JGQ2.js.map +1 -0
  11. package/dist/{chunk-SPT3PLMX.js → chunk-PRHMSM6C.js} +2 -2
  12. package/dist/codex-tool-search.d.ts +12 -0
  13. package/dist/context-compaction.d.ts +4 -2
  14. package/dist/index.d.ts +27 -8
  15. package/dist/index.js +23 -7
  16. package/dist/interaction-tools.d.ts +1 -1
  17. package/dist/{lazy-manifest-OEYEHNVY.js → lazy-manifest-GCGUFIWP.js} +3 -3
  18. package/dist/{localSources-TWHTEKGO.js → localSources-FDH65AFI.js} +4 -4
  19. package/dist/metrics.d.ts +17 -0
  20. package/dist/model-provider-routing.d.ts +14 -0
  21. package/dist/operational-instructions.d.ts +1 -1
  22. package/dist/provider-quota.d.ts +76 -0
  23. package/dist/sandbox/browser-control-client.d.ts +28 -1
  24. package/dist/sandbox/channel-a.d.ts +43 -0
  25. package/dist/sandbox/index.d.ts +3 -3
  26. package/dist/sandbox/index.js +10 -6
  27. package/dist/sandbox/providers/modal-command-router-wire.d.ts +8 -0
  28. package/dist/sandbox/providers/modal.d.ts +5 -6
  29. package/dist/workspace-tool-gateway.js +5 -5
  30. package/package.json +11 -11
  31. package/src/browser-action-json-schema.ts +10 -0
  32. package/src/bundled_artifact_skills/opengeni-documents/SKILL.md +4 -1
  33. package/src/bundled_artifact_skills/opengeni-documents/references/api.md +20 -0
  34. package/src/bundled_default_skills/opengeni-client/SKILL.md +4 -1
  35. package/src/bundled_default_skills/opengeni-client/references/discovery-and-autonomy.md +31 -0
  36. package/src/bundled_default_skills/opengeni-client/references/runtime-profile-and-verification.md +32 -0
  37. package/src/codex-tool-search.ts +54 -6
  38. package/src/context-compaction.ts +19 -3
  39. package/src/index.ts +285 -56
  40. package/src/interaction-tools.ts +656 -48
  41. package/src/lazy-tool-transport.ts +4 -0
  42. package/src/metrics.ts +26 -0
  43. package/src/model-context-inspector.ts +1 -0
  44. package/src/model-provider-client.ts +37 -16
  45. package/src/model-provider-routing.ts +32 -6
  46. package/src/operational-instructions.ts +1 -1
  47. package/src/provider-quota.ts +412 -0
  48. package/src/sandbox/browser-control-client.ts +241 -26
  49. package/src/sandbox/channel-a.ts +370 -0
  50. package/src/sandbox/index.ts +6 -1
  51. package/src/sandbox/providers/modal-command-control.ts +7 -1
  52. package/src/sandbox/providers/modal-command-router-wire.ts +47 -6
  53. package/src/sandbox/providers/modal.ts +16 -24
  54. package/src/sandbox/routing/routing-session.ts +29 -6
  55. package/dist/chunk-J5AR5XAJ.js.map +0 -1
  56. package/dist/chunk-J6J3VYFW.js.map +0 -1
  57. /package/dist/{agent-RJQLKFIW.js.map → agent-ME6HT4DH.js.map} +0 -0
  58. /package/dist/{chunk-ZG2YH25H.js.map → chunk-JAYHA6BF.js.map} +0 -0
  59. /package/dist/{chunk-SPT3PLMX.js.map → chunk-PRHMSM6C.js.map} +0 -0
  60. /package/dist/{lazy-manifest-OEYEHNVY.js.map → lazy-manifest-GCGUFIWP.js.map} +0 -0
  61. /package/dist/{localSources-TWHTEKGO.js.map → localSources-FDH65AFI.js.map} +0 -0
@@ -27,7 +27,10 @@
27
27
  // real `readActiveSandbox` DAO + a backend resolver without coupling the leaf to
28
28
  // `@opengeni/db`.
29
29
 
30
+ import { SandboxWorkspaceReadNotFoundError } from "@openai/agents/sandbox";
31
+ import { SandboxFilesystemNotFoundError } from "modal";
30
32
  import type { ExposedPortEndpoint } from "../stream-port";
33
+ import { ModalCommandStartPreDispatchUnavailableError } from "../providers/modal-command-router-wire";
31
34
  import { isDeepStrictEqual } from "node:util";
32
35
  import {
33
36
  withProviderCommandHandle,
@@ -373,6 +376,22 @@ export type RoutingSandboxFirstOperationObserver = (
373
376
 
374
377
  type RoutingSandboxFirstOperationTiming = Pick<RoutingSandboxFirstOperationObservation, "phases">;
375
378
 
379
+ const READ_ONLY_PATH_PROBE_OPERATIONS = new Set(["readFile", "listDir", "pathExists", "viewImage"]);
380
+
381
+ /** A definite path miss is the provider's authoritative answer to a read-only
382
+ * probe (repository skill discovery lists absent `.agents/skills` on almost
383
+ * every turn), not a failed provider operation. Writes never qualify. Only
384
+ * typed misses count, the same set skill discovery treats as absent: generic
385
+ * 404 statuses or "not found" text never do. */
386
+ function isReadOnlyPathProbeMiss(op: string, error: unknown): boolean {
387
+ return (
388
+ READ_ONLY_PATH_PROBE_OPERATIONS.has(op) &&
389
+ (isDefinitePathNotFoundError(error) ||
390
+ error instanceof SandboxWorkspaceReadNotFoundError ||
391
+ error instanceof SandboxFilesystemNotFoundError)
392
+ );
393
+ }
394
+
376
395
  function recordFirstOperationPhase(
377
396
  timing: RoutingSandboxFirstOperationTiming | undefined,
378
397
  phase: RoutingSandboxFirstOperationPhase,
@@ -1484,6 +1503,9 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1484
1503
  );
1485
1504
  outcome = "completed";
1486
1505
  return result;
1506
+ } catch (error) {
1507
+ if (isReadOnlyPathProbeMiss(op, error)) outcome = "completed";
1508
+ throw error;
1487
1509
  } finally {
1488
1510
  try {
1489
1511
  firstOperationObserver({
@@ -1676,6 +1698,9 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1676
1698
  },
1677
1699
  );
1678
1700
  providerOutcome = "completed";
1701
+ } catch (error) {
1702
+ if (isReadOnlyPathProbeMiss(op, error)) providerOutcome = "completed";
1703
+ throw error;
1679
1704
  } finally {
1680
1705
  recordFirstOperationPhase(
1681
1706
  firstOperationTiming,
@@ -1687,7 +1712,8 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1687
1712
  } catch (error) {
1688
1713
  if (reservedProcess) {
1689
1714
  if (
1690
- error instanceof ProviderCommandStartRejectedError &&
1715
+ (error instanceof ProviderCommandStartRejectedError ||
1716
+ error instanceof ModalCommandStartPreDispatchUnavailableError) &&
1691
1717
  reservedProcess.providerCommand?.kind === "modal-router-v1"
1692
1718
  ) {
1693
1719
  const persistence = this.deps.providerCommandPersistence?.(reservedProcess);
@@ -1697,7 +1723,7 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1697
1723
  } catch (cause) {
1698
1724
  throw new RoutingMutationOutcomeUnknownError(
1699
1725
  op,
1700
- "Never-started provider rejection could not settle its exact reservation",
1726
+ "Never-started provider call could not settle its exact reservation",
1701
1727
  { cause, retainedProcess: reservedProcess },
1702
1728
  );
1703
1729
  }
@@ -1942,10 +1968,7 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1942
1968
  return result;
1943
1969
  } catch (error) {
1944
1970
  materializationFailureReason = materializationVerificationDiagnostic(error)?.reason;
1945
- if (
1946
- (op === "readFile" || op === "listDir" || op === "pathExists" || op === "viewImage") &&
1947
- isDefinitePathNotFoundError(error)
1948
- ) {
1971
+ if (isReadOnlyPathProbeMiss(op, error)) {
1949
1972
  outcome = "not_found";
1950
1973
  }
1951
1974
  throw error;