@omnicross/core 0.2.0 → 0.2.1

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 (122) hide show
  1. package/LICENSE +21 -21
  2. package/NOTICE +57 -57
  3. package/README.md +22 -22
  4. package/dist/{BuiltinToolExecutor-CS2WpXhM.d.cts → BuiltinToolExecutor-BHgH-EaZ.d.cts} +25 -2
  5. package/dist/{BuiltinToolExecutor-BluWyeob.d.ts → BuiltinToolExecutor-Bi1LmiTP.d.ts} +25 -2
  6. package/dist/{CompletionService-BiJqftc-.d.cts → CompletionService-BniP7j88.d.cts} +2 -2
  7. package/dist/{CompletionService-NXN_Av5W.d.ts → CompletionService-BqrKPwfA.d.ts} +2 -2
  8. package/dist/{ProviderProxy-CgIcCVwk.d.cts → ProviderProxy-Bz_nkOwq.d.cts} +1 -1
  9. package/dist/{ProviderProxy-DYoY5XoT.d.ts → ProviderProxy-Ckr6oTrE.d.ts} +1 -1
  10. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +2 -2
  11. package/dist/auth/GeminiCodeAssistProjectResolver.js +1 -1
  12. package/dist/{chunk-FJNKXOWE.js → chunk-2C3TTBS7.js} +4 -4
  13. package/dist/{chunk-OST5RJOJ.cjs → chunk-4Z3ZLLC2.cjs} +13 -7
  14. package/dist/chunk-7RJI3NDI.cjs +236 -0
  15. package/dist/chunk-D4WNI6BR.cjs +386 -0
  16. package/dist/chunk-DBBR6RHF.js +236 -0
  17. package/dist/chunk-E4QHVXV5.cjs +118 -0
  18. package/dist/chunk-HL2YSPL7.cjs +673 -0
  19. package/dist/chunk-LFPQ2OVH.js +386 -0
  20. package/dist/{chunk-WSJE42SG.js → chunk-LKDAN4D7.js} +3684 -2462
  21. package/dist/{chunk-DEIUR2TH.js → chunk-LQYS2N47.js} +12 -8
  22. package/dist/{chunk-NZYN7C3P.cjs → chunk-MPXOKQJP.cjs} +53 -53
  23. package/dist/chunk-MZEGQSKQ.js +118 -0
  24. package/dist/chunk-NLUOTJWB.js +673 -0
  25. package/dist/{chunk-CTKM773J.cjs → chunk-UPQIWJIE.cjs} +12 -8
  26. package/dist/{chunk-CFSGYFOZ.js → chunk-VL5TUDTM.js} +7 -1
  27. package/dist/{chunk-7B56AJBB.cjs → chunk-VSYQ6XYN.cjs} +2233 -1011
  28. package/dist/{chunk-CDHS2QDC.js → chunk-Y4CRNHJO.js} +53 -53
  29. package/dist/{chunk-TVYA5JSQ.cjs → chunk-ZAPN7XA6.cjs} +5 -5
  30. package/dist/completion/BuiltinToolExecutor.cjs +2 -2
  31. package/dist/completion/BuiltinToolExecutor.d.cts +3 -1
  32. package/dist/completion/BuiltinToolExecutor.d.ts +3 -1
  33. package/dist/completion/BuiltinToolExecutor.js +1 -1
  34. package/dist/completion/CompletionService.cjs +11 -10
  35. package/dist/completion/CompletionService.d.cts +6 -3
  36. package/dist/completion/CompletionService.d.ts +6 -3
  37. package/dist/completion/CompletionService.js +10 -9
  38. package/dist/completion.cjs +11 -10
  39. package/dist/completion.d.cts +6 -3
  40. package/dist/completion.d.ts +6 -3
  41. package/dist/completion.js +10 -9
  42. package/dist/egress-I46O_p5L.d.cts +126 -0
  43. package/dist/egress-I46O_p5L.d.ts +126 -0
  44. package/dist/frontends-Doz0RaWu.d.cts +97 -0
  45. package/dist/frontends-Doz0RaWu.d.ts +97 -0
  46. package/dist/image-generation.cjs +2 -2
  47. package/dist/image-generation.d.cts +7 -4
  48. package/dist/image-generation.d.ts +7 -4
  49. package/dist/image-generation.js +1 -1
  50. package/dist/index.cjs +25 -10
  51. package/dist/index.d.cts +12 -8
  52. package/dist/index.d.ts +12 -8
  53. package/dist/index.js +24 -9
  54. package/dist/openai-operation.d.cts +4 -1
  55. package/dist/openai-operation.d.ts +4 -1
  56. package/dist/outbound-api/routeResolver.d.cts +9 -5
  57. package/dist/outbound-api/routeResolver.d.ts +9 -5
  58. package/dist/outbound-api/subscriptionRegistryPort.d.cts +4 -1
  59. package/dist/outbound-api/subscriptionRegistryPort.d.ts +4 -1
  60. package/dist/outbound-api/types.d.cts +8 -4
  61. package/dist/outbound-api/types.d.ts +8 -4
  62. package/dist/outbound-api.cjs +25 -10
  63. package/dist/outbound-api.d.cts +117 -8
  64. package/dist/outbound-api.d.ts +117 -8
  65. package/dist/outbound-api.js +24 -9
  66. package/dist/pipeline/AccountAllowanceScheduling.d.cts +8 -4
  67. package/dist/pipeline/AccountAllowanceScheduling.d.ts +8 -4
  68. package/dist/pipeline/upstreamFetch.cjs +2 -2
  69. package/dist/pipeline/upstreamFetch.js +1 -1
  70. package/dist/ports.d.cts +8 -4
  71. package/dist/ports.d.ts +8 -4
  72. package/dist/provider-proxy/ProviderProxy.cjs +11 -10
  73. package/dist/provider-proxy/ProviderProxy.d.cts +5 -2
  74. package/dist/provider-proxy/ProviderProxy.d.ts +5 -2
  75. package/dist/provider-proxy/ProviderProxy.js +10 -9
  76. package/dist/provider-proxy/ingress/providerProxyShared.cjs +13 -10
  77. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +22 -3
  78. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +22 -3
  79. package/dist/provider-proxy/ingress/providerProxyShared.js +12 -9
  80. package/dist/provider-proxy/types.d.cts +4 -1
  81. package/dist/provider-proxy/types.d.ts +4 -1
  82. package/dist/provider-proxy.cjs +11 -10
  83. package/dist/provider-proxy.d.cts +10 -6
  84. package/dist/provider-proxy.d.ts +10 -6
  85. package/dist/provider-proxy.js +10 -9
  86. package/dist/proxy-UZTtjPZx.d.cts +18 -0
  87. package/dist/proxy-UZTtjPZx.d.ts +18 -0
  88. package/dist/{routeResolver-rpKQLyDO.d.cts → routeResolver-Da0yvkL1.d.cts} +2 -2
  89. package/dist/{routeResolver-CTCcSHWu.d.ts → routeResolver-STwMz_G4.d.ts} +2 -2
  90. package/dist/runtime-6QXNU526.cjs +8 -0
  91. package/dist/runtime-M5WXLD2R.js +8 -0
  92. package/dist/runtime-t8AZacFF.d.cts +233 -0
  93. package/dist/runtime-t8AZacFF.d.ts +233 -0
  94. package/dist/search/api.cjs +761 -0
  95. package/dist/search/api.d.cts +370 -0
  96. package/dist/search/api.d.ts +370 -0
  97. package/dist/search/api.js +761 -0
  98. package/dist/search/http.cjs +37 -0
  99. package/dist/search/http.d.cts +269 -0
  100. package/dist/search/http.d.ts +269 -0
  101. package/dist/search/http.js +37 -0
  102. package/dist/search.cjs +57 -0
  103. package/dist/search.d.cts +113 -0
  104. package/dist/search.d.ts +113 -0
  105. package/dist/search.js +57 -0
  106. package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -3
  107. package/dist/transformer/transformers/AnthropicTransformer.js +2 -2
  108. package/dist/transformer/transformers.cjs +7 -7
  109. package/dist/transformer/transformers.js +6 -6
  110. package/dist/transformer.cjs +6 -6
  111. package/dist/transformer.js +5 -5
  112. package/dist/{types-DsHBBk3h.d.cts → types-BSIJdsyl.d.cts} +15 -0
  113. package/dist/{types-CbglB73l.d.cts → types-Be-yt_6T.d.cts} +1 -1
  114. package/dist/{types-CVRge76p.d.ts → types-By9Tg6-I.d.ts} +15 -0
  115. package/dist/types-CbCZqLGg.d.cts +127 -0
  116. package/dist/types-CbCZqLGg.d.ts +127 -0
  117. package/dist/{types-jjU24eYG.d.cts → types-D-oHYusb.d.cts} +73 -4
  118. package/dist/{types-Bd72H4SB.d.ts → types-Dm4_36V4.d.ts} +1 -1
  119. package/dist/{types-5T223WYQ.d.ts → types-Dvlpjn0d.d.ts} +73 -4
  120. package/package.json +5 -3
  121. package/dist/{chunk-6OC3ORW6.js → chunk-EUZRH544.js} +3 -3
  122. package/dist/{chunk-SQMAEDNE.cjs → chunk-POUTD5AM.cjs} +2 -2
