@moldea.ai/adapter-google-genai 1.0.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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/cover.png +0 -0
  4. package/dist/adapter/index.d.ts +3 -0
  5. package/dist/adapter/index.d.ts.map +1 -0
  6. package/dist/constants/index.d.ts +9 -0
  7. package/dist/constants/index.d.ts.map +1 -0
  8. package/dist/contracts/index.d.ts +108 -0
  9. package/dist/contracts/index.d.ts.map +1 -0
  10. package/dist/diagnostics/index.d.ts +25 -0
  11. package/dist/diagnostics/index.d.ts.map +1 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +1922 -0
  15. package/dist/inspection/common.d.ts +34 -0
  16. package/dist/inspection/common.d.ts.map +1 -0
  17. package/dist/inspection/index.d.ts +2 -0
  18. package/dist/inspection/index.d.ts.map +1 -0
  19. package/dist/inspection/inspection.d.ts +18 -0
  20. package/dist/inspection/inspection.d.ts.map +1 -0
  21. package/dist/inspection/package-inspection.d.ts +14 -0
  22. package/dist/inspection/package-inspection.d.ts.map +1 -0
  23. package/dist/inspection/relationships.d.ts +14 -0
  24. package/dist/inspection/relationships.d.ts.map +1 -0
  25. package/dist/inspection/session.d.ts +9 -0
  26. package/dist/inspection/session.d.ts.map +1 -0
  27. package/dist/package-discovery/index.d.ts +27 -0
  28. package/dist/package-discovery/index.d.ts.map +1 -0
  29. package/dist/source-analysis/function-declarations.d.ts +40 -0
  30. package/dist/source-analysis/function-declarations.d.ts.map +1 -0
  31. package/dist/source-analysis/generate-content.d.ts +12 -0
  32. package/dist/source-analysis/generate-content.d.ts.map +1 -0
  33. package/dist/source-analysis/index.d.ts +7 -0
  34. package/dist/source-analysis/index.d.ts.map +1 -0
  35. package/dist/source-analysis/source-analysis.d.ts +25 -0
  36. package/dist/source-analysis/source-analysis.d.ts.map +1 -0
  37. package/dist/source-analysis/tool-collections.d.ts +26 -0
  38. package/dist/source-analysis/tool-collections.d.ts.map +1 -0
  39. package/package.json +60 -0
