@opengeni/sdk 7.4.0-canary.36855269964001 → 7.4.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.
- package/README.md +0 -31
- package/dist/adapters/next.js +4 -4
- package/dist/artifacts.js +7 -7
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +6 -8
- package/dist/chat/fold.d.ts +0 -1
- package/dist/chat/index.js +9 -15
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/types.d.ts +0 -4
- package/dist/{chunk-Y7UZBXVN.js → chunk-6NEPJ7NC.js} +2 -2
- package/dist/{chunk-45PCMV3K.js → chunk-7HIA2AI3.js} +2 -2
- package/dist/{chunk-CHFRWUPS.js → chunk-A73QXCBW.js} +7 -388
- package/dist/chunk-A73QXCBW.js.map +1 -0
- package/dist/{chunk-W4ZUQGOC.js → chunk-BX5ETUM7.js} +2 -2
- package/dist/{chunk-G4JBTVCL.js → chunk-FLOL2IES.js} +2 -2
- package/dist/{chunk-KSPK3BF4.js → chunk-FMLDFJ2Q.js} +2 -2
- package/dist/{chunk-5VTRBY4Z.js → chunk-GT2I4X7R.js} +5 -40
- package/dist/chunk-GT2I4X7R.js.map +1 -0
- package/dist/{chunk-W7VLV6NZ.js → chunk-HGGK2BW2.js} +2 -2
- package/dist/{chunk-IY5ATZY6.js → chunk-HZH5DJNN.js} +4 -4
- package/dist/{chunk-5K6KZAAK.js → chunk-MV2PNVU4.js} +1 -4
- package/dist/chunk-MV2PNVU4.js.map +1 -0
- package/dist/{chunk-KCE5UPK5.js → chunk-OO5LPTO7.js} +1 -40
- package/dist/chunk-OO5LPTO7.js.map +1 -0
- package/dist/{chunk-A6KD473F.js → chunk-QSCQUITU.js} +20 -105
- package/dist/chunk-QSCQUITU.js.map +1 -0
- package/dist/{chunk-Q2O2MEHA.js → chunk-VF2IW4M5.js} +3 -100
- package/dist/chunk-VF2IW4M5.js.map +1 -0
- package/dist/client.d.ts +3 -37
- package/dist/codex-realtime-controller.js +2 -2
- package/dist/core.js +7 -7
- package/dist/document-authority.js +6 -6
- package/dist/editable-artifacts.js +1 -1
- package/dist/embedding-client.d.ts +0 -39
- package/dist/errors.d.ts +0 -13
- package/dist/index.d.ts +6 -9
- package/dist/index.js +141 -47
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/message-links.d.ts +0 -5
- package/dist/realtime.js +2 -2
- package/dist/session-proxy.d.ts +1 -44
- package/dist/site-browser-runtime.gen.d.ts +1 -1
- package/dist/site-document.js +1 -1
- package/dist/site-document.js.map +1 -1
- package/dist/site.js +7 -7
- package/dist/{tools-52AEE64Y.js → tools-FSTY4FAY.js} +3 -3
- package/dist/types.d.ts +3 -55
- package/dist/workspace-integrations.d.ts +5 -22
- package/dist/workspace-integrations.js +1 -11
- package/package.json +3 -15
- package/src/browser.ts +0 -1
- package/src/chat/fold.ts +0 -12
- package/src/chat/types.ts +0 -4
- package/src/client.ts +15 -140
- package/src/embedding-client.ts +0 -130
- package/src/errors.ts +0 -56
- package/src/index.ts +1 -45
- package/src/message-links.ts +0 -6
- package/src/session-proxy.ts +2 -310
- package/src/site-browser-runtime.gen.ts +1 -1
- package/src/types.ts +2 -60
- package/src/workspace-integrations.ts +4 -76
- package/dist/allowance-refusal.d.ts +0 -2
- package/dist/allowance-refusal.js +0 -50
- package/dist/allowance-refusal.js.map +0 -1
- package/dist/chunk-5K6KZAAK.js.map +0 -1
- package/dist/chunk-5VTRBY4Z.js.map +0 -1
- package/dist/chunk-A6KD473F.js.map +0 -1
- package/dist/chunk-CHFRWUPS.js.map +0 -1
- package/dist/chunk-KCE5UPK5.js.map +0 -1
- package/dist/chunk-Q2O2MEHA.js.map +0 -1
- package/dist/session-proxy-client.d.ts +0 -24
- package/dist/session-proxy.js +0 -22
- package/dist/tools-52AEE64Y.js.map +0 -1
- package/dist/usage-allowances.d.ts +0 -36
- package/dist/usage-allowances.js +0 -80
- package/dist/usage-allowances.js.map +0 -1
- package/src/allowance-refusal.ts +0 -5
- package/src/session-proxy-client.ts +0 -64
- package/src/usage-allowances.ts +0 -189
- /package/dist/{chunk-Y7UZBXVN.js.map → chunk-6NEPJ7NC.js.map} +0 -0
- /package/dist/{chunk-45PCMV3K.js.map → chunk-7HIA2AI3.js.map} +0 -0
- /package/dist/{chunk-W4ZUQGOC.js.map → chunk-BX5ETUM7.js.map} +0 -0
- /package/dist/{chunk-G4JBTVCL.js.map → chunk-FLOL2IES.js.map} +0 -0
- /package/dist/{chunk-KSPK3BF4.js.map → chunk-FMLDFJ2Q.js.map} +0 -0
- /package/dist/{chunk-W7VLV6NZ.js.map → chunk-HGGK2BW2.js.map} +0 -0
- /package/dist/{chunk-IY5ATZY6.js.map → chunk-HZH5DJNN.js.map} +0 -0
- /package/dist/{session-proxy.js.map → tools-FSTY4FAY.js.map} +0 -0
package/README.md
CHANGED
|
@@ -25,31 +25,6 @@ bearer design, but an organization API key belongs on the product server.
|
|
|
25
25
|
Browser cookies are accepted cross-origin only from operator-configured trusted
|
|
26
26
|
origins; arbitrary embedding origins never receive credentialed CORS responses.
|
|
27
27
|
|
|
28
|
-
## Allowance lifecycle recovery
|
|
29
|
-
|
|
30
|
-
`getWorkspaceAllowance(workspaceId)` still returns nullable configuration.
|
|
31
|
-
Use `getWorkspaceAllowanceState(workspaceId)` when you also need the lifecycle
|
|
32
|
-
version: `{ version: 0, config: null }` means never configured, while a positive
|
|
33
|
-
version with null configuration means cleared. Recreation uses that exact
|
|
34
|
-
version as `expectedVersion`.
|
|
35
|
-
|
|
36
|
-
`clearWorkspaceAllowance(workspaceId, { expectedVersion, operationId })` returns
|
|
37
|
-
`{ version }`. The optional operation ID makes a lost response recoverable:
|
|
38
|
-
reuse the same actor, operation ID and exact request. Replay rechecks current
|
|
39
|
-
authority and returns 409 after any later allowance lifecycle change. On 409,
|
|
40
|
-
read the current state and decide whether a new operation is intended; never
|
|
41
|
-
guess a CAS version. The SDK does not automatically retry mutations.
|
|
42
|
-
|
|
43
|
-
The same reads and administration are free functions on the
|
|
44
|
-
`@opengeni/sdk/usage-allowances` subpath for browser code that only has the
|
|
45
|
-
narrow `OpenGeniBrowserClient` (`getMyUsage(client, workspaceId)`,
|
|
46
|
-
`getAllUsage`, `setMemberAllowance`, ...); they call the same routes as the root methods.
|
|
47
|
-
|
|
48
|
-
State reads require the same budget-read authority as configuration reads.
|
|
49
|
-
Full usage additionally requires target workspace access; organization budget
|
|
50
|
-
authority alone does not expose the member roster. Agents cannot read or
|
|
51
|
-
change allowances.
|
|
52
|
-
|
|
53
28
|
## Embed the conversation (default)
|
|
54
29
|
|
|
55
30
|
The default product integration is the full OpenGeni conversation:
|
|
@@ -613,12 +588,6 @@ const request = await verifyCredentialProviderRequest({
|
|
|
613
588
|
});
|
|
614
589
|
```
|
|
615
590
|
|
|
616
|
-
To check an endpoint now, `testWorkspaceWebhook(client, workspaceId, webhookId)` sends a
|
|
617
|
-
signed `webhook.test` event (acknowledge it with any 2xx) and
|
|
618
|
-
`testWorkspaceCredentialProvider(client, workspaceId)` sends a request with
|
|
619
|
-
`purpose: "test"`; both come from `@opengeni/sdk/workspace-integrations` and return
|
|
620
|
-
what the endpoint answered, naming returned credentials but never their values.
|
|
621
|
-
|
|
622
591
|
`listWorkspaceSandboxImages` returns the deployment's allowlisted images; set one
|
|
623
592
|
with `updateWorkspaceSettings(workspaceId, { defaultSandboxImage })`.
|
|
624
593
|
|
package/dist/adapters/next.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSessionProxyHandler
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-A73QXCBW.js";
|
|
4
|
+
import "../chunk-BX5ETUM7.js";
|
|
5
|
+
import "../chunk-MV2PNVU4.js";
|
|
6
|
+
import "../chunk-OO5LPTO7.js";
|
|
7
7
|
|
|
8
8
|
// src/adapters/next.ts
|
|
9
9
|
function toNextRouteHandlers(handler) {
|
package/dist/artifacts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpenGeniClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7HIA2AI3.js";
|
|
4
|
+
import "./chunk-HGGK2BW2.js";
|
|
5
|
+
import "./chunk-QSCQUITU.js";
|
|
6
|
+
import "./chunk-BX5ETUM7.js";
|
|
7
|
+
import "./chunk-MV2PNVU4.js";
|
|
8
|
+
import "./chunk-FLOL2IES.js";
|
|
9
|
+
import "./chunk-OO5LPTO7.js";
|
|
10
10
|
export {
|
|
11
11
|
OpenGeniClient
|
|
12
12
|
};
|
package/dist/browser.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { SessionMessageSearchRequest, SessionMessageSearchMatch, SessionMes
|
|
|
4
4
|
export { OpenGeniToolCallError, OpenGeniToolReapprovalRequiredError, OpenGeniToolsClient, } from "./tools.js";
|
|
5
5
|
export type { OpenGeniGeneratedTools, OpenGeniDynamicToolNode, OpenGeniToolCallOptions, OpenGeniToolFunction, OpenGeniToolsFacade, OpenGeniWorkspaceTools, } from "./tools.js";
|
|
6
6
|
export type { FetchLike, FetchResponse, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, SendMessageInput, SteerMessageResult, TranscribeAudioInput, WorkspaceControlEventPage, } from "./client.js";
|
|
7
|
-
export { OpenGeniApiContractMismatchError, OpenGeniApiError,
|
|
7
|
+
export { OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniSecureContextRequiredError, OpenGeniSessionListCursorError, OpenGeniStreamError, isRetryableStreamError, } from "./errors.js";
|
|
8
8
|
export type { OpenGeniSecureContextRequiredReason } from "./errors.js";
|
|
9
9
|
export { resolveWorkspaceVoiceInputEnabled } from "./transcription.js";
|
|
10
10
|
export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types.js";
|
package/dist/browser.js
CHANGED
|
@@ -5,29 +5,27 @@ import {
|
|
|
5
5
|
OpenGeniToolCallError,
|
|
6
6
|
OpenGeniToolReapprovalRequiredError,
|
|
7
7
|
OpenGeniToolsClient
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FMLDFJ2Q.js";
|
|
9
9
|
import {
|
|
10
10
|
OpenGeniClient
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QSCQUITU.js";
|
|
12
|
+
import "./chunk-BX5ETUM7.js";
|
|
13
13
|
import {
|
|
14
14
|
OPENGENI_API_CONTRACT_HEADER,
|
|
15
15
|
OPENGENI_API_CONTRACT_REVISION
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-MV2PNVU4.js";
|
|
17
|
+
import "./chunk-FLOL2IES.js";
|
|
18
18
|
import {
|
|
19
|
-
OpenGeniAllowanceExhaustedError,
|
|
20
19
|
OpenGeniApiContractMismatchError,
|
|
21
20
|
OpenGeniApiError,
|
|
22
21
|
OpenGeniSecureContextRequiredError,
|
|
23
22
|
OpenGeniSessionListCursorError,
|
|
24
23
|
OpenGeniStreamError,
|
|
25
24
|
isRetryableStreamError
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-OO5LPTO7.js";
|
|
27
26
|
export {
|
|
28
27
|
OPENGENI_API_CONTRACT_HEADER,
|
|
29
28
|
OPENGENI_API_CONTRACT_REVISION,
|
|
30
|
-
OpenGeniAllowanceExhaustedError,
|
|
31
29
|
OpenGeniApiContractMismatchError,
|
|
32
30
|
OpenGeniApiError,
|
|
33
31
|
OpenGeniClient as OpenGeniBrowserClient,
|
package/dist/chat/fold.d.ts
CHANGED
|
@@ -39,7 +39,6 @@ export declare class ChatTurnFold {
|
|
|
39
39
|
turnId: string | null;
|
|
40
40
|
pending: ChatPending | null;
|
|
41
41
|
failure: SessionEvent | null;
|
|
42
|
-
private emptyFinalReply;
|
|
43
42
|
private readonly segments;
|
|
44
43
|
private readonly openTools;
|
|
45
44
|
constructor(workspaceId: string, sessionId: string, expectedTurnId: string | null);
|
package/dist/chat/index.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-W7VLV6NZ.js";
|
|
8
|
-
import "../chunk-A6KD473F.js";
|
|
2
|
+
OpenGeniEmbeddingClient
|
|
3
|
+
} from "../chunk-VF2IW4M5.js";
|
|
4
|
+
import "../chunk-7HIA2AI3.js";
|
|
5
|
+
import "../chunk-HGGK2BW2.js";
|
|
6
|
+
import "../chunk-QSCQUITU.js";
|
|
9
7
|
import {
|
|
10
8
|
parseSseStream
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-BX5ETUM7.js";
|
|
10
|
+
import "../chunk-MV2PNVU4.js";
|
|
11
|
+
import "../chunk-FLOL2IES.js";
|
|
14
12
|
import {
|
|
15
13
|
OpenGeniApiError
|
|
16
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-OO5LPTO7.js";
|
|
17
15
|
|
|
18
16
|
// src/chat/types.ts
|
|
19
17
|
var OpenGeniChatError = class extends Error {
|
|
@@ -79,7 +77,6 @@ var ChatTurnFold = class {
|
|
|
79
77
|
turnId;
|
|
80
78
|
pending = null;
|
|
81
79
|
failure = null;
|
|
82
|
-
emptyFinalReply = false;
|
|
83
80
|
segments = [];
|
|
84
81
|
openTools = /* @__PURE__ */ new Map();
|
|
85
82
|
get text() {
|
|
@@ -202,7 +199,6 @@ var ChatTurnFold = class {
|
|
|
202
199
|
};
|
|
203
200
|
}
|
|
204
201
|
case "turn.completed":
|
|
205
|
-
this.emptyFinalReply = turnCompletedWithEmptyFinalReply(payload);
|
|
206
202
|
return { chunks: this.settleSegments(), terminal: "completed" };
|
|
207
203
|
case "turn.failed":
|
|
208
204
|
this.failure = event;
|
|
@@ -222,7 +218,6 @@ var ChatTurnFold = class {
|
|
|
222
218
|
turnId: this.turnId,
|
|
223
219
|
status: terminal === "pending" ? "pending" : terminal === "cancelled" ? "cancelled" : "completed",
|
|
224
220
|
pending: this.pending,
|
|
225
|
-
...this.emptyFinalReply ? { emptyFinalReply: true, notice: EMPTY_FINAL_REPLY_NOTICE } : {},
|
|
226
221
|
events: [...this.events],
|
|
227
222
|
toString: () => text
|
|
228
223
|
};
|
|
@@ -304,7 +299,6 @@ var ChatTurnFold = class {
|
|
|
304
299
|
*/
|
|
305
300
|
settleSegments() {
|
|
306
301
|
this.closeSegments();
|
|
307
|
-
if (this.emptyFinalReply) return [];
|
|
308
302
|
if (this.segments.some((segment) => !segment.commentary)) return [];
|
|
309
303
|
const latest = [...this.segments].reverse().find((segment) => segment.commentary && segment.text);
|
|
310
304
|
if (!latest) return [];
|