@breign/db-schemas 0.1.91 → 0.1.92
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/tool.d.ts +60 -0
- package/package.json +1 -1
- package/src/types/tool.ts +56 -0
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
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
|
+
};
|