@opengeni/sdk 4.4.1 → 4.5.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 (57) hide show
  1. package/README.md +27 -0
  2. package/dist/adapters/next.js +2 -2
  3. package/dist/artifacts.js +4 -4
  4. package/dist/browser.d.ts +2 -0
  5. package/dist/browser.js +5 -3
  6. package/dist/chat/index.js +5 -5
  7. package/dist/{chunk-3BWTS2MJ.js → chunk-ARDVIZIJ.js} +2 -2
  8. package/dist/{chunk-PVWOBYAZ.js → chunk-BXMNDWAN.js} +256 -78
  9. package/dist/chunk-BXMNDWAN.js.map +1 -0
  10. package/dist/{chunk-IVHLADZ7.js → chunk-GRUMGFK6.js} +2 -2
  11. package/dist/{chunk-2RVPHF37.js → chunk-JBAGMSN2.js} +66 -10
  12. package/dist/chunk-JBAGMSN2.js.map +1 -0
  13. package/dist/{chunk-35S72HAE.js → chunk-U4JUWOZV.js} +5 -5
  14. package/dist/{chunk-BLID3DCD.js → chunk-V4AIZAFF.js} +1 -1
  15. package/dist/chunk-V4AIZAFF.js.map +1 -0
  16. package/dist/{chunk-ALXDFL6C.js → chunk-VSOXNL3T.js} +2 -2
  17. package/dist/{chunk-CT6P2W2C.js → chunk-WI3WUT5H.js} +2 -2
  18. package/dist/client.d.ts +24 -1
  19. package/dist/codex-realtime-controller.js +1 -1
  20. package/dist/core.d.ts +2 -0
  21. package/dist/core.js +5 -3
  22. package/dist/document-authority.js +3 -3
  23. package/dist/editable-artifacts.js +1 -1
  24. package/dist/index.d.ts +4 -2
  25. package/dist/index.js +35 -33
  26. package/dist/index.js.map +1 -1
  27. package/dist/read-retry.d.ts +61 -0
  28. package/dist/realtime.js +5 -5
  29. package/dist/session-proxy.d.ts +6 -1
  30. package/dist/session-proxy.js +2 -2
  31. package/dist/site-bridge-host.js +3 -3
  32. package/dist/site-browser-runtime.gen.d.ts +1 -1
  33. package/dist/site-document.js +1 -1
  34. package/dist/site-document.js.map +1 -1
  35. package/dist/site.js +3 -3
  36. package/dist/types.d.ts +40 -0
  37. package/dist/workspace-artifacts.d.ts +5 -0
  38. package/dist/workspace-live-stream.d.ts +7 -0
  39. package/package.json +3 -3
  40. package/src/browser.ts +2 -0
  41. package/src/client.ts +191 -73
  42. package/src/core.ts +2 -0
  43. package/src/index.ts +4 -0
  44. package/src/read-retry.ts +207 -0
  45. package/src/session-proxy.ts +95 -4
  46. package/src/site-browser-runtime.gen.ts +1 -1
  47. package/src/types.ts +38 -0
  48. package/src/workspace-artifacts.ts +6 -0
  49. package/src/workspace-live-stream.ts +12 -1
  50. package/dist/chunk-2RVPHF37.js.map +0 -1
  51. package/dist/chunk-BLID3DCD.js.map +0 -1
  52. package/dist/chunk-PVWOBYAZ.js.map +0 -1
  53. /package/dist/{chunk-3BWTS2MJ.js.map → chunk-ARDVIZIJ.js.map} +0 -0
  54. /package/dist/{chunk-IVHLADZ7.js.map → chunk-GRUMGFK6.js.map} +0 -0
  55. /package/dist/{chunk-35S72HAE.js.map → chunk-U4JUWOZV.js.map} +0 -0
  56. /package/dist/{chunk-ALXDFL6C.js.map → chunk-VSOXNL3T.js.map} +0 -0
  57. /package/dist/{chunk-CT6P2W2C.js.map → chunk-WI3WUT5H.js.map} +0 -0
