@opengeni/sdk 1.4.0 → 1.4.4
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 +12 -0
- package/dist/adapters/next.js +2 -2
- package/dist/artifacts.js +5 -5
- package/dist/browser.js +3 -3
- package/dist/chat/index.js +15 -9
- package/dist/chat/index.js.map +1 -1
- package/dist/{chunk-BVIIRSJY.js → chunk-6SWFOZUP.js} +3 -3
- package/dist/{chunk-LEBDXYMA.js → chunk-7A5ZDWQH.js} +2 -2
- package/dist/{chunk-GYM54GKM.js → chunk-DTIMLEPB.js} +1 -1
- package/dist/chunk-DTIMLEPB.js.map +1 -0
- package/dist/{chunk-CA2T7QT4.js → chunk-HORQJBLP.js} +2 -2
- package/dist/{chunk-NC57YMUO.js → chunk-IJWKWFSF.js} +1 -1
- package/dist/chunk-IJWKWFSF.js.map +1 -0
- package/dist/{chunk-ZNC44QEX.js → chunk-JOI7XCG6.js} +45 -14
- package/dist/chunk-JOI7XCG6.js.map +1 -0
- package/dist/{chunk-D534PIXF.js → chunk-MAFL52JD.js} +2 -2
- package/dist/{chunk-FYQAMXDW.js → chunk-OLLQBZAE.js} +111 -5
- package/dist/chunk-OLLQBZAE.js.map +1 -0
- package/dist/{chunk-MXV5O25O.js → chunk-W72BOLRJ.js} +2 -2
- package/dist/codex-realtime-controller.js +1 -1
- package/dist/core.js +4 -4
- package/dist/document-authority.js +4 -4
- package/dist/editable-artifacts.js +1 -1
- package/dist/index.js +9 -9
- package/dist/interaction.d.ts +5 -0
- package/dist/interaction.js +1 -1
- package/dist/realtime.js +1 -1
- package/dist/session-proxy.d.ts +29 -6
- package/dist/session-proxy.js +2 -2
- package/dist/site.js +4 -4
- package/dist/types.d.ts +17 -0
- package/package.json +3 -3
- package/src/chat/opengeni.ts +14 -3
- package/src/codex-realtime-controller.ts +65 -14
- package/src/interaction.ts +5 -0
- package/src/session-proxy.ts +189 -9
- package/src/types.ts +15 -0
- package/dist/chunk-FYQAMXDW.js.map +0 -1
- package/dist/chunk-GYM54GKM.js.map +0 -1
- package/dist/chunk-NC57YMUO.js.map +0 -1
- package/dist/chunk-ZNC44QEX.js.map +0 -1
- /package/dist/{chunk-BVIIRSJY.js.map → chunk-6SWFOZUP.js.map} +0 -0
- /package/dist/{chunk-LEBDXYMA.js.map → chunk-7A5ZDWQH.js.map} +0 -0
- /package/dist/{chunk-CA2T7QT4.js.map → chunk-HORQJBLP.js.map} +0 -0
- /package/dist/{chunk-D534PIXF.js.map → chunk-MAFL52JD.js.map} +0 -0
- /package/dist/{chunk-MXV5O25O.js.map → chunk-W72BOLRJ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -194,6 +194,18 @@ files and applies those choices to the request the hook returns. Voice input
|
|
|
194
194
|
"Archive" when they are off, shows Site previews as unavailable without a
|
|
195
195
|
request, and shows the composer microphone only when `voiceInput.available`.
|
|
196
196
|
|
|
197
|
+
Live voice (speech-to-speech) is forwarded the same way unless
|
|
198
|
+
`realtimeVoice: false`: the workspace's voice model catalog and the call routes
|
|
199
|
+
under `.../sessions/{id}/realtime` (start, provider connect, heartbeat,
|
|
200
|
+
activate, transcript sync, end). Opengeni still checks the user's
|
|
201
|
+
`sessions:control` permission, binds the call to that user and browser, runs
|
|
202
|
+
spoken requests as steers of the same chat, and meters deployment-funded voice
|
|
203
|
+
against your credits. `authorizeSession` runs on every call route, and
|
|
204
|
+
`beforeForwardMessage` sees `delivery: "realtime"` when a call starts (refuse
|
|
205
|
+
it, or return `mcpCredentialUpdates`; the proxy also refreshes the `toolServer`
|
|
206
|
+
token) and before transcripts and spoken requests are saved (refuse them, or add
|
|
207
|
+
`modelContext`, which must be the same when a request is retried).
|
|
208
|
+
|
|
197
209
|
`listSessionPage` includes personal pinned details by default. A caller with a
|
|
198
210
|
separate `pinsOnly: true` read can pass `includePinned: false` on ordinary pages
|
|
199
211
|
to avoid repeatedly loading those details. Ordinary pages still exclude pinned
|
package/dist/adapters/next.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSessionProxyHandler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-OLLQBZAE.js";
|
|
4
4
|
import "../chunk-UM4ZXXJR.js";
|
|
5
5
|
import "../chunk-U6CV2SXO.js";
|
|
6
6
|
import "../chunk-APXVSSSY.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-DTIMLEPB.js";
|
|
8
8
|
import "../chunk-V6GIY62B.js";
|
|
9
9
|
|
|
10
10
|
// src/adapters/next.ts
|
package/dist/artifacts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpenGeniClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-W72BOLRJ.js";
|
|
4
|
+
import "./chunk-HORQJBLP.js";
|
|
5
|
+
import "./chunk-6SWFOZUP.js";
|
|
6
6
|
import "./chunk-VPVMLM7Q.js";
|
|
7
7
|
import "./chunk-APXVSSSY.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-DTIMLEPB.js";
|
|
9
|
+
import "./chunk-IJWKWFSF.js";
|
|
10
10
|
import "./chunk-V6GIY62B.js";
|
|
11
11
|
export {
|
|
12
12
|
OpenGeniClient
|
package/dist/browser.js
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
} from "./chunk-4SMEOV3P.js";
|
|
9
9
|
import {
|
|
10
10
|
OpenGeniClient
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6SWFOZUP.js";
|
|
12
12
|
import "./chunk-VPVMLM7Q.js";
|
|
13
13
|
import "./chunk-APXVSSSY.js";
|
|
14
14
|
import {
|
|
15
15
|
OPENGENI_API_CONTRACT_HEADER,
|
|
16
16
|
OPENGENI_API_CONTRACT_REVISION
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-DTIMLEPB.js";
|
|
18
|
+
import "./chunk-IJWKWFSF.js";
|
|
19
19
|
import {
|
|
20
20
|
OpenGeniAllowanceExhaustedError,
|
|
21
21
|
OpenGeniApiContractMismatchError,
|
package/dist/chat/index.js
CHANGED
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
EMPTY_FINAL_REPLY_NOTICE,
|
|
12
12
|
OpenGeniEmbeddingClient,
|
|
13
13
|
turnCompletedWithEmptyFinalReply
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-MAFL52JD.js";
|
|
15
|
+
import "../chunk-W72BOLRJ.js";
|
|
16
|
+
import "../chunk-HORQJBLP.js";
|
|
17
17
|
import {
|
|
18
18
|
chatDefaults
|
|
19
19
|
} from "../chunk-UM4ZXXJR.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-6SWFOZUP.js";
|
|
21
21
|
import "../chunk-VPVMLM7Q.js";
|
|
22
22
|
import {
|
|
23
23
|
parseSseStream
|
|
24
24
|
} from "../chunk-APXVSSSY.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-DTIMLEPB.js";
|
|
26
|
+
import "../chunk-IJWKWFSF.js";
|
|
27
27
|
import {
|
|
28
28
|
OpenGeniApiError,
|
|
29
29
|
OpenGeniSetupError
|
|
@@ -373,6 +373,10 @@ function isErrorOutput(payload) {
|
|
|
373
373
|
// src/chat/opengeni.ts
|
|
374
374
|
var DEFAULT_OPENGENI_BASE_URL = "https://app.opengeni.ai";
|
|
375
375
|
var DEFAULT_CHAT_SOURCE = "app";
|
|
376
|
+
var MISSING_API_KEY_MESSAGE = "Opengeni requires an apiKey. Set OPENGENI_API_KEY in the server environment.";
|
|
377
|
+
async function missingApiKeyFetch() {
|
|
378
|
+
throw new TypeError(MISSING_API_KEY_MESSAGE);
|
|
379
|
+
}
|
|
376
380
|
var IMPORTED_HISTORY_MAX_CHARS = 3e4;
|
|
377
381
|
var MODEL_CONTEXT_MAX_CHARS = 32768;
|
|
378
382
|
var IMPORTED_HISTORY_HEADER = "Earlier conversation imported from the product, oldest first:";
|
|
@@ -392,12 +396,14 @@ var OpenGeni = class {
|
|
|
392
396
|
implicitAgentAdmission;
|
|
393
397
|
pendingOrganizationId;
|
|
394
398
|
constructor(options) {
|
|
395
|
-
if (!options.apiKey) throw new TypeError("Opengeni requires an apiKey.");
|
|
396
399
|
this.client = new OpenGeniEmbeddingClient({
|
|
397
400
|
// An empty value (a blank `OPENGENI_API_BASE_URL=` in .env) means the default.
|
|
398
401
|
baseUrl: options.baseUrl?.trim() || DEFAULT_OPENGENI_BASE_URL,
|
|
399
|
-
|
|
400
|
-
|
|
402
|
+
// A missing key fails each request, not construction: a module-scope
|
|
403
|
+
// `new OpenGeni({ apiKey: process.env.OPENGENI_API_KEY! })` must not
|
|
404
|
+
// break `next build` (or any import) where the secret only exists at
|
|
405
|
+
// runtime.
|
|
406
|
+
...options.apiKey ? { apiKey: options.apiKey, ...options.fetch ? { fetch: options.fetch } : {} } : { fetch: missingApiKeyFetch }
|
|
401
407
|
});
|
|
402
408
|
this.organizationId = options.organizationId?.trim() ?? "";
|
|
403
409
|
this.source = options.source ?? DEFAULT_CHAT_SOURCE;
|