@copilotkit/aimock 1.35.1 → 1.36.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.
- package/CHANGELOG.md +11 -1
- package/README.md +22 -0
- package/dist/agui-types.d.cts.map +1 -1
- package/dist/agui-types.d.ts.map +1 -1
- package/dist/cli.cjs +2 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/config-loader.cjs +9 -0
- package/dist/config-loader.cjs.map +1 -1
- package/dist/config-loader.d.cts +4 -0
- package/dist/config-loader.d.cts.map +1 -1
- package/dist/config-loader.d.ts +4 -0
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +9 -0
- package/dist/config-loader.js.map +1 -1
- package/dist/fal-audio.cjs +1 -0
- package/dist/fal-audio.cjs.map +1 -1
- package/dist/fal-audio.js +1 -0
- package/dist/fal-audio.js.map +1 -1
- package/dist/fal.cjs +4 -1
- package/dist/fal.cjs.map +1 -1
- package/dist/fal.d.cts.map +1 -1
- package/dist/fal.d.ts.map +1 -1
- package/dist/fal.js +4 -1
- package/dist/fal.js.map +1 -1
- package/dist/provider-auth.cjs +170 -0
- package/dist/provider-auth.cjs.map +1 -0
- package/dist/provider-auth.js +168 -0
- package/dist/provider-auth.js.map +1 -0
- package/dist/recorder.cjs +5 -1
- package/dist/recorder.cjs.map +1 -1
- package/dist/recorder.d.cts.map +1 -1
- package/dist/recorder.d.ts.map +1 -1
- package/dist/recorder.js +5 -1
- package/dist/recorder.js.map +1 -1
- package/dist/types.d.cts +13 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vector-types.d.cts.map +1 -1
- package/dist/vector-types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/recorder.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.d.cts","names":[],"sources":["../src/recorder.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"recorder.d.cts","names":[],"sources":["../src/recorder.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAkIiB,qBAAA;;;QAGT;;UAGS,YAAA;;;;;;;;;;;;;;;;;;mCAkBkB,oCAAoC;;;;;;;;;;;;;;;;;;;;;;KAuB3D,YAAA;;;;;;;;;;;;;;;iBA6MU,cAAA,MACf,MAAA,CAAK,sBACL,MAAA,CAAK,yBACD,oCACI,+CAEH;WAEC;UACD;2BACiB,0BAA0B;+BAG3C,eACT,QAAQ"}
|
package/dist/recorder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.d.ts","names":[],"sources":["../src/recorder.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","names":[],"sources":["../src/recorder.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAkIiB,qBAAA;;;QAGT;;UAGS,YAAA;;;;;;;;;;;;;;;;;;mCAkBkB,oCAAoC;;;;;;;;;;;;;;;;;;;;;;KAuB3D,YAAA;;;;;;;;;;;;;;;iBA6MU,cAAA,MACf,MAAA,CAAK,sBACL,MAAA,CAAK,yBACD,oCACI,+CAEH;WAEC;UACD;2BACiB,0BAA0B;+BAG3C,eACT,QAAQ"}
|
package/dist/recorder.js
CHANGED
|
@@ -5,6 +5,7 @@ import { getLastMessageByRole, getTextContent } from "./router.js";
|
|
|
5
5
|
import { writeErrorResponse } from "./sse-writer.js";
|
|
6
6
|
import { capturedRedactedData, collapseStreamingResponse } from "./stream-collapse.js";
|
|
7
7
|
import { resolveUpstreamUrl } from "./url.js";
|
|
8
|
+
import { applyProviderAuth } from "./provider-auth.js";
|
|
8
9
|
import * as http$1 from "node:http";
|
|
9
10
|
import * as crypto$1 from "node:crypto";
|
|
10
11
|
import * as https from "node:https";
|
|
@@ -201,7 +202,9 @@ function persistFixture(opts) {
|
|
|
201
202
|
async function proxyAndRecord(req, res, request, providerKey, pathname, fixtures, defaults, rawBody, options) {
|
|
202
203
|
const record = defaults.record;
|
|
203
204
|
if (!record) return "not_configured";
|
|
204
|
-
const
|
|
205
|
+
const providers = record.providers;
|
|
206
|
+
const lookupKey = providerKey === "gemini-interactions" ? "gemini" : providerKey;
|
|
207
|
+
const upstreamUrl = providers[lookupKey];
|
|
205
208
|
if (!upstreamUrl) {
|
|
206
209
|
defaults.logger.warn(`No upstream URL configured for provider "${providerKey}" — cannot proxy`);
|
|
207
210
|
return "not_configured";
|
|
@@ -220,6 +223,7 @@ async function proxyAndRecord(req, res, request, providerKey, pathname, fixtures
|
|
|
220
223
|
}
|
|
221
224
|
defaults.logger.warn(`NO FIXTURE MATCH — proxying to ${upstreamUrl}${pathname}`);
|
|
222
225
|
const forwardHeaders = buildForwardHeaders(req);
|
|
226
|
+
applyProviderAuth(forwardHeaders, target, providerKey, record.providerKeys?.[lookupKey]);
|
|
223
227
|
const requestBody = rawBody ?? JSON.stringify(request);
|
|
224
228
|
let upstreamStatus;
|
|
225
229
|
let upstreamHeaders;
|