@copilotkit/shared 1.69.2 → 1.70.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/dist/index.cjs +33 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -17
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +20 -17
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +30 -15
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +170 -31
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/telemetry/index.d.mts +3 -2
- package/dist/telemetry/lambda-client.cjs +25 -4
- package/dist/telemetry/lambda-client.cjs.map +1 -1
- package/dist/telemetry/lambda-client.d.cts +14 -1
- package/dist/telemetry/lambda-client.d.cts.map +1 -1
- package/dist/telemetry/lambda-client.d.mts +14 -1
- package/dist/telemetry/lambda-client.d.mts.map +1 -1
- package/dist/telemetry/lambda-client.mjs +25 -5
- package/dist/telemetry/lambda-client.mjs.map +1 -1
- package/dist/telemetry/sampling.cjs +28 -0
- package/dist/telemetry/sampling.cjs.map +1 -0
- package/dist/telemetry/sampling.d.cts +37 -0
- package/dist/telemetry/sampling.d.cts.map +1 -0
- package/dist/telemetry/sampling.d.mts +37 -0
- package/dist/telemetry/sampling.d.mts.map +1 -0
- package/dist/telemetry/sampling.mjs +25 -0
- package/dist/telemetry/sampling.mjs.map +1 -0
- package/dist/telemetry/telemetry-client.cjs +72 -11
- package/dist/telemetry/telemetry-client.cjs.map +1 -1
- package/dist/telemetry/telemetry-client.d.cts +43 -1
- package/dist/telemetry/telemetry-client.d.cts.map +1 -1
- package/dist/telemetry/telemetry-client.d.mts +43 -1
- package/dist/telemetry/telemetry-client.d.mts.map +1 -1
- package/dist/telemetry/telemetry-client.mjs +73 -12
- package/dist/telemetry/telemetry-client.mjs.map +1 -1
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +2 -1
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.mts.map +1 -1
- package/dist/utils/index.mjs +1 -0
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/inspector-visibility.cjs +13 -0
- package/dist/utils/inspector-visibility.cjs.map +1 -0
- package/dist/utils/inspector-visibility.d.cts +18 -0
- package/dist/utils/inspector-visibility.d.cts.map +1 -0
- package/dist/utils/inspector-visibility.d.mts +18 -0
- package/dist/utils/inspector-visibility.d.mts.map +1 -0
- package/dist/utils/inspector-visibility.mjs +12 -0
- package/dist/utils/inspector-visibility.mjs.map +1 -0
- package/dist/utils/types.cjs.map +1 -1
- package/dist/utils/types.d.cts +46 -1
- package/dist/utils/types.d.cts.map +1 -1
- package/dist/utils/types.d.mts +46 -1
- package/dist/utils/types.d.mts.map +1 -1
- package/dist/utils/types.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/license-context.test.ts +224 -25
- package/src/index.ts +72 -16
- package/src/telemetry/index.ts +2 -0
- package/src/telemetry/lambda-client.test.ts +336 -1
- package/src/telemetry/lambda-client.ts +56 -15
- package/src/telemetry/sampling.test.ts +65 -0
- package/src/telemetry/sampling.ts +70 -0
- package/src/telemetry/telemetry-blank-license-identity.test.ts +121 -0
- package/src/telemetry/telemetry-client.test.ts +438 -15
- package/src/telemetry/telemetry-client.ts +145 -30
- package/src/utils/__tests__/conditions.test.ts +161 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/inspector-visibility.test.ts +43 -0
- package/src/utils/inspector-visibility.ts +17 -0
- package/src/utils/types.ts +52 -0
package/dist/index.umd.js
CHANGED
|
@@ -941,6 +941,16 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
|
|
944
|
+
//#endregion
|
|
945
|
+
//#region src/utils/inspector-visibility.ts
|
|
946
|
+
/**
|
|
947
|
+
* The Inspector is a development-only browser tool. Consumers may disable it,
|
|
948
|
+
* but an explicit `true` never overrides a production or server environment.
|
|
949
|
+
*/
|
|
950
|
+
function shouldEnableInspector({ enableInspector, isBrowser, isDevelopment }) {
|
|
951
|
+
return isBrowser && isDevelopment && enableInspector !== false;
|
|
952
|
+
}
|
|
953
|
+
|
|
944
954
|
//#endregion
|
|
945
955
|
//#region src/utils/types.ts
|
|
946
956
|
const RUNTIME_MODE_SSE = "sse";
|
|
@@ -1139,6 +1149,24 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1139
1149
|
var _process$env;
|
|
1140
1150
|
const TELEMETRY_SINK_URL = typeof process !== "undefined" && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.COPILOTKIT_TELEMETRY_URL) || "https://telemetry.copilotkit.ai/ingest";
|
|
1141
1151
|
const FETCH_TIMEOUT_MS = 3e3;
|
|
1152
|
+
const TELEMETRY_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
1153
|
+
/**
|
|
1154
|
+
* Return the first telemetry identity accepted by the ingest service.
|
|
1155
|
+
*
|
|
1156
|
+
* Empty and whitespace-only values are unconfigured placeholders and must not
|
|
1157
|
+
* suppress a later identity source. Leading and trailing HTTP spaces and tabs
|
|
1158
|
+
* are removed before validation. The ingest service accepts 1 to 128 ASCII
|
|
1159
|
+
* letters, digits, underscores, and hyphens.
|
|
1160
|
+
*
|
|
1161
|
+
* @internal
|
|
1162
|
+
*/
|
|
1163
|
+
function firstNonBlankTelemetryId(...candidates) {
|
|
1164
|
+
for (const candidate of candidates) {
|
|
1165
|
+
if (candidate === void 0) continue;
|
|
1166
|
+
const normalized = candidate.replace(/^[\t ]+|[\t ]+$/g, "");
|
|
1167
|
+
if (TELEMETRY_ID_PATTERN.test(normalized)) return normalized;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1142
1170
|
const STRIPPED_KEYS = new Set(["cloud.public_api_key", "cloud.publicApiKey"]);
|
|
1143
1171
|
function stripCloudKeys(obj) {
|
|
1144
1172
|
if (!obj) return {};
|
|
@@ -1151,12 +1179,15 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1151
1179
|
const parts = token.split(".");
|
|
1152
1180
|
if (parts.length !== 3) return null;
|
|
1153
1181
|
try {
|
|
1154
|
-
|
|
1182
|
+
var _firstNonBlankTelemet;
|
|
1183
|
+
const payload = parts[1];
|
|
1184
|
+
if (!/^[A-Za-z0-9_-]+$/.test(payload) || payload.length % 4 === 1) return null;
|
|
1185
|
+
let b64 = payload.replace(/-/g, "+").replace(/_/g, "/");
|
|
1155
1186
|
const padding = (4 - b64.length % 4) % 4;
|
|
1156
1187
|
b64 += "=".repeat(padding);
|
|
1157
|
-
const json = typeof
|
|
1188
|
+
const json = typeof Buffer !== "undefined" ? Buffer.from(b64, "base64").toString("utf8") : new TextDecoder().decode(Uint8Array.from(atob(b64), (character) => character.charCodeAt(0)));
|
|
1158
1189
|
const decoded = JSON.parse(json);
|
|
1159
|
-
return typeof decoded.telemetry_id === "string" ? decoded.telemetry_id : null;
|
|
1190
|
+
return (_firstNonBlankTelemet = firstNonBlankTelemetryId(typeof decoded.telemetry_id === "string" ? decoded.telemetry_id : void 0)) !== null && _firstNonBlankTelemet !== void 0 ? _firstNonBlankTelemet : null;
|
|
1160
1191
|
} catch (_unused) {
|
|
1161
1192
|
return null;
|
|
1162
1193
|
}
|
|
@@ -1168,7 +1199,7 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1168
1199
|
}
|
|
1169
1200
|
async function send(opts) {
|
|
1170
1201
|
try {
|
|
1171
|
-
var _opts$packageVersion;
|
|
1202
|
+
var _firstNonBlankTelemet2, _opts$packageVersion;
|
|
1172
1203
|
const body = JSON.stringify({
|
|
1173
1204
|
event: opts.event,
|
|
1174
1205
|
properties: stripCloudKeys(opts.properties),
|
|
@@ -1179,7 +1210,7 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1179
1210
|
},
|
|
1180
1211
|
ts: Math.floor(Date.now() / 1e3)
|
|
1181
1212
|
});
|
|
1182
|
-
const telemetryId = parseTelemetryIdFromLicense(opts.licenseToken);
|
|
1213
|
+
const telemetryId = (_firstNonBlankTelemet2 = firstNonBlankTelemetryId(opts.telemetryId)) !== null && _firstNonBlankTelemet2 !== void 0 ? _firstNonBlankTelemet2 : parseTelemetryIdFromLicense(opts.licenseToken);
|
|
1183
1214
|
const headers = {
|
|
1184
1215
|
"Content-Type": "application/json",
|
|
1185
1216
|
"User-Agent": opts.packageName ? `CopilotKit-Runtime/${(_opts$packageVersion = opts.packageVersion) !== null && _opts$packageVersion !== void 0 ? _opts$packageVersion : "unknown"} (${opts.packageName})` : "CopilotKit-Runtime"
|
|
@@ -1201,6 +1232,29 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1201
1232
|
}
|
|
1202
1233
|
const lambdaClient = { send };
|
|
1203
1234
|
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/telemetry/sampling.ts
|
|
1237
|
+
/** Identifies which client emitted an event. */
|
|
1238
|
+
const TELEMETRY_EMITTER_V1 = "v1-shared";
|
|
1239
|
+
const TELEMETRY_EMITTER_V2 = "v2-runtime";
|
|
1240
|
+
/**
|
|
1241
|
+
* Compute the sampling block for one captured event.
|
|
1242
|
+
*
|
|
1243
|
+
* `telemetryId` is the caller's parsed license telemetry_id, or null when
|
|
1244
|
+
* anonymous — it decides the branch, and is deliberately not returned:
|
|
1245
|
+
* only the non-PII shape below travels on the event.
|
|
1246
|
+
*/
|
|
1247
|
+
function computeSamplingMeta({ telemetryId, sampleRate }) {
|
|
1248
|
+
const identified = Boolean(telemetryId);
|
|
1249
|
+
const effectiveSampleRate = identified ? 1 : sampleRate;
|
|
1250
|
+
return {
|
|
1251
|
+
sampleRate: effectiveSampleRate,
|
|
1252
|
+
sampleRateAdjustmentFactor: 1 - effectiveSampleRate,
|
|
1253
|
+
sampleWeight: 1 / effectiveSampleRate,
|
|
1254
|
+
telemetry_identified: identified
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1204
1258
|
//#endregion
|
|
1205
1259
|
//#region src/telemetry/telemetry-client.ts
|
|
1206
1260
|
/**
|
|
@@ -1218,6 +1272,7 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1218
1272
|
this.cloudConfiguration = null;
|
|
1219
1273
|
this.licenseToken = null;
|
|
1220
1274
|
this.telemetryId = null;
|
|
1275
|
+
this.licenseTelemetryId = null;
|
|
1221
1276
|
this.telemetryDisabled = false;
|
|
1222
1277
|
this.sampleRate = .05;
|
|
1223
1278
|
this.anonymousId = `anon_${(0, uuid.v4)()}`;
|
|
@@ -1236,19 +1291,29 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1236
1291
|
return Math.random() < this.sampleRate;
|
|
1237
1292
|
}
|
|
1238
1293
|
async capture(event, properties) {
|
|
1239
|
-
|
|
1294
|
+
return this.captureWithIdentity(event, properties, {
|
|
1295
|
+
telemetryId: this.telemetryId,
|
|
1296
|
+
licenseToken: this.licenseToken,
|
|
1297
|
+
licenseTelemetryId: this.licenseTelemetryId
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
async captureWithIdentity(event, properties, identity) {
|
|
1301
|
+
var _identity$telemetryId, _identity$licenseToke;
|
|
1240
1302
|
if (this.telemetryDisabled) return;
|
|
1241
|
-
if (!
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1303
|
+
if (!identity.licenseTelemetryId && !this.shouldSendEvent()) return;
|
|
1304
|
+
const eventMeta = {
|
|
1305
|
+
...computeSamplingMeta({
|
|
1306
|
+
telemetryId: identity.licenseTelemetryId,
|
|
1307
|
+
sampleRate: this.sampleRate
|
|
1308
|
+
}),
|
|
1309
|
+
telemetry_emitter: TELEMETRY_EMITTER_V1,
|
|
1310
|
+
telemetry_event_id: (0, uuid.v4)()
|
|
1247
1311
|
};
|
|
1248
1312
|
const flattenedProperties = flattenObject(properties);
|
|
1249
1313
|
const propertiesWithGlobal = {
|
|
1250
1314
|
...this.globalProperties,
|
|
1251
|
-
...
|
|
1315
|
+
...eventMeta,
|
|
1316
|
+
telemetry_transport: "segment",
|
|
1252
1317
|
...flattenedProperties
|
|
1253
1318
|
};
|
|
1254
1319
|
const orderedPropertiesWithGlobal = Object.keys(propertiesWithGlobal).sort().reduce((obj, key) => {
|
|
@@ -1260,11 +1325,13 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1260
1325
|
properties: flattenedProperties,
|
|
1261
1326
|
globalProperties: {
|
|
1262
1327
|
...this.globalProperties,
|
|
1263
|
-
...
|
|
1328
|
+
...eventMeta,
|
|
1329
|
+
telemetry_transport: "lambda"
|
|
1264
1330
|
},
|
|
1265
1331
|
packageName: this.packageName,
|
|
1266
1332
|
packageVersion: this.packageVersion,
|
|
1267
|
-
|
|
1333
|
+
telemetryId: (_identity$telemetryId = identity.telemetryId) !== null && _identity$telemetryId !== void 0 ? _identity$telemetryId : void 0,
|
|
1334
|
+
licenseToken: (_identity$licenseToke = identity.licenseToken) !== null && _identity$licenseToke !== void 0 ? _identity$licenseToke : void 0
|
|
1268
1335
|
});
|
|
1269
1336
|
if (this.segment) this.segment.track({
|
|
1270
1337
|
anonymousId: this.anonymousId,
|
|
@@ -1286,9 +1353,57 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1286
1353
|
baseUrl: properties.baseUrl
|
|
1287
1354
|
} });
|
|
1288
1355
|
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Atomically configure standalone, legacy, or anonymous telemetry identity.
|
|
1358
|
+
*
|
|
1359
|
+
* A standalone id takes transport precedence over a supplied legacy license
|
|
1360
|
+
* token, but only a license-derived id grants sampling authority. Neither
|
|
1361
|
+
* value is added to event properties.
|
|
1362
|
+
*
|
|
1363
|
+
* @param identity - One standalone id, one legacy license token, or neither.
|
|
1364
|
+
*/
|
|
1365
|
+
setTelemetryIdentity(identity) {
|
|
1366
|
+
const resolvedIdentity = this.resolveTelemetryIdentity(identity);
|
|
1367
|
+
this.telemetryId = resolvedIdentity.telemetryId;
|
|
1368
|
+
this.licenseToken = resolvedIdentity.licenseToken;
|
|
1369
|
+
this.licenseTelemetryId = resolvedIdentity.licenseTelemetryId;
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Configure legacy license-derived telemetry identity.
|
|
1373
|
+
*
|
|
1374
|
+
* @param licenseToken - License token whose telemetry claim identifies sends.
|
|
1375
|
+
*/
|
|
1289
1376
|
setLicenseToken(licenseToken) {
|
|
1290
|
-
this.licenseToken
|
|
1291
|
-
|
|
1377
|
+
this.setTelemetryIdentity({ licenseToken });
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Create an immutable capture scope for one runtime.
|
|
1381
|
+
*
|
|
1382
|
+
* The scope shares this client's sinks, process-wide opt-out, global
|
|
1383
|
+
* properties, and sampling settings, but snapshots transport identity and
|
|
1384
|
+
* license-derived sampling authority. Constructing another runtime cannot
|
|
1385
|
+
* rewrite an existing scope.
|
|
1386
|
+
*
|
|
1387
|
+
* @param identity - The runtime's construction-time telemetry identity.
|
|
1388
|
+
* @returns A capture-only client bound to that identity.
|
|
1389
|
+
*/
|
|
1390
|
+
createScope(identity) {
|
|
1391
|
+
const resolvedIdentity = this.resolveTelemetryIdentity(identity);
|
|
1392
|
+
return { capture: (event, properties) => this.captureWithIdentity(event, properties, resolvedIdentity) };
|
|
1393
|
+
}
|
|
1394
|
+
resolveTelemetryIdentity(identity) {
|
|
1395
|
+
var _identity$licenseToke2;
|
|
1396
|
+
const telemetryId = firstNonBlankTelemetryId(identity.telemetryId);
|
|
1397
|
+
if (telemetryId !== void 0) return {
|
|
1398
|
+
telemetryId,
|
|
1399
|
+
licenseToken: null,
|
|
1400
|
+
licenseTelemetryId: null
|
|
1401
|
+
};
|
|
1402
|
+
return {
|
|
1403
|
+
telemetryId: null,
|
|
1404
|
+
licenseToken: (_identity$licenseToke2 = identity.licenseToken) !== null && _identity$licenseToke2 !== void 0 ? _identity$licenseToke2 : null,
|
|
1405
|
+
licenseTelemetryId: identity.licenseToken ? parseAndWarnTelemetryId(identity.licenseToken) : null
|
|
1406
|
+
};
|
|
1292
1407
|
}
|
|
1293
1408
|
setSampleRate(sampleRate) {
|
|
1294
1409
|
let _sampleRate;
|
|
@@ -1676,7 +1791,7 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1676
1791
|
|
|
1677
1792
|
//#endregion
|
|
1678
1793
|
//#region package.json
|
|
1679
|
-
var version = "1.
|
|
1794
|
+
var version = "1.70.0";
|
|
1680
1795
|
|
|
1681
1796
|
//#endregion
|
|
1682
1797
|
//#region src/a2ui-prompts.ts
|
|
@@ -1797,27 +1912,46 @@ Use the SAME surfaceId as the main surface. Match action names to button action
|
|
|
1797
1912
|
//#endregion
|
|
1798
1913
|
//#region src/index.ts
|
|
1799
1914
|
const COPILOTKIT_VERSION = version;
|
|
1915
|
+
/** Read a record value without traversing its prototype chain. */
|
|
1916
|
+
function getOwnRecordValue(record, key) {
|
|
1917
|
+
return Object.prototype.hasOwnProperty.call(record, key) ? record[key] : void 0;
|
|
1918
|
+
}
|
|
1919
|
+
/** Legacy UI surfaces that remain available for every active entitlement. */
|
|
1920
|
+
function isLegacyUiFeature(feature) {
|
|
1921
|
+
return feature === "chat" || feature === "popup" || feature === "sidebar";
|
|
1922
|
+
}
|
|
1800
1923
|
/**
|
|
1801
|
-
* Client-safe license context factory, driven by the license
|
|
1924
|
+
* Client-safe license context factory, driven by the license authority the
|
|
1802
1925
|
* runtime reports via /info.
|
|
1803
1926
|
*
|
|
1804
|
-
*
|
|
1805
|
-
*
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
1808
|
-
*
|
|
1809
|
-
*
|
|
1810
|
-
*
|
|
1811
|
-
*
|
|
1927
|
+
* A ready managed entitlement is authoritative in both directions. A ready
|
|
1928
|
+
* active self-hosted entitlement is also authoritative, while an inactive
|
|
1929
|
+
* self-hosted response preserves the legacy signed-license fallback. Active
|
|
1930
|
+
* entitlements supply feature grants and limits; authoritative inactive
|
|
1931
|
+
* entitlements deny every feature and limit. Older runtimes that report only a
|
|
1932
|
+
* status retain the legacy behavior: features are enabled unless the status is
|
|
1933
|
+
* "expired" or "invalid", and no limits are reported. This is inlined here to
|
|
1934
|
+
* avoid importing the full license-verifier bundle (which depends on Node's
|
|
1935
|
+
* `crypto`) into browser bundles.
|
|
1812
1936
|
*/
|
|
1813
|
-
function createLicenseContextValue(status) {
|
|
1814
|
-
const
|
|
1937
|
+
function createLicenseContextValue(status, runtimeEntitlements) {
|
|
1938
|
+
const readyEntitlement = (runtimeEntitlements === null || runtimeEntitlements === void 0 ? void 0 : runtimeEntitlements.status) === "ready" ? runtimeEntitlements.entitlement : null;
|
|
1939
|
+
const hasUsableSelfHostedLegacyFallback = readyEntitlement && !readyEntitlement.active && readyEntitlement.source === "selfHostedDeploymentLicense" && (status === "valid" || status === "expiring");
|
|
1940
|
+
const featureAuthority = readyEntitlement && !hasUsableSelfHostedLegacyFallback ? readyEntitlement : null;
|
|
1941
|
+
const activeEntitlement = (featureAuthority === null || featureAuthority === void 0 ? void 0 : featureAuthority.active) ? featureAuthority : null;
|
|
1942
|
+
const resolvedStatus = activeEntitlement ? "valid" : (readyEntitlement === null || readyEntitlement === void 0 ? void 0 : readyEntitlement.source) === "managedOrgSubscription" ? "none" : featureAuthority ? status !== null && status !== void 0 ? status : "none" : status !== null && status !== void 0 ? status : null;
|
|
1815
1943
|
const featuresEnabled = resolvedStatus !== "expired" && resolvedStatus !== "invalid";
|
|
1816
1944
|
return {
|
|
1817
1945
|
status: resolvedStatus,
|
|
1818
1946
|
license: null,
|
|
1819
|
-
checkFeature: () =>
|
|
1820
|
-
|
|
1947
|
+
checkFeature: (feature) => {
|
|
1948
|
+
var _getOwnRecordValue;
|
|
1949
|
+
return featureAuthority ? activeEntitlement ? feature === "threads" && Object.prototype.hasOwnProperty.call(activeEntitlement.limits, "threads.max_count") ? true : (_getOwnRecordValue = getOwnRecordValue(activeEntitlement.features, feature)) !== null && _getOwnRecordValue !== void 0 ? _getOwnRecordValue : isLegacyUiFeature(feature) : false : featuresEnabled;
|
|
1950
|
+
},
|
|
1951
|
+
getLimit: (feature) => {
|
|
1952
|
+
var _getOwnRecordValue2;
|
|
1953
|
+
return activeEntitlement ? (_getOwnRecordValue2 = getOwnRecordValue(activeEntitlement.limits, feature)) !== null && _getOwnRecordValue2 !== void 0 ? _getOwnRecordValue2 : null : null;
|
|
1954
|
+
}
|
|
1821
1955
|
};
|
|
1822
1956
|
}
|
|
1823
1957
|
|
|
@@ -1852,11 +1986,14 @@ exports.RUNTIME_MODE_INTELLIGENCE = RUNTIME_MODE_INTELLIGENCE;
|
|
|
1852
1986
|
exports.RUNTIME_MODE_SSE = RUNTIME_MODE_SSE;
|
|
1853
1987
|
exports.ResolvedCopilotKitError = ResolvedCopilotKitError;
|
|
1854
1988
|
exports.Severity = Severity;
|
|
1989
|
+
exports.TELEMETRY_EMITTER_V1 = TELEMETRY_EMITTER_V1;
|
|
1990
|
+
exports.TELEMETRY_EMITTER_V2 = TELEMETRY_EMITTER_V2;
|
|
1855
1991
|
exports.TelemetryClient = TelemetryClient;
|
|
1856
1992
|
exports.TranscriptionErrorCode = TranscriptionErrorCode;
|
|
1857
1993
|
exports.TranscriptionErrors = TranscriptionErrors;
|
|
1858
1994
|
exports.UpgradeRequiredError = UpgradeRequiredError;
|
|
1859
1995
|
exports.actionParametersToJsonSchema = actionParametersToJsonSchema;
|
|
1996
|
+
exports.computeSamplingMeta = computeSamplingMeta;
|
|
1860
1997
|
exports.convertJsonSchemaToZodSchema = convertJsonSchemaToZodSchema;
|
|
1861
1998
|
exports.copyToClipboard = copyToClipboard;
|
|
1862
1999
|
exports.createLicenseContextValue = createLicenseContextValue;
|
|
@@ -1865,6 +2002,7 @@ exports.ensureStructuredError = ensureStructuredError;
|
|
|
1865
2002
|
exports.exceedsMaxSize = exceedsMaxSize;
|
|
1866
2003
|
exports.executeConditions = executeConditions;
|
|
1867
2004
|
exports.finalizeRunEvents = finalizeRunEvents;
|
|
2005
|
+
exports.firstNonBlankTelemetryId = firstNonBlankTelemetryId;
|
|
1868
2006
|
exports.formatFileSize = formatFileSize;
|
|
1869
2007
|
exports.generateVideoThumbnail = generateVideoThumbnail;
|
|
1870
2008
|
exports.getDocumentIcon = getDocumentIcon;
|
|
@@ -1896,6 +2034,7 @@ exports.readFileAsBase64 = readFileAsBase64;
|
|
|
1896
2034
|
exports.resolveDebugConfig = resolveDebugConfig;
|
|
1897
2035
|
exports.safeParseToolArgs = safeParseToolArgs;
|
|
1898
2036
|
exports.schemaToJsonSchema = schemaToJsonSchema;
|
|
2037
|
+
exports.shouldEnableInspector = shouldEnableInspector;
|
|
1899
2038
|
exports.styledConsole = styledConsole;
|
|
1900
2039
|
exports.tryMap = tryMap;
|
|
1901
2040
|
});
|