package/README.md CHANGED
@@ -1332,6 +1332,33 @@ unexpected successful non-JSON response to a mutation has `outcomeUnknown:
1332
1332
  true` because the mutation might already have been accepted. Never turn that
1333
1333
  condition into a new operation by changing its idempotency key.
1334
1334
 
1335
+ ### Transient read retry
1336
+
1337
+ Safe JSON reads (`GET` and `HEAD`) that fail transiently are retried quietly
1338
+ inside a small budget, so an API rolling deploy or a short network blip does
1339
+ not surface as an error. A failure is transient when the request never got a
1340
+ response (`fetch` rejected with a `TypeError`, such as a reset connection) or a
1341
+ gateway answered `502`, `503` or `504`. Retries use jittered exponential
1342
+ backoff, or the server's `Retry-After` when it fits the budget, and stop as
1343
+ soon as the caller's signal aborts. Every attempt of one call carries the same
1344
+ correlation ID. Mutations are never retried; they keep the `outcomeUnknown`
1345
+ semantics above. Auth, permission, not-found, validation, rate-limit and other
1346
+ server errors, and a success response the client cannot accept, surface
1347
+ immediately. A `Retry-After` gets up to 20% extra spread so clients told the
1348
+ same instant do not return together.
1349
+
1350
+ ```ts
1351
+ const client = new OpenGeniClient({
1352
+ baseUrl,
1353
+ // Defaults: 4 attempts, 250 ms first backoff, 2000 ms backoff cap, 5000 ms total.
1354
+ readRetry: { maxAttempts: 4, initialDelayMs: 250, maxDelayMs: 2_000, maxElapsedMs: 5_000 },
1355
+ // readRetry: false turns it off.
1356
+ });
1357
+ ```
1358
+
1359
+ `isTransientRequestError(error)` reports whether an error is this kind of
1360
+ transient failure, for callers that keep their own longer retry loop.
1361
+
1335
1362
  ## Streaming guarantees
1336
1363
 
1337
1364
  `client.streamEvents(...)` (and the underlying `streamSessionEvents`) delivers
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createSessionProxyHandler
3
- } from "../chunk-2RVPHF37.js";
3
+ } from "../chunk-JBAGMSN2.js";
4
4
  import "../chunk-UM4ZXXJR.js";
5
5
  import "../chunk-QGEIL4TR.js";
6
6
  import "../chunk-72YZCZWF.js";
7
- import "../chunk-BLID3DCD.js";
7
+ import "../chunk-V4AIZAFF.js";
8
8
  import "../chunk-ODKRQUWR.js";
9
9
 
10
10
  // src/adapters/next.ts
package/dist/artifacts.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-3BWTS2MJ.js";
4
- import "./chunk-CT6P2W2C.js";
5
- import "./chunk-PVWOBYAZ.js";
3
+ } from "./chunk-ARDVIZIJ.js";
4
+ import "./chunk-WI3WUT5H.js";
5
+ import "./chunk-BXMNDWAN.js";
6
6
  import "./chunk-X5ITQVXE.js";
7
7
  import "./chunk-72YZCZWF.js";
8
- import "./chunk-BLID3DCD.js";
8
+ import "./chunk-V4AIZAFF.js";
9
9
  import "./chunk-POYRW6KT.js";
10
10
  import "./chunk-ODKRQUWR.js";
