@decocms/bindings 1.0.1-alpha.24 → 1.0.1-alpha.26

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.24",
3
+ "version": "1.0.1-alpha.26",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",
@@ -18,7 +18,7 @@
18
18
  "./connection": "./src/core/connection.ts",
19
19
  "./client": "./src/core/client/index.ts",
20
20
  "./mcp": "./src/well-known/mcp.ts",
21
- "./agent": "./src/well-known/agent.ts",
21
+ "./assistant": "./src/well-known/assistant.ts",
22
22
  "./workflow": "./src/well-known/workflow.ts"
23
23
  },
24
24
  "engines": {
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Assistants Well-Known Binding
3
+ *
4
+ * Defines the interface for AI assistant providers.
5
+ * Any MCP that implements this binding can provide configurable AI assistants
6
+ * with a system prompt and runtime configuration (gateway + model).
7
+ *
8
+ * This binding uses collection bindings for LIST and GET operations.
9
+ */
10
+
11
+ import { z } from "zod";
12
+ import type { Binder } from "../core/binder";
13
+ import {
14
+ BaseCollectionEntitySchema,
15
+ createCollectionBindings,
16
+ } from "./collections";
17
+
18
+ /**
19
+ * Assistant entity schema for AI assistants
20
+ * Extends BaseCollectionEntitySchema with assistant-specific fields
21
+ * Base schema already includes: id, title, created_at, updated_at, created_by, updated_by
22
+ */
23
+ export const AssistantSchema = BaseCollectionEntitySchema.extend({
24
+ /**
25
+ * Assistant avatar.
26
+ * Can be a regular URL or a data URI.
27
+ */
28
+ avatar: z.string().describe("URL or data URI to the assistant's avatar image"),
29
+
30
+ /**
31
+ * System prompt that defines the assistant's behavior.
32
+ */
33
+ system_prompt: z
34
+ .string()
35
+ .describe("System prompt that defines the assistant's behavior"),
36
+
37
+ /**
38
+ * Selected gateway for this assistant (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 assistant"),
42
+
43
+ /**
44
+ * Selected model for this assistant (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
51
+ .string()
52
+ .describe("Connection ID that provides the model"),
53
+ })
54
+ .describe("Selected model reference for this assistant"),
55
+ });
56
+
57
+ /**
58
+ * ASSISTANT Collection Binding
59
+ *
60
+ * Collection bindings for assistants (read-only).
61
+ * Provides LIST and GET operations for AI assistants.
62
+ */
63
+ export const ASSISTANTS_COLLECTION_BINDING = createCollectionBindings(
64
+ "assistant",
65
+ AssistantSchema,
66
+ );
67
+
68
+ /**
69
+ * ASSISTANTS Binding
70
+ *
71
+ * Defines the interface for AI assistant providers.
72
+ * Any MCP that implements this binding can provide configurable AI assistants.
73
+ *
74
+ * Required tools:
75
+ * - COLLECTION_ASSISTANT_LIST: List available AI assistants with their configurations
76
+ * - COLLECTION_ASSISTANT_GET: Get a single assistant by ID (includes system_prompt, gateway_id, model)
77
+ */
78
+ export const ASSISTANTS_BINDING = [
79
+ ...ASSISTANTS_COLLECTION_BINDING,
80
+ ] as const satisfies Binder;
81
+
@@ -1,60 +0,0 @@
1
- /**
2
- * Agents Well-Known Binding
3
- *
4
- * Defines the interface for AI agent providers.
5
- * Any MCP that implements this binding can provide configurable AI agents
6
- * with custom instructions and tool access controls.
7
- *
8
- * This binding uses collection bindings for LIST and GET operations (read-only).
9
- */
10
-
11
- import { z } from "zod";
12
- import type { Binder } from "../core/binder";
13
- import {
14
- BaseCollectionEntitySchema,
15
- createCollectionBindings,
16
- } from "./collections";
17
-
18
- /**
19
- * Agent entity schema for AI agents
20
- * Extends BaseCollectionEntitySchema with agent-specific fields
21
- * Base schema already includes: id, title, created_at, updated_at, created_by, updated_by
22
- */
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
27
- .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
- });
36
-
37
- /**
38
- * AGENT Collection Binding
39
- *
40
- * Collection bindings for agents (read-only).
41
- * Provides LIST and GET operations for AI agents.
42
- */
43
- export const AGENTS_COLLECTION_BINDING = createCollectionBindings(
44
- "agent",
45
- AgentSchema,
46
- );
47
-
48
- /**
49
- * AGENTS Binding
50
- *
51
- * Defines the interface for AI agent providers.
52
- * Any MCP that implements this binding can provide configurable AI agents.
53
- *
54
- * Required tools:
55
- * - 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)
57
- */
58
- export const AGENTS_BINDING = [
59
- ...AGENTS_COLLECTION_BINDING,
60
- ] as const satisfies Binder;