@oh-my-pi/pi-ai 13.3.8 → 13.3.10
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-ai",
|
|
4
|
-
"version": "13.3.
|
|
4
|
+
"version": "13.3.10",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"homepage": "https://github.com/can1357/oh-my-pi",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@aws-sdk/client-bedrock-runtime": "^3.998",
|
|
42
42
|
"@bufbuild/protobuf": "^2.11",
|
|
43
43
|
"@google/genai": "^1.43",
|
|
44
|
-
"@oh-my-pi/pi-utils": "13.3.
|
|
44
|
+
"@oh-my-pi/pi-utils": "13.3.10",
|
|
45
45
|
"@sinclair/typebox": "^0.34",
|
|
46
46
|
"@smithy/node-http-handler": "^4.4",
|
|
47
47
|
"ajv": "^8.18",
|
|
@@ -566,6 +566,16 @@ const CLOUD_CODE_ASSIST_TYPE_SPECIFIC_KEYS: Record<string, ReadonlySet<string>>
|
|
|
566
566
|
null: new Set(),
|
|
567
567
|
};
|
|
568
568
|
|
|
569
|
+
const CLOUD_CODE_ASSIST_SHARED_SCHEMA_KEYS = new Set([
|
|
570
|
+
"title",
|
|
571
|
+
"description",
|
|
572
|
+
"default",
|
|
573
|
+
"examples",
|
|
574
|
+
"deprecated",
|
|
575
|
+
"readOnly",
|
|
576
|
+
"writeOnly",
|
|
577
|
+
"$comment",
|
|
578
|
+
]);
|
|
569
579
|
function collapseMixedTypeCombinerVariants(schema: JsonObject, combiner: "anyOf" | "oneOf"): JsonObject {
|
|
570
580
|
const variantsRaw = schema[combiner];
|
|
571
581
|
if (!Array.isArray(variantsRaw) || variantsRaw.length === 0) {
|
|
@@ -592,7 +602,7 @@ function collapseMixedTypeCombinerVariants(schema: JsonObject, combiner: "anyOf"
|
|
|
592
602
|
|
|
593
603
|
for (const [key, variantValue] of Object.entries(entry)) {
|
|
594
604
|
if (key === "type") continue;
|
|
595
|
-
if (!allowedKeys.has(key)) {
|
|
605
|
+
if (!allowedKeys.has(key) && !CLOUD_CODE_ASSIST_SHARED_SCHEMA_KEYS.has(key)) {
|
|
596
606
|
return schema;
|
|
597
607
|
}
|
|
598
608
|
|
|
@@ -619,7 +629,13 @@ function collapseMixedTypeCombinerVariants(schema: JsonObject, combiner: "anyOf"
|
|
|
619
629
|
|
|
620
630
|
nextSchema.type = variantTypes;
|
|
621
631
|
for (const [key, value] of Object.entries(mergedVariantFields)) {
|
|
622
|
-
nextSchema[key]
|
|
632
|
+
const existingValue = nextSchema[key];
|
|
633
|
+
if (existingValue !== undefined && !areJsonValuesEqual(existingValue, value)) {
|
|
634
|
+
return schema;
|
|
635
|
+
}
|
|
636
|
+
if (existingValue === undefined) {
|
|
637
|
+
nextSchema[key] = value;
|
|
638
|
+
}
|
|
623
639
|
}
|
|
624
640
|
return nextSchema;
|
|
625
641
|
}
|
package/src/stream.ts
CHANGED
|
@@ -71,6 +71,7 @@ const serviceProviderMap: Record<string, KeyResolver> = {
|
|
|
71
71
|
cursor: "CURSOR_ACCESS_TOKEN",
|
|
72
72
|
"azure-openai-responses": "AZURE_OPENAI_API_KEY",
|
|
73
73
|
exa: "EXA_API_KEY",
|
|
74
|
+
jina: "JINA_API_KEY",
|
|
74
75
|
brave: "BRAVE_API_KEY",
|
|
75
76
|
perplexity: "PERPLEXITY_API_KEY",
|
|
76
77
|
// GitHub Copilot uses GitHub personal access token
|
|
@@ -224,7 +224,8 @@ export function tryEnforceStrictSchema(schema: Record<string, unknown>): {
|
|
|
224
224
|
strict: boolean;
|
|
225
225
|
} {
|
|
226
226
|
try {
|
|
227
|
-
|
|
227
|
+
const sanitized = sanitizeSchemaForStrictMode(schema);
|
|
228
|
+
return { schema: enforceStrictSchema(sanitized), strict: true };
|
|
228
229
|
} catch {
|
|
229
230
|
return { schema, strict: false };
|
|
230
231
|
}
|