@moldea.ai/adapter-google-genai 1.0.2 → 1.0.3
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 +1 -1
- package/dist/index.js +8 -5
- package/dist/inspection/relationships.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1634,7 +1634,7 @@ var inspectGoogleGenAiPackage = async (session, sourcePath, evidence, diagnostic
|
|
|
1634
1634
|
//#endregion
|
|
1635
1635
|
//#region src/inspection/relationships.ts
|
|
1636
1636
|
var getExpressionRange = (analysis, expression) => expression === null ? null : analysis.text.locator.locateRange(expression.getStart(), expression.end);
|
|
1637
|
-
var inspectInputSchema = async (session, agent, capabilityId, reference, registrationAnalysis, parametersJsonSchema, evidence, diagnostics) => {
|
|
1637
|
+
var inspectInputSchema = async (session, agent, capabilityId, reference, registrationAnalysis, parametersJsonSchema, hasAmbiguousCandidate, evidence, diagnostics) => {
|
|
1638
1638
|
if (reference.symbol === void 0) return;
|
|
1639
1639
|
const schemaAnalysis = await analyzeGoogleGenAiBoundReference(session, reference, diagnostics, agent.id, capabilityId);
|
|
1640
1640
|
if (schemaAnalysis === null) return;
|
|
@@ -1644,7 +1644,7 @@ var inspectInputSchema = async (session, agent, capabilityId, reference, registr
|
|
|
1644
1644
|
return;
|
|
1645
1645
|
}
|
|
1646
1646
|
if (schema.kind !== "present-supported" || parametersJsonSchema === null) {
|
|
1647
|
-
if (schema.kind === "present-supported" && parametersJsonSchema === null) addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_TOOL_INPUT_SCHEMA_NOT_WIRED", registrationAnalysis.path, agent.id, null, capabilityId);
|
|
1647
|
+
if (schema.kind === "present-supported" && parametersJsonSchema === null && !hasAmbiguousCandidate) addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_TOOL_INPUT_SCHEMA_NOT_WIRED", registrationAnalysis.path, agent.id, null, capabilityId);
|
|
1648
1648
|
return;
|
|
1649
1649
|
}
|
|
1650
1650
|
if (parametersJsonSchema === void 0) return;
|
|
@@ -1665,7 +1665,7 @@ var inspectInputSchema = async (session, agent, capabilityId, reference, registr
|
|
|
1665
1665
|
runtimeName: reference.symbol,
|
|
1666
1666
|
source: GOOGLE_GENAI_ADAPTER_ID
|
|
1667
1667
|
}));
|
|
1668
|
-
else if (relationship.kind === "absent") addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_TOOL_INPUT_SCHEMA_NOT_WIRED", registrationAnalysis.path, agent.id, getExpressionRange(registrationAnalysis, relationship.expression), capabilityId);
|
|
1668
|
+
else if (relationship.kind === "absent" && !hasAmbiguousCandidate) addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_TOOL_INPUT_SCHEMA_NOT_WIRED", registrationAnalysis.path, agent.id, getExpressionRange(registrationAnalysis, relationship.expression), capabilityId);
|
|
1669
1669
|
};
|
|
1670
1670
|
var inspectRegistration = async (session, agent, capabilityId, tool, evidence, diagnostics) => {
|
|
1671
1671
|
const reference = tool.registration;
|
|
@@ -1680,14 +1680,13 @@ var inspectRegistration = async (session, agent, capabilityId, tool, evidence, d
|
|
|
1680
1680
|
const declaration = registrationAnalysis.moduleConstDeclarations.get(reference.symbol);
|
|
1681
1681
|
if (declaration === void 0 || !isModuleConstValueSafe(registrationAnalysis, declaration, /* @__PURE__ */ new Set(), "object")) return null;
|
|
1682
1682
|
if (shape.kind === "present-unsupported") {
|
|
1683
|
-
if (tool.inputSchema !== void 0) await inspectInputSchema(session, agent, capabilityId, tool.inputSchema, registrationAnalysis, void 0, evidence, diagnostics);
|
|
1683
|
+
if (tool.inputSchema !== void 0) await inspectInputSchema(session, agent, capabilityId, tool.inputSchema, registrationAnalysis, void 0, true, evidence, diagnostics);
|
|
1684
1684
|
return null;
|
|
1685
1685
|
}
|
|
1686
1686
|
const isNameMatch = shape.detectedName === tool.name;
|
|
1687
1687
|
const isNameValid = isGoogleGenAiFunctionNameValid(shape.detectedName);
|
|
1688
1688
|
if (!isNameMatch) addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_TOOL_NAME_MISMATCH", registrationAnalysis.path, agent.id, getExpressionRange(registrationAnalysis, shape.name), capabilityId);
|
|
1689
1689
|
if (!isNameValid) addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_TOOL_NAME_INVALID", registrationAnalysis.path, agent.id, getExpressionRange(registrationAnalysis, shape.name), capabilityId);
|
|
1690
|
-
if (tool.inputSchema !== void 0) await inspectInputSchema(session, agent, capabilityId, tool.inputSchema, registrationAnalysis, shape.parametersJsonSchema, evidence, diagnostics);
|
|
1691
1690
|
return Object.freeze({
|
|
1692
1691
|
analysis: registrationAnalysis,
|
|
1693
1692
|
capabilityId,
|
|
@@ -1742,6 +1741,10 @@ var inspectToolRelationships = async (session, agent, runtimeAnalysis, generateC
|
|
|
1742
1741
|
reference
|
|
1743
1742
|
}));
|
|
1744
1743
|
const collections = await analyzeGoogleGenAiToolCollections(runtimeAnalysis, generateContent.requests.map((request) => request.tools), collectionRegistrations, session, generateContent.hasAmbiguousCandidate);
|
|
1744
|
+
for (const registration of registrations) {
|
|
1745
|
+
if (registration.inputSchema === void 0) continue;
|
|
1746
|
+
await inspectInputSchema(session, agent, registration.capabilityId, registration.inputSchema, registration.analysis, registration.shape.parametersJsonSchema, collections.hasAmbiguousCandidate, evidence, diagnostics);
|
|
1747
|
+
}
|
|
1745
1748
|
for (const expression of collections.limitViolationExpressions) addGoogleGenAiDiagnostic(diagnostics, "GOOGLE_GENAI_FUNCTION_DECLARATION_LIMIT_EXCEEDED", runtimeAnalysis.path, agent.id, getExpressionRange(runtimeAnalysis, expression));
|
|
1746
1749
|
registrations.forEach((registration, index) => {
|
|
1747
1750
|
if (collections.presentRegistrationIndexes.has(index)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/inspection/relationships.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,KAAK,EACV,mCAAmC,EACnC,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/inspection/relationships.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,KAAK,EACV,mCAAmC,EACnC,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AA2a/B;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,GAC1C,SAAS,6BAA6B,EACtC,OAAO,aAAa,EACpB,iBAAiB,0BAA0B,EAC3C,iBAAiB,mCAAmC,EACpD,UAAU,uBAAuB,EAAE,EACnC,aAAa,kBAAkB,EAAE,KAChC,OAAO,CAAC,IAAI,CAiBd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moldea.ai/adapter-google-genai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Deterministic runtime evidence and diagnostics for direct Google Gen AI SDK integrations.",
|
|
5
5
|
"homepage": "https://github.com/moldea-ai/packages/tree/main/projects/adapter-google-genai#readme",
|
|
6
6
|
"bugs": {
|