@decocms/bindings 1.0.1-alpha.23 → 1.0.1-alpha.25

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/bindings",
3
- "version": "1.0.1-alpha.23",
3
+ "version": "1.0.1-alpha.25",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",
@@ -171,8 +171,6 @@ export function createBindingChecker<TDefinition extends readonly ToolBinder[]>(
171
171
  if (!matchedTool) {
172
172
  return false;
173
173
  }
174
- return true;
175
-
176
174
  // FIXME @mcandeia Zod to JSONSchema converstion is creating inconsistent schemas
177
175
  }
178
176
  return true;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Defines the interface for AI agent providers.
5
5
  * Any MCP that implements this binding can provide configurable AI agents
6
- * with custom instructions and tool access controls.
6
+ * with a system prompt and runtime configuration (gateway + model).
7
7
  *
8
- * This binding uses collection bindings for LIST and GET operations (read-only).
8
+ * This binding uses collection bindings for LIST and GET operations.
9
9
  */
10
10
 
11
11
  import { z } from "zod";
@@ -21,17 +21,35 @@ import {
21
21
  * Base schema already includes: id, title, created_at, updated_at, created_by, updated_by
22
22
  */
23
23
  export const AgentSchema = BaseCollectionEntitySchema.extend({
24
- // Agent-specific fields
25
- description: z.string().describe("Brief description of the agent's purpose"),
26
- instructions: z
24
+ /**
25
+ * Agent avatar.
26
+ * Can be a regular URL or a data URI.
27
+ */
28
+ avatar: z.string().describe("URL or data URI to the agent's avatar image"),
29
+
30
+ /**
31
+ * System prompt that defines the agent's behavior.
32
+ */
33
+ system_prompt: z
27
34
  .string()
28
- .describe("System instructions that define the agent's behavior"),
29
- tool_set: z
30
- .record(z.string(), z.array(z.string()))
31
- .describe(
32
- "Map of connection IDs to arrays of allowed tool names for this agent",
33
- ),
34
- avatar: z.string().url().describe("URL to the agent's avatar image"),
35
+ .describe("System prompt that defines the agent's behavior"),
36
+
37
+ /**
38
+ * Selected gateway for this agent (single gateway).
39
+ * This gateway determines which MCP tools are exposed to chat.
40
+ */
41
+ gateway_id: z.string().describe("Gateway ID to use for this agent"),
42
+
43
+ /**
44
+ * Selected model for this agent (model id + the connection where it lives).
45
+ * This allows the UI/runtime to call the correct model provider connection.
46
+ */
47
+ model: z
48
+ .object({
49
+ id: z.string().describe("Model ID"),
50
+ connectionId: z.string().describe("Connection ID that provides the model"),
51
+ })
52
+ .describe("Selected model reference for this agent"),
35
53
  });
36
54
 
37
55
  /**
@@ -53,7 +71,7 @@ export const AGENTS_COLLECTION_BINDING = createCollectionBindings(
53
71
  *
54
72
  * Required tools:
55
73
  * - COLLECTION_AGENT_LIST: List available AI agents with their configurations
56
- * - COLLECTION_AGENT_GET: Get a single agent by ID (includes instructions and tool_set)
74
+ * - COLLECTION_AGENT_GET: Get a single agent by ID (includes system_prompt, gateway_id, model)
57
75
  */
58
76
  export const AGENTS_BINDING = [
59
77
  ...AGENTS_COLLECTION_BINDING,