@breign/db-schemas 0.1.91 → 0.1.93
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/dist/types/agent-memory.d.ts +7 -3
- package/dist/types/agent.d.ts +3 -0
- package/dist/types/tool.d.ts +60 -0
- package/package.json +1 -1
- package/src/types/agent-memory.ts +7 -3
- package/src/types/agent.ts +3 -0
- package/src/types/tool.ts +56 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Long-term agent memory — one row per virtual file under /memories
|
|
2
|
+
* Long-term agent memory — one row per virtual file under /memories/ (this agent) or
|
|
3
|
+
* /shared/ (shared by all the user's agents in the organisation).
|
|
3
4
|
*
|
|
4
5
|
* Shared between brain-api (storage adapters + tool) and any other consumer.
|
|
5
6
|
* The path is a virtual filesystem key (e.g. '/memories/core.md'); identity
|
|
@@ -14,8 +15,11 @@ export type AgentMemory = {
|
|
|
14
15
|
* mapped inside the PG adapter (cf. agents-pg.adapter.ts).
|
|
15
16
|
*/
|
|
16
17
|
organisationId: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* agentId (not brainId) — consistent with Chat.agentId and the rest of the code.
|
|
20
|
+
* null: the user's memory shared by every agent of the organisation.
|
|
21
|
+
*/
|
|
22
|
+
agentId: string | null;
|
|
19
23
|
userId: string;
|
|
20
24
|
/** e.g. '/memories/core.md' — namespace validated tool-side, never by the model alone. */
|
|
21
25
|
path: string;
|
package/dist/types/agent.d.ts
CHANGED
|
@@ -57,8 +57,11 @@ export type AgentToolPermissions = {
|
|
|
57
57
|
allowedMethods?: string[];
|
|
58
58
|
};
|
|
59
59
|
export type AgentMemoryConfiguration = {
|
|
60
|
+
/** The user's memory shared by all their agents in the organisation (/shared/). */
|
|
60
61
|
userMemoryEnabled?: boolean;
|
|
62
|
+
/** The user's memory within this agent only (/memories/). */
|
|
61
63
|
agentMemoryEnabled?: boolean;
|
|
64
|
+
/** Not implemented yet: has no effect. */
|
|
62
65
|
organizationMemoryEnabled?: boolean;
|
|
63
66
|
};
|
|
64
67
|
export type AgentComputerUseConfiguration = {
|
package/dist/types/tool.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export type Tool = {
|
|
|
41
41
|
*/
|
|
42
42
|
approvalModes?: Record<string, McpToolApprovalMode>;
|
|
43
43
|
};
|
|
44
|
+
/** Outil généré depuis une définition OpenAPI (`type: 'openapi'`) : une action par route + verbe. */
|
|
45
|
+
openapi?: ToolOpenApi;
|
|
44
46
|
manifest?: Record<string, unknown>;
|
|
45
47
|
/**
|
|
46
48
|
* Indicates whether the tool has been set up (e.g., OAuth2 flow completed) or not.
|
|
@@ -74,3 +76,61 @@ export type Tool = {
|
|
|
74
76
|
* planifiée, widget…). `never` : ne jamais demander.
|
|
75
77
|
*/
|
|
76
78
|
export type McpToolApprovalMode = 'always' | 'never';
|
|
79
|
+
export type OpenApiHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
80
|
+
/** Où part chaque entrée d'une action quand elle est appelée. */
|
|
81
|
+
export type OpenApiParameterLocation = 'path' | 'query' | 'header' | 'body';
|
|
82
|
+
/** Une action d'un outil OpenAPI : une route + un verbe HTTP de la définition. */
|
|
83
|
+
export type OpenApiOperation = {
|
|
84
|
+
/** Nom de l'action vu par le modèle : l'`operationId`, ramené à `^[a-zA-Z0-9_-]{1,64}$`. */
|
|
85
|
+
name: string;
|
|
86
|
+
/** L'`operationId` tel qu'écrit dans la définition, s'il y en a un. */
|
|
87
|
+
operationId?: string;
|
|
88
|
+
method: OpenApiHttpMethod;
|
|
89
|
+
/** Chemin de la définition, avec ses paramètres : `/issues/{issue_ref}`. */
|
|
90
|
+
path: string;
|
|
91
|
+
description: string;
|
|
92
|
+
/** Un seul objet JSON Schema : paramètres de chemin, de requête, d'en-tête, et `body`. */
|
|
93
|
+
inputSchema: Record<string, unknown>;
|
|
94
|
+
/** Pour chaque propriété de `inputSchema`, où elle part dans la requête. */
|
|
95
|
+
bindings: Record<string, OpenApiParameterLocation>;
|
|
96
|
+
/**
|
|
97
|
+
* Nom du paramètre dans la requête quand il diffère de la propriété de `inputSchema` (nom
|
|
98
|
+
* invalide pour les modèles, ou même nom à deux endroits).
|
|
99
|
+
*/
|
|
100
|
+
aliases?: Record<string, string>;
|
|
101
|
+
/** Réponse 2xx `application/json`, quand la définition la décrit. */
|
|
102
|
+
outputSchema?: Record<string, unknown>;
|
|
103
|
+
/** GET, HEAD et OPTIONS : l'action ne modifie rien, elle part sans approbation par défaut. */
|
|
104
|
+
readOnly: boolean;
|
|
105
|
+
};
|
|
106
|
+
/** Ce que la définition dit de l'OAuth 2 (`securitySchemes`, flux `authorizationCode`). */
|
|
107
|
+
export type OpenApiOAuth2Flow = {
|
|
108
|
+
authorizationUrl: string;
|
|
109
|
+
tokenUrl: string;
|
|
110
|
+
refreshUrl?: string;
|
|
111
|
+
scopes: string[];
|
|
112
|
+
};
|
|
113
|
+
export type ToolOpenApi = {
|
|
114
|
+
source: {
|
|
115
|
+
kind: 'url';
|
|
116
|
+
url: string;
|
|
117
|
+
} | {
|
|
118
|
+
kind: 'inline';
|
|
119
|
+
};
|
|
120
|
+
info: {
|
|
121
|
+
title: string;
|
|
122
|
+
version: string;
|
|
123
|
+
openapiVersion: string;
|
|
124
|
+
};
|
|
125
|
+
/** URL de base proposées par la définition (`servers`). */
|
|
126
|
+
servers: string[];
|
|
127
|
+
importedAt: string;
|
|
128
|
+
/** sha256 du texte importé. */
|
|
129
|
+
specHash: string;
|
|
130
|
+
operations: OpenApiOperation[];
|
|
131
|
+
oauth2?: OpenApiOAuth2Flow;
|
|
132
|
+
/** Actions que l'organisation autorise, comme `mcp.allowedTools`. */
|
|
133
|
+
allowedTools?: string[];
|
|
134
|
+
/** Comme `mcp.approvalModes`. Absent : lecture sans question, écriture « demander ». */
|
|
135
|
+
approvalModes?: Record<string, McpToolApprovalMode>;
|
|
136
|
+
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Long-term agent memory — one row per virtual file under /memories
|
|
2
|
+
* Long-term agent memory — one row per virtual file under /memories/ (this agent) or
|
|
3
|
+
* /shared/ (shared by all the user's agents in the organisation).
|
|
3
4
|
*
|
|
4
5
|
* Shared between brain-api (storage adapters + tool) and any other consumer.
|
|
5
6
|
* The path is a virtual filesystem key (e.g. '/memories/core.md'); identity
|
|
@@ -14,8 +15,11 @@ export type AgentMemory = {
|
|
|
14
15
|
* mapped inside the PG adapter (cf. agents-pg.adapter.ts).
|
|
15
16
|
*/
|
|
16
17
|
organisationId: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* agentId (not brainId) — consistent with Chat.agentId and the rest of the code.
|
|
20
|
+
* null: the user's memory shared by every agent of the organisation.
|
|
21
|
+
*/
|
|
22
|
+
agentId: string | null;
|
|
19
23
|
userId: string;
|
|
20
24
|
/** e.g. '/memories/core.md' — namespace validated tool-side, never by the model alone. */
|
|
21
25
|
path: string;
|
package/src/types/agent.ts
CHANGED
|
@@ -51,8 +51,11 @@ export type AgentToolPermissions = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export type AgentMemoryConfiguration = {
|
|
54
|
+
/** The user's memory shared by all their agents in the organisation (/shared/). */
|
|
54
55
|
userMemoryEnabled?: boolean;
|
|
56
|
+
/** The user's memory within this agent only (/memories/). */
|
|
55
57
|
agentMemoryEnabled?: boolean;
|
|
58
|
+
/** Not implemented yet: has no effect. */
|
|
56
59
|
organizationMemoryEnabled?: boolean;
|
|
57
60
|
};
|
|
58
61
|
|
package/src/types/tool.ts
CHANGED
|
@@ -42,6 +42,8 @@ export type Tool = {
|
|
|
42
42
|
*/
|
|
43
43
|
approvalModes?: Record<string, McpToolApprovalMode>;
|
|
44
44
|
};
|
|
45
|
+
/** Outil généré depuis une définition OpenAPI (`type: 'openapi'`) : une action par route + verbe. */
|
|
46
|
+
openapi?: ToolOpenApi;
|
|
45
47
|
manifest?: Record<string, unknown>;
|
|
46
48
|
/**
|
|
47
49
|
* Indicates whether the tool has been set up (e.g., OAuth2 flow completed) or not.
|
|
@@ -76,3 +78,57 @@ export type Tool = {
|
|
|
76
78
|
* planifiée, widget…). `never` : ne jamais demander.
|
|
77
79
|
*/
|
|
78
80
|
export type McpToolApprovalMode = 'always' | 'never';
|
|
81
|
+
|
|
82
|
+
export type OpenApiHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
83
|
+
|
|
84
|
+
/** Où part chaque entrée d'une action quand elle est appelée. */
|
|
85
|
+
export type OpenApiParameterLocation = 'path' | 'query' | 'header' | 'body';
|
|
86
|
+
|
|
87
|
+
/** Une action d'un outil OpenAPI : une route + un verbe HTTP de la définition. */
|
|
88
|
+
export type OpenApiOperation = {
|
|
89
|
+
/** Nom de l'action vu par le modèle : l'`operationId`, ramené à `^[a-zA-Z0-9_-]{1,64}$`. */
|
|
90
|
+
name: string;
|
|
91
|
+
/** L'`operationId` tel qu'écrit dans la définition, s'il y en a un. */
|
|
92
|
+
operationId?: string;
|
|
93
|
+
method: OpenApiHttpMethod;
|
|
94
|
+
/** Chemin de la définition, avec ses paramètres : `/issues/{issue_ref}`. */
|
|
95
|
+
path: string;
|
|
96
|
+
description: string;
|
|
97
|
+
/** Un seul objet JSON Schema : paramètres de chemin, de requête, d'en-tête, et `body`. */
|
|
98
|
+
inputSchema: Record<string, unknown>;
|
|
99
|
+
/** Pour chaque propriété de `inputSchema`, où elle part dans la requête. */
|
|
100
|
+
bindings: Record<string, OpenApiParameterLocation>;
|
|
101
|
+
/**
|
|
102
|
+
* Nom du paramètre dans la requête quand il diffère de la propriété de `inputSchema` (nom
|
|
103
|
+
* invalide pour les modèles, ou même nom à deux endroits).
|
|
104
|
+
*/
|
|
105
|
+
aliases?: Record<string, string>;
|
|
106
|
+
/** Réponse 2xx `application/json`, quand la définition la décrit. */
|
|
107
|
+
outputSchema?: Record<string, unknown>;
|
|
108
|
+
/** GET, HEAD et OPTIONS : l'action ne modifie rien, elle part sans approbation par défaut. */
|
|
109
|
+
readOnly: boolean;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** Ce que la définition dit de l'OAuth 2 (`securitySchemes`, flux `authorizationCode`). */
|
|
113
|
+
export type OpenApiOAuth2Flow = {
|
|
114
|
+
authorizationUrl: string;
|
|
115
|
+
tokenUrl: string;
|
|
116
|
+
refreshUrl?: string;
|
|
117
|
+
scopes: string[];
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type ToolOpenApi = {
|
|
121
|
+
source: { kind: 'url'; url: string } | { kind: 'inline' };
|
|
122
|
+
info: { title: string; version: string; openapiVersion: string };
|
|
123
|
+
/** URL de base proposées par la définition (`servers`). */
|
|
124
|
+
servers: string[];
|
|
125
|
+
importedAt: string;
|
|
126
|
+
/** sha256 du texte importé. */
|
|
127
|
+
specHash: string;
|
|
128
|
+
operations: OpenApiOperation[];
|
|
129
|
+
oauth2?: OpenApiOAuth2Flow;
|
|
130
|
+
/** Actions que l'organisation autorise, comme `mcp.allowedTools`. */
|
|
131
|
+
allowedTools?: string[];
|
|
132
|
+
/** Comme `mcp.approvalModes`. Absent : lecture sans question, écriture « demander ». */
|
|
133
|
+
approvalModes?: Record<string, McpToolApprovalMode>;
|
|
134
|
+
};
|