@breign/db-schemas 0.1.72 → 0.1.74

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.
@@ -47,6 +47,8 @@ export type Agent = {
47
47
  sandboxConfiguration?: AgentSandboxConfiguration;
48
48
  computerUseConfiguration?: AgentComputerUseConfiguration;
49
49
  agentCallConfiguration?: AgentCallConfiguration;
50
+ mcpExposureConfiguration?: AgentMcpExposureConfiguration;
51
+ humanEscalationConfiguration?: AgentHumanEscalationConfiguration;
50
52
  codeModeConfiguration?: AgentCodeModeConfiguration;
51
53
  speechToText?: SpeechToTextConfig;
52
54
  };
@@ -70,6 +72,24 @@ export type AgentCallConfiguration = {
70
72
  enabled?: boolean;
71
73
  allowedAgentIds?: string[];
72
74
  };
75
+ /**
76
+ * Reachability from local agents (Claude Code, Pi, Hermes…) through Breign's MCP server.
77
+ * Opt-in: an agent nobody exposed stays invisible to `list_agents` and refuses `ask_agent`.
78
+ */
79
+ export type AgentMcpExposureConfiguration = {
80
+ enabled?: boolean;
81
+ };
82
+ /**
83
+ * Human_ask tool, offered only in task conversations (a local agent or another agent asking).
84
+ * The question goes to the first valid referent; without one, to the user who owns the task —
85
+ * the person who connected the local agent.
86
+ */
87
+ export type AgentHumanEscalationConfiguration = {
88
+ enabled?: boolean;
89
+ referentUserIds?: string[];
90
+ /** How long a question stays answerable. Past it, the agent resumes on its own assumption. */
91
+ questionTtlHours?: number;
92
+ };
73
93
  export type AgentCodeModeConfiguration = {
74
94
  enabled?: boolean;
75
95
  };
@@ -85,6 +85,33 @@ export type ConversationMessageApproval = {
85
85
  /** Quand la décision a été prise, ISO. */
86
86
  at: string;
87
87
  };