11
11
  export {
package/dist/browser.d.ts CHANGED
@@ -6,6 +6,8 @@ export type { OpenGeniGeneratedTools, OpenGeniDynamicToolNode, OpenGeniToolCallO
6
6
  export type { FetchLike, FetchResponse, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, SendMessageInput, SteerMessageResult, TranscribeAudioInput, WorkspaceControlEventPage, } from "./client.js";
7
7
  export { OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniSetupError, OpenGeniAllowanceExhaustedError, OpenGeniSessionUsageLimitReachedError, OpenGeniSessionUsageLimitUnsupportedError, OpenGeniSecureContextRequiredError, OpenGeniSessionListCursorError, OpenGeniStreamError, formatErrorMessage, isRetryableStreamError, } from "./errors.js";
8
8
  export type { OpenGeniSecureContextRequiredReason } from "./errors.js";
9
+ export { isTransientRequestError } from "./read-retry.js";
10
+ export type { OpenGeniReadRetryOptions } from "./read-retry.js";
9
11
  export { resolveWorkspaceVoiceInputEnabled } from "./transcription.js";
10
12
  export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types.js";
11
13
  export type { ConnectorToolPermission, ConnectorToolPermissionEntry, ConnectorToolPermissionsResponse, UpdateConnectorToolPermissionsRequest, SessionMcpToolPermissionsResponse, UpdateSessionMcpToolPermissionsRequest, } from "./types.js";
package/dist/browser.js CHANGED
@@ -7,14 +7,15 @@ import {
7
7
  OpenGeniToolsClient
8
8
  } from "./chunk-ORYDCRFM.js";
9
9
  import {
10
- OpenGeniClient
11
- } from "./chunk-PVWOBYAZ.js";
10
+ OpenGeniClient,
11
+ isTransientRequestError
12
+ } from "./chunk-BXMNDWAN.js";
12
13
  import "./chunk-X5ITQVXE.js";
13
14
  import "./chunk-72YZCZWF.js";
14
15
  import {
15
16
  OPENGENI_API_CONTRACT_HEADER,
16
17
  OPENGENI_API_CONTRACT_REVISION
17
- } from "./chunk-BLID3DCD.js";
18
+ } from "./chunk-V4AIZAFF.js";
18
19
  import "./chunk-POYRW6KT.js";
19
20
  import {
20
21
  OpenGeniAllowanceExhaustedError,
@@ -47,6 +48,7 @@ export {
47
48
  OpenGeniToolsClient,
48
49
  formatErrorMessage,
49
50
  isRetryableStreamError,
51
+ isTransientRequestError,
50
52
  resolveWorkspaceVoiceInputEnabled
51
53
  };
52
54
  //# sourceMappingURL=browser.js.map
@@ -9,9 +9,9 @@ import {
9
9
  } from "../chunk-JO6THLOG.js";
10
10
  import {
11
11
  OpenGeniEmbeddingClient
12
- } from "../chunk-IVHLADZ7.js";
13
- import "../chunk-3BWTS2MJ.js";
14
- import "../chunk-CT6P2W2C.js";
12
+ } from "../chunk-GRUMGFK6.js";
13
+ import "../chunk-ARDVIZIJ.js";
14
+ import "../chunk-WI3WUT5H.js";
15
15
  import {
16
16
  chatDefaults
17
17
  } from "../chunk-UM4ZXXJR.js";
@@ -24,12 +24,12 @@ import {
24
24
  humanInputPending,
25
25
  stringValue
26
26
  } from "../chunk-OV3POE62.js";
27
- import "../chunk-PVWOBYAZ.js";
27
+ import "../chunk-BXMNDWAN.js";
28
28
  import "../chunk-X5ITQVXE.js";
29
29
  import {
30
30
  parseSseStream
31
31
  } from "../chunk-72YZCZWF.js";
32
- import "../chunk-BLID3DCD.js";
32
+ import "../chunk-V4AIZAFF.js";
33
33
  import "../chunk-POYRW6KT.js";
34
34
  import {
35
35
  OpenGeniApiError,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OpenGeniDocumentAuthorityClient
3
- } from "./chunk-CT6P2W2C.js";
3
+ } from "./chunk-WI3WUT5H.js";
4
4
 
5
5
  // src/artifact-client.ts
6
6
  var OpenGeniClient = class extends OpenGeniDocumentAuthorityClient {
@@ -121,4 +121,4 @@ var OpenGeniClient = class extends OpenGeniDocumentAuthorityClient {
121
121
  export {
122
122
  OpenGeniClient
123
123
  };
124
- //# sourceMappingURL=chunk-3BWTS2MJ.js.map
124
+ //# sourceMappingURL=chunk-ARDVIZIJ.js.map