@@ -1765,7 +1765,10 @@ async function readJsonBody(request2, options) {
1765
1765
 
1766
1766
  // src/image-generation/openai-images/types.ts
1767
1767
  var DEFAULT_IMAGE_API_LIMITS = Object.freeze({
1768
- maxJsonBytes: 1024 * 1024,
1768
+ // Codex's built-in image tool sends edits as JSON data URLs rather than
1769
+ // multipart files. Leave room for the Base64 expansion of the bounded
1770
+ // aggregate input budget plus the small JSON/options envelope.
1771
+ maxJsonBytes: 96 * 1024 * 1024,
1769
1772
  maxMultipartBytes: 64 * 1024 * 1024,
1770
1773
  maxFileBytes: 50 * 1024 * 1024,
1771
1774
  maxTotalInputBytes: 64 * 1024 * 1024,
@@ -2326,7 +2329,7 @@ async function readMultipartEdit(request2, scope, limits, signal) {
2326
2329
  function invalid4(param = "image") {
2327
2330
  throw new ImageGenerationError("invalid_image_request", { param });
2328
2331
  }
2329
- function closedInput(value, maxRemoteUrlBytes) {
2332
+ function closedInput(value, limits) {
2330
2333
  if (!value || typeof value !== "object" || Array.isArray(value)) invalid4();
2331
2334
  const record2 = value;
2332
2335
  const keys = Object.keys(record2);
@@ -2334,8 +2337,9 @@ function closedInput(value, maxRemoteUrlBytes) {
2334
2337
  const key = keys[0];
2335
2338
  if (key !== "file_id" && key !== "image_url") invalid4();
2336
2339
  const item = record2[key];
2337
- const maxBytes = key === "file_id" ? 256 : maxRemoteUrlBytes;
2338
- if (typeof item !== "string" || !item || Buffer.byteLength(item, "utf8") > maxBytes) invalid4();
2340
+ if (typeof item !== "string" || !item) invalid4();
2341
+ const maxBytes = key === "file_id" ? 256 : item.toLowerCase().startsWith("data:") ? Math.ceil(limits.maxFileBytes / 3) * 4 + 64 : limits.maxRemoteUrlBytes;
2342
+ if (Buffer.byteLength(item, "utf8") > maxBytes) invalid4();
2339
2343
  return { [key]: item };
2340
2344
  }
2341
2345
  function decodedBase64Length(value) {
@@ -2407,7 +2411,7 @@ async function resolveReference(referenceId, runtime, scope) {
2407
2411
  return asset;
2408
2412
  }
2409
2413
  async function resolveImageInput(value, runtime, scope, signal) {
2410
- const input = closedInput(value, runtime.limits.maxRemoteUrlBytes);
2414
+ const input = closedInput(value, runtime.limits);
2411
2415
  if ("file_id" in input) return resolveReference(input.file_id, runtime, scope);
2412
2416
  if (input.image_url.toLowerCase().startsWith("data:")) {
2413
2417
  return resolveDataUrl(input.image_url, runtime, scope, signal);
@@ -2432,10 +2436,10 @@ async function resolveImageInput(value, runtime, scope, signal) {
2432
2436
  materializer
2433
2437
  });
2434
2438
  }
2435
- function parseImageInputList(value, maxRemoteUrlBytes) {
2439
+ function parseImageInputList(value, limits) {
2436
2440
  const list = Array.isArray(value) ? value : [value];
2437
2441
  if (list.length < 1 || list.length > 16) invalid4();
2438
- for (const item of list) closedInput(item, maxRemoteUrlBytes);
2442
+ for (const item of list) closedInput(item, limits);
2439
2443
  return list;
2440
2444
  }
2441
2445
 
@@ -2481,7 +2485,7 @@ function createImageEditHandler(deps) {
2481
2485
  });
2482
2486
  const inputs = parseImageInputList(
2483
2487
  _nullishCoalesce(record2.images, () => ( record2.image)),
2484
- runtime.limits.maxRemoteUrlBytes
2488
+ runtime.limits
2485
2489
  );
2486
2490
  const resolveObservedInput = async (input) => {
2487
2491
  const reference = isReferenceInput(input);
@@ -32,6 +32,12 @@ function bumpUpstreamProxyGeneration() {
32
32
  }
33
33
  }
34
34
  }
35
+ function isClientDisconnectAbort(signal) {
36
+ if (!signal?.aborted) return false;
37
+ const reason = signal.reason;
38
+ if (!reason || typeof reason !== "object") return false;
39
+ return reason.code === "client_disconnect";
40
+ }
35
41
  function normalizeProxy(cfg) {
36
42
  if ("url" in cfg) {
37
43
  let u;
@@ -144,7 +150,7 @@ function fetchUpstream(url, init, ctx) {
144
150
  return response;
145
151
  },
146
152
  (error) => {
147
- recordActivity(0);
153
+ if (!isClientDisconnectAbort(init.signal)) recordActivity(0);
148
154
  throw error;
149
155
  }
150
156
  );