88
+ /**
89
+ * Une question qu'un agent pose à un humain depuis une conversation de tâche (outil `Human_ask`).
90
+ *
91
+ * Portée par un message-miroir déposé dans la conversation `chat` de l'humain avec cet agent : c'est
92
+ * là qu'il la voit et y répond. La tâche, elle, reste suspendue sur l'appel différé `callId` ; la
93
+ * réponse termine cet appel et relance le tour de la tâche.
94
+ */
95
+ export type ConversationHumanRequest = {
96
+ /** L'appel différé (`PendingToolCall.id`, outil `Human_ask`) que la réponse termine. */
97
+ callId: string;
98
+ taskConversationId: string;
99
+ taskMessageId: string;
100
+ question: string;
101
+ options?: string[];
102
+ /** Ce qui bloque et pourquoi, tel que formulé par l'agent. */
103
+ context?: string;
104
+ requestedBy: {
105
+ kind: 'local_agent' | 'agent';
106
+ label?: string;
107
+ };
108
+ status: 'pending' | 'answered' | 'declined' | 'expired';
109
+ answer?: string;
110
+ /** Nom ou e-mail de la personne qui a répondu, figé à cet instant. */
111
+ answeredBy?: string;
112
+ answeredAt?: string;
113
+ expiresAt?: string;
114
+ };
88
115
  export type ConversationMessage = {
89
116
  id: string;
90
117
  role: ChatMessageRoleUio;
@@ -104,6 +131,8 @@ export type ConversationMessage = {
104
131
  }[];
105
132
  /** Décisions d'autorisation prises pendant ce message. Voir ConversationMessageApproval. */
106
133
  approvals?: ConversationMessageApproval[];
134
+ /** Question posée à l'humain par une tâche. Voir ConversationHumanRequest. */
135
+ humanRequest?: ConversationHumanRequest;
107
136
  suggestions?: {
108
137
  id: string;
109
138
  text: string;
@@ -144,6 +173,16 @@ export type ConversationContext = {
144
173
  };
145
174
  custom?: Record<string, string>;
146
175
  lastActivityAt?: string;
176
+ /** Tâche ouverte par un agent local via le serveur MCP de Breign. */
177
+ externalCaller?: ConversationExternalCaller;
178
+ };
179
+ export type ConversationExternalCaller = {
180
+ kind: 'local_agent';
181
+ /** Le propriétaire du token : seul lui peut relancer ou lire cette tâche via MCP. */
182
+ userId: string;
183
+ /** Nom annoncé par le client MCP (ex. « claude-code »). */
184
+ clientName?: string;
185
+ openedAt: string;
147
186
  };
148
187
  export type Conversation = {
149
188
  id: string;
@@ -8,9 +8,16 @@ import type { ConversationAttachment } from './conversation';
8
8
  export type ToolAction = {
9
9
  code: string;
10
10
  } & Record<string, unknown>;
11
+ export type ImageRef = {
12
+ source: 'kb' | 'conversation';
13
+ fileId: string;
14
+ imageId: string;
15
+ alt: string;
16
+ };
11
17
  export type ToolResult = {
12
18
  text: string;
13
19
  attachments?: ConversationAttachment[];
20
+ imageRefs?: ImageRef[];
14
21
  askConfirmation?: boolean;
15
22
  confirmationLink?: string;
16
23
  actions?: ToolAction[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/db-schemas",
3
- "version": "0.1.72",
3
+ "version": "0.1.74",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "typescript": "^5.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@breign/client": "1.0.156",
17
+ "@breign/client": "1.0.158",
18
18
  "prettier": "^3.5.3",
19
19
  "zx": "^8.5.5"
20
20
  }
@@ -40,6 +40,8 @@ export type Agent = {
40
40
  sandboxConfiguration?: AgentSandboxConfiguration;
41
41
  computerUseConfiguration?: AgentComputerUseConfiguration;
42
42
  agentCallConfiguration?: AgentCallConfiguration;
43
+ mcpExposureConfiguration?: AgentMcpExposureConfiguration;
44
+ humanEscalationConfiguration?: AgentHumanEscalationConfiguration;
43
45
  codeModeConfiguration?: AgentCodeModeConfiguration;
44
46
  speechToText?: SpeechToTextConfig;
45
47
  };
@@ -67,6 +69,27 @@ export type AgentCallConfiguration = {
67
69
  enabled?: boolean;
68
70
  allowedAgentIds?: string[];
69
71
  };
72
+
73
+ /**
74
+ * Reachability from local agents (Claude Code, Pi, Hermes…) through Breign's MCP server.
75
+ * Opt-in: an agent nobody exposed stays invisible to `list_agents` and refuses `ask_agent`.
76
+ */
77
+ export type AgentMcpExposureConfiguration = {
78
+ enabled?: boolean;
79
+ };
80
+
81
+ /**
82
+ * Human_ask tool, offered only in task conversations (a local agent or another agent asking).
83
+ * The question goes to the first valid referent; without one, to the user who owns the task —
84
+ * the person who connected the local agent.
85
+ */
86
+ export type AgentHumanEscalationConfiguration = {
87
+ enabled?: boolean;
88
+ referentUserIds?: string[];
89
+ /** How long a question stays answerable. Past it, the agent resumes on its own assumption. */
90
+ questionTtlHours?: number;
91
+ };
92
+
70
93
  export type AgentCodeModeConfiguration = {
71
94
  enabled?: boolean;
72
95
  };
@@ -95,6 +95,31 @@ export type ConversationMessageApproval = {
95
95
  at: string;
96
96
  };
97
97
 
98
+ /**
99
+ * Une question qu'un agent pose à un humain depuis une conversation de tâche (outil `Human_ask`).
100
+ *
101
+ * Portée par un message-miroir déposé dans la conversation `chat` de l'humain avec cet agent : c'est
102
+ * là qu'il la voit et y répond. La tâche, elle, reste suspendue sur l'appel différé `callId` ; la
103
+ * réponse termine cet appel et relance le tour de la tâche.
104
+ */
105
+ export type ConversationHumanRequest = {
106
+ /** L'appel différé (`PendingToolCall.id`, outil `Human_ask`) que la réponse termine. */
107
+ callId: string;
108
+ taskConversationId: string;
109
+ taskMessageId: string;
110
+ question: string;
111
+ options?: string[];
112
+ /** Ce qui bloque et pourquoi, tel que formulé par l'agent. */
113
+ context?: string;
114
+ requestedBy: { kind: 'local_agent' | 'agent'; label?: string };
115
+ status: 'pending' | 'answered' | 'declined' | 'expired';
116
+ answer?: string;
117
+ /** Nom ou e-mail de la personne qui a répondu, figé à cet instant. */
118
+ answeredBy?: string;
119
+ answeredAt?: string;
120
+ expiresAt?: string;
121
+ };
122
+
98
123
  export type ConversationMessage = {
99
124
  id: string;
100
125
  role: ChatMessageRoleUio;
@@ -109,6 +134,8 @@ export type ConversationMessage = {
109
134
  }[];
110
135
  /** Décisions d'autorisation prises pendant ce message. Voir ConversationMessageApproval. */
111
136
  approvals?: ConversationMessageApproval[];
137
+ /** Question posée à l'humain par une tâche. Voir ConversationHumanRequest. */
138
+ humanRequest?: ConversationHumanRequest;
112
139
  suggestions?: {
113
140
  id: string;
114
141
  text: string;
@@ -147,6 +174,17 @@ export type ConversationContext = {
147
174
  };
148
175
  custom?: Record<string, string>;
149
176
  lastActivityAt?: string;
177
+ /** Tâche ouverte par un agent local via le serveur MCP de Breign. */
178
+ externalCaller?: ConversationExternalCaller;
179
+ };
180
+
181
+ export type ConversationExternalCaller = {
182
+ kind: 'local_agent';
183
+ /** Le propriétaire du token : seul lui peut relancer ou lire cette tâche via MCP. */
184
+ userId: string;
185
+ /** Nom annoncé par le client MCP (ex. « claude-code »). */
186
+ clientName?: string;
187
+ openedAt: string;
150
188
  };
151
189
 
152
190
  export type Conversation = {
@@ -10,9 +10,17 @@ export type ToolAction = {
10
10
  code: string;
11
11
  } & Record<string, unknown>;
12
12
 
13
+ export type ImageRef = {
14
+ source: 'kb' | 'conversation';
15
+ fileId: string;
16
+ imageId: string;
17
+ alt: string;
18
+ };
19
+
13
20
  export type ToolResult = {
14
21
  text: string;
15
22
  attachments?: ConversationAttachment[];
23
+ imageRefs?: ImageRef[];
16
24
  askConfirmation?: boolean;
17
25
  confirmationLink?: string;
18
26
  actions?: ToolAction[];