@moldea.ai/adapter-google-genai 3.0.1 → 3.0.2

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 CHANGED
@@ -8,7 +8,7 @@ The package implements the official `google-genai` runtime adapter for `@moldea.
8
8
 
9
9
  ## Supported target
10
10
 
11
- Version `3.0.1` supports:
11
+ Version `3.0.2` supports:
12
12
 
13
13
  - Repository Format version `1`
14
14
  - `@moldea.ai/core ^4.0.0`
@@ -63,6 +63,8 @@ Tests are colocated with their owning modules. Canonical conformance fixtures li
63
63
 
64
64
  ## Documentation
65
65
 
66
+ - [Complete binding example](docs/binding-example.md): manifest, canonical instructions, runtime source, and supported schema or routing relationships.
67
+
66
68
  These guides are included in the installed package. Open only the page relevant to your task.
67
69
 
68
70
  - [Package overview](docs/index.md)
@@ -0,0 +1,152 @@
1
+ ---
2
+ title: Binding example
3
+ description: Complete manifest and source files for inspecting google-genai bindings locally.
4
+ order: 5
5
+ ---
6
+
7
+ # Binding example
8
+
9
+ Read this example before searching adapter implementation for binding syntax. It is a complete **static inspection** file set, not a deployment starter or a live provider test. The files are checked together through this adapter and Core without installing or executing the target SDK. Keep application setup, credentials, provider model access, tool execution, and deployment configuration separate.
10
+
11
+ ## How the bindings connect
12
+
13
+ The exported `supportAgent` function binds `generateContent`. `config.systemInstruction` calls the canonical loader; `config.tools[].functionDeclarations[]` contains the registered declaration. Use `parametersJsonSchema`, not `parameters`. This target does not inspect agent output schemas, tool output schemas, or handoffs. Function-call execution remains application-owned.
14
+
15
+ Paths below are repository-root-relative logical paths. Keep the canonical instructions as the policy source. General manifest semantics belong to the [Repository Format specification](https://packages.moldea.ai/repository-format/). Use the other local guides for the full supported boundary and limitations; this example does not expand them.
16
+
17
+ ## Files
18
+
19
+ <!-- example:start -->
20
+
21
+ ### /moldea/moldea.yaml
22
+
23
+ ```yaml
24
+ version: 1
25
+ agents:
26
+ support:
27
+ runtime:
28
+ id: 'google-genai'
29
+ bindings:
30
+ runtimeAgent:
31
+ path: '/src/agent.ts'
32
+ symbol: 'supportAgent'
33
+ instructionLoader:
34
+ path: '/src/instructions.ts'
35
+ symbol: 'loadInstruction'
36
+ tools:
37
+ find-order:
38
+ name: 'find_order'
39
+ description: 'Retrieves one order by its identifier.'
40
+ implementation:
41
+ path: '/src/find-order.ts'
42
+ symbol: 'findOrder'
43
+ registration:
44
+ path: '/src/find-order.ts'
45
+ symbol: 'findOrderDeclaration'
46
+ inputSchema:
47
+ path: '/src/contracts.ts'
48
+ symbol: 'FindOrderInput'
49
+ ```
50
+
51
+ ### /moldea/project.md
52
+
53
+ ```markdown
54
+ # Google Gen AI adapter fixture
55
+ ```
56
+
57
+ ### /moldea/agents/support/description.md
58
+
59
+ ```markdown
60
+ Support agent.
61
+ ```
62
+
63
+ ### /moldea/agents/support/instruction.md
64
+
65
+ ```markdown
66
+ You are the `support` agent.
67
+
68
+ Answer from supplied support facts. Do not invent order status or account information.
69
+ ```
70
+
71
+ ### /package.json
72
+
73
+ ```json
74
+ {
75
+ "dependencies": {
76
+ "@google/genai": "^2.17.1"
77
+ },
78
+ "name": "binding-example",
79
+ "private": true,
80
+ "type": "module"
81
+ }
82
+ ```
83
+
84
+ ### /src/agent.ts
85
+
86
+ ```typescript
87
+ import { GoogleGenAI as GenAi } from '@google/genai';
88
+
89
+ import { findOrderDeclaration as registeredFindOrder } from './find-order.js';
90
+ import { loadInstruction as readInstruction } from './instructions.js';
91
+
92
+ const client = new GenAi({ apiKey: process.env['GEMINI_API_KEY'] });
93
+
94
+ export const supportAgent = async () =>
95
+ client.models.generateContent({
96
+ model: 'gemini-2.5-flash',
97
+ contents: 'Help the customer.',
98
+ config: {
99
+ systemInstruction: await readInstruction(),
100
+ tools: [
101
+ {
102
+ functionDeclarations: [registeredFindOrder],
103
+ },
104
+ ],
105
+ },
106
+ });
107
+ ```
108
+
109
+ ### /src/contracts.ts
110
+
111
+ ```typescript
112
+ export const FindOrderInput = {
113
+ additionalProperties: false,
114
+ properties: { orderId: { type: 'string' } },
115
+ required: ['orderId'],
116
+ type: 'object',
117
+ } as const;
118
+ ```
119
+
120
+ ### /src/find-order.ts
121
+
122
+ ```typescript
123
+ import { FindOrderInput } from './contracts.js';
124
+
125
+ /** Looks up an order in the example's fixed catalog. */
126
+ export const findOrder = async (orderId: string) => ({
127
+ orderId,
128
+ status: orderId === 'order-1042' ? 'shipped' : 'not_found',
129
+ });
130
+
131
+ export const findOrderDeclaration = {
132
+ name: 'find_order',
133
+ description: 'Retrieves one order by its identifier.',
134
+ parametersJsonSchema: FindOrderInput,
135
+ } as const;
136
+ ```
137
+
138
+ ### /src/instructions.ts
139
+
140
+ ```typescript
141
+ import { readFileSync } from 'node:fs';
142
+
143
+ /** Reads the canonical support instruction. */
144
+ export const loadInstruction = (): string =>
145
+ readFileSync(new URL('../moldea/agents/support/instruction.md', import.meta.url), 'utf8');
146
+ ```
147
+
148
+ <!-- example:end -->
149
+
150
+ ## What the check establishes
151
+
152
+ The integration check reads these exact file blocks, requires positive adapter evidence for the documented relationships, and rejects a broken runtime binding. It does not prove that instructions are followed, that every SDK version accepts these forms, or that the application is ready for production. Continue using the installed adapter diagnostics for your actual source.
package/docs/index.md CHANGED
@@ -19,3 +19,5 @@ const core = createCore({ adapters: [googleGenAiAdapter] });
19
19
  The package is available with one technical target covering TypeScript ESM using direct `models.generateContent` calls with npm `@google/genai >=2.17.1`, Repository Format version `1`, and Core `^4.0.0`.
20
20
 
21
21
  The adapter never imports or calls the Google Gen AI SDK, executes no repository code, requires no credentials, and makes no network request. Its only public export is the immutable `googleGenAiAdapter` singleton.
22
+
23
+ Start with the [complete binding example](https://packages.moldea.ai/adapters/google-genai/binding-example/) when connecting runtime source to canonical instructions, schemas, tools, or routing metadata. The same example ships locally as `docs/binding-example.md` in the installed package.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moldea.ai/adapter-google-genai",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
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": {