@@ -0,0 +1,34 @@
1
+ import type { IRuntimeAdapterEvidence, ISourceRange } from '@moldea.ai/core';
2
+ import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
3
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
4
+ import type { IRepositoryPath } from '@moldea.ai/repository';
5
+ import type { IGoogleGenAiAdapterDiagnosticCode, IGoogleGenAiInspectionSession, IGoogleGenAiSourceAnalysis } from '../contracts/index.js';
6
+ /** Compares exact strings without locale-dependent behavior. */
7
+ export declare const compareGoogleGenAiStrings: (left: string, right: string) => number;
8
+ /**
9
+ * Creates one deeply immutable Google Gen AI evidence record.
10
+ * @param evidence The complete evidence value.
11
+ * @returns The frozen evidence record.
12
+ */
13
+ export declare const createGoogleGenAiEvidence: (evidence: IRuntimeAdapterEvidence) => IRuntimeAdapterEvidence;
14
+ /**
15
+ * Appends one stable package-owned diagnostic.
16
+ * @param diagnostics The operation result collection.
17
+ * @param code The stable diagnostic code.
18
+ * @param path The exact affected path.
19
+ * @param agentId The owning agent identifier.
20
+ * @param range The optional scalar source range.
21
+ * @param capabilityId The optional owning tool capability.
22
+ */
23
+ export declare const addGoogleGenAiDiagnostic: (diagnostics: IAdapterDiagnostic[], code: IGoogleGenAiAdapterDiagnosticCode, path: IRepositoryPath | null, agentId: string, range?: ISourceRange | null, capabilityId?: string) => void;
24
+ /**
25
+ * Loads and validates one supported bound TypeScript source.
26
+ * @param session The operation-local inspection session.
27
+ * @param reference The exact manifest reference.
28
+ * @param diagnostics The operation result collection.
29
+ * @param agentId The owning agent identifier.
30
+ * @param capabilityId The optional owning tool capability.
31
+ * @returns The indexed source or `null` after unsupported or invalid input.
32
+ */
33
+ export declare const analyzeGoogleGenAiBoundReference: (session: IGoogleGenAiInspectionSession, reference: IRepositoryReference, diagnostics: IAdapterDiagnostic[], agentId: string, capabilityId?: string) => Promise<IGoogleGenAiSourceAnalysis | null>;
34
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/inspection/common.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EACV,iCAAiC,EACjC,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AAG/B,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAC9B,CAAC;AAQ3C;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,uBAAuB,KAChC,uBAKC,CAAC;AASL;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,aAAa,kBAAkB,EAAE,EACjC,MAAM,iCAAiC,EACvC,MAAM,eAAe,GAAG,IAAI,EAC5B,SAAS,MAAM,EACf,QAAO,YAAY,GAAG,IAAW,EACjC,eAAe,MAAM,KACpB,IAWF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,GAC3C,SAAS,6BAA6B,EACtC,WAAW,oBAAoB,EAC/B,aAAa,kBAAkB,EAAE,EACjC,SAAS,MAAM,EACf,eAAe,MAAM,KACpB,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAgC3C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { inspectGoogleGenAi } from './inspection.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inspection/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { IRuntimeAdapterContext, IRuntimeAdapterResult } from '@moldea.ai/core/adapter';
2
+ /**
3
+ * Inspects all scoped Google Gen AI agents through one deterministic operation-local session.
4
+ * @param context The Core-provided immutable adapter context.
5
+ * @returns A promise resolving to source-grounded evidence and diagnostics.
6
+ * @throws
7
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
8
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
9
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
10
+ * - ACCESS_DENIED: Access to the repository source was denied.
11
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
12
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
13
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
14
+ * - RESOURCE_LIMIT_EXCEEDED: A repository reading resource limit was exceeded.
15
+ * - ABORTED: The repository operation or inspection signal was aborted.
16
+ */
17
+ export declare const inspectGoogleGenAi: (context: IRuntimeAdapterContext) => Promise<IRuntimeAdapterResult>;
18
+ //# sourceMappingURL=inspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/inspection/inspection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAqHjC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,sBAAsB,KAC9B,OAAO,CAAC,qBAAqB,CAmB/B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { IRuntimeAdapterEvidence } from '@moldea.ai/core';
2
+ import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
3
+ import type { IRepositoryPath } from '@moldea.ai/repository';
4
+ import type { IGoogleGenAiInspectionSession } from '../contracts/index.js';
5
+ /**
6
+ * Inspects the nearest owning package manifest for one agent runtime source.
7
+ * @param session The operation-local inspection session.
8
+ * @param sourcePath The runtime-agent source path.
9
+ * @param evidence The operation evidence collection.
10
+ * @param diagnostics The operation diagnostic collection.
11
+ * @param agentId The owning agent identifier.
12
+ */
13
+ export declare const inspectGoogleGenAiPackage: (session: IGoogleGenAiInspectionSession, sourcePath: IRepositoryPath, evidence: IRuntimeAdapterEvidence[], diagnostics: IAdapterDiagnostic[], agentId: string) => Promise<void>;
14
+ //# sourceMappingURL=package-inspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-inspection.d.ts","sourceRoot":"","sources":["../../src/inspection/package-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAG3E;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,SAAS,6BAA6B,EACtC,YAAY,eAAe,EAC3B,UAAU,uBAAuB,EAAE,EACnC,aAAa,kBAAkB,EAAE,EACjC,SAAS,MAAM,KACd,OAAO,CAAC,IAAI,CA+Cd,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core';
2
+ import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
3
+ import type { IGoogleGenAiGenerateContentAnalysis, IGoogleGenAiInspectionSession, IGoogleGenAiSourceAnalysis } from '../contracts/index.js';
4
+ /**
5
+ * Inspects loader, tool-registration, input-schema, and provider-limit relationships.
6
+ * @param session The operation-local inspection session.
7
+ * @param agent The indexed agent declaration.
8
+ * @param runtimeAnalysis The indexed runtime-agent source.
9
+ * @param generateContent The nested generate-content request analysis.
10
+ * @param evidence The operation evidence collection.
11
+ * @param diagnostics The operation diagnostic collection.
12
+ */
13
+ export declare const inspectGoogleGenAiRelationships: (session: IGoogleGenAiInspectionSession, agent: IIndexedAgent, runtimeAnalysis: IGoogleGenAiSourceAnalysis, generateContent: IGoogleGenAiGenerateContentAnalysis, evidence: IRuntimeAdapterEvidence[], diagnostics: IAdapterDiagnostic[]) => Promise<void>;
14
+ //# sourceMappingURL=relationships.d.ts.map
@@ -0,0 +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;AAga/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"}
@@ -0,0 +1,9 @@
1
+ import type { IRuntimeAdapterContext } from '@moldea.ai/core/adapter';
2
+ import type { IGoogleGenAiInspectionSession } from '../contracts/index.js';
3
+ /**
4
+ * Creates one operation-local Google Gen AI inspection session and its deterministic caches.
5
+ * @param context The Core-owned adapter context.
6
+ * @returns The source and package analysis session.
7
+ */
8
+ export declare const createGoogleGenAiInspectionSession: (context: IRuntimeAdapterContext) => IGoogleGenAiInspectionSession;
9
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/inspection/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAI3E;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,GAC7C,SAAS,sBAAsB,KAC9B,6BASC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { IRepositoryPath, IRepositoryReader } from '@moldea.ai/repository';
2
+ import type { IGoogleGenAiPackageDiscoveryResult } from '../contracts/index.js';
3
+ /**
4
+ * Creates nearest-to-root package-manifest candidates for one source path.
5
+ * @param sourcePath The bound repository source path.
6
+ * @returns Deterministically ordered logical package-manifest paths.
7
+ */
8
+ export declare const createPackageManifestCandidatePaths: (sourcePath: IRepositoryPath) => readonly IRepositoryPath[];
9
+ /**
10
+ * Discovers the nearest relevant Google Gen AI package declaration without enumeration.
11
+ * @param repository The Core-owned budget-aware repository reader.
12
+ * @param sourcePath The bound source whose package scope is inspected.
13
+ * @param signal The active inspection signal.
14
+ * @returns The first observed declaration, invalid manifest, or absence result.
15
+ * @throws
16
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
17
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
18
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
19
+ * - ACCESS_DENIED: Access to the repository source was denied.
20
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
21
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
22
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
23
+ * - RESOURCE_LIMIT_EXCEEDED: A repository reading resource limit was exceeded.
24
+ * - ABORTED: The repository operation was aborted.
25
+ */
26
+ export declare const discoverGoogleGenAiPackage: (repository: IRepositoryReader, sourcePath: IRepositoryPath, signal?: AbortSignal) => Promise<IGoogleGenAiPackageDiscoveryResult>;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/package-discovery/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAOhF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,GAC9C,YAAY,eAAe,KAC1B,SAAS,eAAe,EACgD,CAAC;AAE5E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B,GACrC,YAAY,iBAAiB,EAC7B,YAAY,eAAe,EAC3B,SAAS,WAAW,KACnB,OAAO,CAAC,kCAAkC,CA4B5C,CAAC"}
@@ -0,0 +1,40 @@
1
+ import ts from 'typescript';
2
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
3
+ import type { IGoogleGenAiSourceAnalysis } from '../contracts/index.js';
4
+ export interface IGoogleGenAiFunctionDeclarationShape {
5
+ readonly detectedName: string;
6
+ readonly name: ts.Expression;
7
+ readonly object: ts.ObjectLiteralExpression;
8
+ readonly parametersJsonSchema: ts.Expression | null;
9
+ readonly properties: ReadonlyMap<string, ts.Expression>;
10
+ }
11
+ export type IGoogleGenAiFunctionDeclarationShapeResult = {
12
+ readonly kind: 'absent';
13
+ } | {
14
+ readonly kind: 'present-unsupported';
15
+ } | ({
16
+ readonly kind: 'present-supported';
17
+ } & IGoogleGenAiFunctionDeclarationShape);
18
+ /**
19
+ * Validates one closed Google Gen AI function-declaration object.
20
+ * @param analysis The source containing the declaration.
21
+ * @param object The function-declaration object literal.
22
+ * @param inputSchemaReference The optional exact manifest input-schema binding.
23
+ * @returns Its supported static shape or an unsupported observation.
24
+ */
25
+ export declare const getGoogleGenAiFunctionDeclarationObjectShape: (analysis: IGoogleGenAiSourceAnalysis, object: ts.ObjectLiteralExpression, inputSchemaReference?: IRepositoryReference) => IGoogleGenAiFunctionDeclarationShapeResult;
26
+ /**
27
+ * Resolves a directly exported constant function declaration.
28
+ * @param analysis The source containing the declared registration.
29
+ * @param symbol The exact exported registration symbol.
30
+ * @param inputSchemaReference The optional exact manifest input-schema binding.
31
+ * @returns The absent, unsupported, or supported registration shape.
32
+ */
33
+ export declare const getGoogleGenAiFunctionDeclarationShape: (analysis: IGoogleGenAiSourceAnalysis, symbol: string, inputSchemaReference?: IRepositoryReference) => IGoogleGenAiFunctionDeclarationShapeResult;
34
+ /**
35
+ * Checks the version-matched Google Gen AI SDK function-name declaration limits.
36
+ * @param name The exact statically detected function name.
37
+ * @returns Whether the name satisfies both scalar-length and ASCII-pattern limits.
38
+ */
39
+ export declare const isGoogleGenAiFunctionNameValid: (name: string) => boolean;
40
+ //# sourceMappingURL=function-declarations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-declarations.d.ts","sourceRoot":"","sources":["../../src/source-analysis/function-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAU5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAMnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,oBAAoB,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,0CAA0C,GAClD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAA;CAAE,GACxC,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;CAAE,GAAG,oCAAoC,CAAC,CAAC;AA0BpF;;;;;;GAMG;AACH,eAAO,MAAM,4CAA4C,GACvD,UAAU,0BAA0B,EACpC,QAAQ,EAAE,CAAC,uBAAuB,EAClC,uBAAuB,oBAAoB,KAC1C,0CAuCF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC,GACjD,UAAU,0BAA0B,EACpC,QAAQ,MAAM,EACd,uBAAuB,oBAAoB,KAC1C,0CAoBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GAAI,MAAM,MAAM,KAAG,OAQ7D,CAAC"}
@@ -0,0 +1,12 @@
1
+ import ts from 'typescript';
2
+ import type { IGoogleGenAiGenerateContentAnalysis, IGoogleGenAiSourceAnalysis } from '../contracts/index.js';
3
+ /**
4
+ * Finds every direct generate-content request owned by one runtime-agent body.
5
+ * @param analysis The indexed runtime source.
6
+ * @param body The supported runtime-agent lexical body.
7
+ * @param signal The active inspection signal.
8
+ * @returns Recognized requests and conservative ambiguity state.
9
+ * @throws If request analysis is aborted.
10
+ */
11
+ export declare const analyzeGoogleGenAiGenerateContent: (analysis: IGoogleGenAiSourceAnalysis, body: ts.ConciseBody, signal?: AbortSignal) => IGoogleGenAiGenerateContentAnalysis;
12
+ //# sourceMappingURL=generate-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-content.d.ts","sourceRoot":"","sources":["../../src/source-analysis/generate-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAQ5B,OAAO,KAAK,EACV,mCAAmC,EAGnC,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AA2C/B;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,GAC5C,UAAU,0BAA0B,EACpC,MAAM,EAAE,CAAC,WAAW,EACpB,SAAS,WAAW,KACnB,mCAyBF,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { analyzeGoogleGenAiGenerateContent } from './generate-content.js';
2
+ export { getGoogleGenAiFunctionDeclarationObjectShape, getGoogleGenAiFunctionDeclarationShape, isGoogleGenAiFunctionNameValid, } from './function-declarations.js';
3
+ export type { IGoogleGenAiFunctionDeclarationShape, IGoogleGenAiFunctionDeclarationShapeResult, } from './function-declarations.js';
4
+ export { analyzeGoogleGenAiToolCollections } from './tool-collections.js';
5
+ export type { IGoogleGenAiCollectionRegistration, IGoogleGenAiToolCollectionAnalysis, } from './tool-collections.js';
6
+ export { analyzeGoogleGenAiSource, GOOGLE_GENAI_SOURCE_CONFIG } from './source-analysis.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/source-analysis/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAG1E,OAAO,EACL,4CAA4C,EAC5C,sCAAsC,EACtC,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,oCAAoC,EACpC,0CAA0C,GAC3C,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,YAAY,EACV,kCAAkC,EAClC,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { IRepositoryPath } from '@moldea.ai/repository';
2
+ import type { IGoogleGenAiSourceAnalysisResult } from '../contracts/index.js';
3
+ export declare const GOOGLE_GENAI_SOURCE_CONFIG: Readonly<{
4
+ importConfig: Readonly<{
5
+ namedConstructorImports: readonly string[];
6
+ packageName: "@google/genai";
7
+ supportsDefaultConstructorImport: false;
8
+ }>;
9
+ requestConfig: Readonly<{
10
+ acceptedArgumentCounts: readonly number[];
11
+ methodName: "generateContent";
12
+ relationshipNames: readonly string[];
13
+ resourceName: "models";
14
+ }>;
15
+ }>;
16
+ /**
17
+ * Parses and indexes one supported TypeScript source without execution.
18
+ * @param path The normalized logical source path.
19
+ * @param bytes The exact source bytes returned by the repository reader.
20
+ * @param signal The active inspection signal.
21
+ * @returns A source analysis or stable invalid source result.
22
+ * @throws If source analysis is aborted.
23
+ */
24
+ export declare const analyzeGoogleGenAiSource: (path: IRepositoryPath, bytes: Uint8Array, signal?: AbortSignal) => IGoogleGenAiSourceAnalysisResult;
25
+ //# sourceMappingURL=source-analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-analysis.d.ts","sourceRoot":"","sources":["../../src/source-analysis/source-analysis.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AAE9E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAYrC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACnC,MAAM,eAAe,EACrB,OAAO,UAAU,EACjB,SAAS,WAAW,KACnB,gCAeF,CAAC"}
@@ -0,0 +1,26 @@
1
+ import ts from 'typescript';
2
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
3
+ import type { IGoogleGenAiInspectionSession, IGoogleGenAiRequestRelationship, IGoogleGenAiSourceAnalysis } from '../contracts/index.js';
4
+ export interface IGoogleGenAiCollectionRegistration {
5
+ readonly inputSchema?: IRepositoryReference;
6
+ readonly reference: IRepositoryReference & {
7
+ readonly symbol: string;
8
+ };
9
+ }
10
+ export interface IGoogleGenAiToolCollectionAnalysis {
11
+ readonly absentExpression: ts.Expression | null;
12
+ readonly hasAmbiguousCandidate: boolean;
13
+ readonly limitViolationExpressions: readonly ts.ArrayLiteralExpression[];
14
+ readonly presentRegistrationIndexes: ReadonlySet<number>;
15
+ }
16
+ /**
17
+ * Resolves nested tools and function declarations for supported generate-content requests.
18
+ * @param analysis The indexed runtime-agent source.
19
+ * @param relationships The independently classified `config.tools` relationships.
20
+ * @param registrations Declared manifest registrations in deterministic capability order.
21
+ * @param session The operation-local repository and source-analysis session.
22
+ * @param hasAmbiguousRequest Whether runtime request discovery found an unresolved candidate.
23
+ * @returns Positive registrations, conservative ambiguity, and proved limit violations.
24
+ */
25
+ export declare const analyzeGoogleGenAiToolCollections: (analysis: IGoogleGenAiSourceAnalysis, relationships: readonly IGoogleGenAiRequestRelationship[], registrations: readonly IGoogleGenAiCollectionRegistration[], session: IGoogleGenAiInspectionSession, hasAmbiguousRequest: boolean) => Promise<IGoogleGenAiToolCollectionAnalysis>;
26
+ //# sourceMappingURL=tool-collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-collections.d.ts","sourceRoot":"","sources":["../../src/source-analysis/tool-collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAW5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,OAAO,KAAK,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AAsB/B,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,oBAAoB,GAAG;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACxE;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,yBAAyB,EAAE,SAAS,EAAE,CAAC,sBAAsB,EAAE,CAAC;IACzE,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC1D;AAiQD;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC,GAC5C,UAAU,0BAA0B,EACpC,eAAe,SAAS,+BAA+B,EAAE,EACzD,eAAe,SAAS,kCAAkC,EAAE,EAC5D,SAAS,6BAA6B,EACtC,qBAAqB,OAAO,KAC3B,OAAO,CAAC,kCAAkC,CA+J5C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@moldea.ai/adapter-google-genai",
3
+ "version": "1.0.0",
4
+ "description": "Deterministic runtime evidence and diagnostics for direct Google Gen AI SDK integrations.",
5
+ "homepage": "https://github.com/moldea-ai/packages/tree/main/projects/adapter-google-genai#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/moldea-ai/packages/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/moldea-ai/packages.git",
12
+ "directory": "projects/adapter-google-genai"
13
+ },
14
+ "license": "MIT",
15
+ "author": "Jesus Graterol",
16
+ "type": "module",
17
+ "sideEffects": false,
18
+ "files": [
19
+ "cover.png",
20
+ "dist",
21
+ "LICENSE",
22
+ "README.md"
23
+ ],
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ }
29
+ },
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "engines": {
33
+ "node": "^22.11.0 || ^24.11.0"
34
+ },
35
+ "dependencies": {
36
+ "@moldea.ai/core": "^2.0.0",
37
+ "@moldea.ai/repository": "^1.0.0",
38
+ "semver": "7.8.5",
39
+ "typescript": "6.0.3"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "22.20.1",
43
+ "@types/semver": "7.8.0",
44
+ "vite": "8.2.1",
45
+ "vitest": "4.1.10",
46
+ "@moldea.ai/adapter-static-analysis": "0.0.0"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "scripts": {
52
+ "build": "vite build --emptyOutDir && tsc -p tsconfig.build.json",
53
+ "dev": "vite build --watch",
54
+ "lint": "eslint .",
55
+ "test": "pnpm run test:unit && pnpm run test:integration",
56
+ "test:integration": "pnpm run build && vitest run --config vitest/test-integration.config.ts",
57
+ "test:unit": "vitest run --config vitest/test-unit.config.ts",
58
+ "typecheck": "tsc -p tsconfig.src.json --noEmit && tsc -p tsconfig.json --noEmit"
59
+ }
60
+ }