@stratta/mcp 0.5.0 → 0.7.1

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.
@@ -1,243 +1,140 @@
1
- import type { ConvexHttpClient } from 'convex/browser';
2
- export declare const ingestTools: readonly [{
3
- readonly name: "ingest_status";
4
- readonly description: "Check whether a norm (by code) already exists in YOUR workspace and how many sections it has. Call before creating to avoid duplicates.";
5
- readonly inputSchema: {
6
- readonly type: "object";
7
- readonly properties: {
8
- readonly code: {
9
- readonly type: "string";
10
- readonly description: "Norm code, e.g. \"SIA 261\".";
11
- };
12
- };
13
- readonly required: readonly ["code"];
14
- readonly additionalProperties: false;
15
- };
16
- }, {
17
- readonly name: "ingest_create_document";
18
- readonly description: "Create a draft norm document in YOUR workspace. Returns the documentId used by subsequent ingest_* calls. You must hold a valid licence for the norm you ingest.";
19
- readonly inputSchema: {
20
- readonly type: "object";
21
- readonly properties: {
22
- readonly code: {
23
- readonly type: "string";
24
- };
25
- readonly year: {
26
- readonly type: "number";
27
- };
28
- readonly title: {
29
- readonly type: "string";
30
- };
31
- readonly language: {
32
- readonly type: "string";
33
- readonly enum: readonly ["fr", "de", "it", "en"];
34
- };
35
- readonly totalPages: {
36
- readonly type: "number";
37
- };
38
- };
39
- readonly required: readonly ["code", "year", "title", "language", "totalPages"];
40
- readonly additionalProperties: false;
41
- };
42
- }, {
43
- readonly name: "ingest_create_sections";
44
- readonly description: "Bulk-insert sections into a draft document. Parent links resolve via parentNodeId within the batch + already-inserted sections. Returns a map of nodeId → sectionId (use those ids to attach formulas/tables/figures/cross-refs).";
45
- readonly inputSchema: {
46
- readonly type: "object";
47
- readonly properties: {
48
- readonly documentId: {
49
- readonly type: "string";
50
- };
51
- readonly sections: {
52
- readonly type: "array";
53
- readonly items: {
54
- readonly type: "object";
55
- readonly properties: {
56
- readonly nodeId: {
57
- readonly type: "string";
58
- readonly description: "Stable unique id within the doc (e.g. \"s-4-2-1\").";
59
- };
60
- readonly parentNodeId: {
61
- readonly type: "string";
62
- readonly description: "nodeId of the parent section, omit for roots.";
63
- };
64
- readonly path: {
65
- readonly type: "string";
66
- readonly description: "Human path, e.g. \"4.2.1\" or \"Annexe B.1\".";
67
- };
68
- readonly title: {
69
- readonly type: "string";
70
- };
71
- readonly summary: {
72
- readonly type: "string";
73
- readonly description: "1-3 sentence summary used for tree navigation.";
74
- };
75
- readonly depth: {
76
- readonly type: "number";
77
- readonly description: "0 = chapter, 1 = section, etc.";
78
- };
79
- readonly content: {
80
- readonly type: "string";
81
- readonly description: "Full enriched text (LaTeX formulas inline ok).";
82
- };
83
- readonly rawContent: {
84
- readonly type: "string";
85
- readonly description: "Raw extracted text.";
86
- };
87
- readonly pageStart: {
88
- readonly type: "number";
89
- };
90
- readonly pageEnd: {
91
- readonly type: "number";
92
- };
93
- readonly orderIndex: {
94
- readonly type: "number";
95
- };
96
- };
97
- readonly required: readonly ["nodeId", "path", "title", "summary", "depth", "content", "rawContent", "pageStart", "pageEnd", "orderIndex"];
98
- readonly additionalProperties: false;
99
- };
100
- };
101
- };
102
- readonly required: readonly ["documentId", "sections"];
103
- readonly additionalProperties: false;
104
- };
105
- }, {
106
- readonly name: "ingest_attach_formula";
107
- readonly description: "Attach a LaTeX formula to a section.";
108
- readonly inputSchema: {
109
- readonly type: "object";
110
- readonly properties: {
111
- readonly sectionId: {
112
- readonly type: "string";
113
- };
114
- readonly latex: {
115
- readonly type: "string";
116
- };
117
- readonly description: {
118
- readonly type: "string";
119
- };
120
- readonly formulaNumber: {
121
- readonly type: "string";
122
- };
123
- };
124
- readonly required: readonly ["sectionId", "latex", "description", "formulaNumber"];
125
- readonly additionalProperties: false;
126
- };
127
- }, {
128
- readonly name: "ingest_attach_table";
129
- readonly description: "Attach a structured table to a section. `data` should be { headers: string[], rows: string[][] }.";
130
- readonly inputSchema: {
131
- readonly type: "object";
132
- readonly properties: {
133
- readonly sectionId: {
134
- readonly type: "string";
135
- };
136
- readonly data: {
137
- readonly type: "object";
138
- };
139
- readonly caption: {
140
- readonly type: "string";
141
- };
142
- readonly tableNumber: {
143
- readonly type: "string";
144
- };
145
- };
146
- readonly required: readonly ["sectionId", "data", "caption", "tableNumber"];
147
- readonly additionalProperties: false;
148
- };
149
- }, {
150
- readonly name: "ingest_attach_cross_ref";
151
- readonly description: "Attach a cross-reference from a section to another norm/section.";
152
- readonly inputSchema: {
153
- readonly type: "object";
154
- readonly properties: {
155
- readonly sourceSectionId: {
156
- readonly type: "string";
157
- };
158
- readonly targetDocumentCode: {
159
- readonly type: "string";
160
- };
161
- readonly targetSectionPath: {
162
- readonly type: "string";
163
- };
164
- readonly refText: {
165
- readonly type: "string";
166
- };
167
- readonly refType: {
168
- readonly type: "string";
169
- readonly enum: readonly ["explicit", "implicit"];
170
- };
171
- };
172
- readonly required: readonly ["sourceSectionId", "targetDocumentCode", "refText", "refType"];
173
- readonly additionalProperties: false;
174
- };
175
- }, {
176
- readonly name: "ingest_upload_figure";
177
- readonly description: "Upload a figure image (base64) and attach it to a section. mimeType must be image/png, image/jpeg or image/webp; max 8 MB.";
178
- readonly inputSchema: {
179
- readonly type: "object";
180
- readonly properties: {
181
- readonly sectionId: {
182
- readonly type: "string";
183
- };
184
- readonly base64: {
185
- readonly type: "string";
186
- readonly description: "Base64-encoded image bytes (data: prefix tolerated).";
187
- };
188
- readonly mimeType: {
189
- readonly type: "string";
190
- readonly enum: readonly ["image/png", "image/jpeg", "image/webp"];
191
- };
192
- readonly caption: {
193
- readonly type: "string";
194
- };
195
- readonly figureNumber: {
196
- readonly type: "string";
197
- };
198
- };
199
- readonly required: readonly ["sectionId", "base64", "mimeType", "caption", "figureNumber"];
200
- readonly additionalProperties: false;
201
- };
202
- }, {
203
- readonly name: "ingest_normalize_cross_refs";
204
- readonly description: "Scan all sections of a document and (re)build cross-references to other norms detected in the text. Idempotent.";
205
- readonly inputSchema: {
206
- readonly type: "object";
207
- readonly properties: {
208
- readonly documentId: {
209
- readonly type: "string";
210
- };
211
- };
212
- readonly required: readonly ["documentId"];
213
- readonly additionalProperties: false;
214
- };
215
- }, {
216
- readonly name: "ingest_publish";
217
- readonly description: "Publish a draft document so it becomes queryable via the read tools in YOUR workspace.";
218
- readonly inputSchema: {
219
- readonly type: "object";
220
- readonly properties: {
221
- readonly documentId: {
222
- readonly type: "string";
223
- };
224
- };
225
- readonly required: readonly ["documentId"];
226
- readonly additionalProperties: false;
227
- };
228
- }, {
229
- readonly name: "ingest_delete";
230
- readonly description: "Delete a document and all its sections/figures/tables/formulas/cross-refs. Use before re-ingesting.";
231
- readonly inputSchema: {
232
- readonly type: "object";
233
- readonly properties: {
234
- readonly documentId: {
235
- readonly type: "string";
236
- };
237
- };
238
- readonly required: readonly ["documentId"];
239
- readonly additionalProperties: false;
240
- };
241
- }];
242
- export declare function isIngestTool(name: string): boolean;
243
- export declare function handleIngestTool(client: ConvexHttpClient, name: string, args: Record<string, unknown>): Promise<unknown>;
1
+ import { z } from 'zod';
2
+ export declare const ingestStatus: import("./define.js").ToolDef<{
3
+ code: z.ZodString;
4
+ }>;
5
+ export declare const ingestCreateDocument: import("./define.js").ToolDef<{
6
+ code: z.ZodString;
7
+ year: z.ZodNumber;
8
+ title: z.ZodString;
9
+ language: z.ZodEnum<{
10
+ fr: "fr";
11
+ de: "de";
12
+ it: "it";
13
+ en: "en";
14
+ }>;
15
+ totalPages: z.ZodNumber;
16
+ }>;
17
+ export declare const ingestCreateSections: import("./define.js").ToolDef<{
18
+ documentId: z.ZodString;
19
+ sections: z.ZodArray<z.ZodObject<{
20
+ nodeId: z.ZodString;
21
+ parentNodeId: z.ZodOptional<z.ZodString>;
22
+ path: z.ZodString;
23
+ title: z.ZodString;
24
+ summary: z.ZodString;
25
+ depth: z.ZodNumber;
26
+ content: z.ZodString;
27
+ rawContent: z.ZodString;
28
+ pageStart: z.ZodNumber;
29
+ pageEnd: z.ZodNumber;
30
+ orderIndex: z.ZodNumber;
31
+ }, z.core.$strip>>;
32
+ }>;
33
+ export declare const ingestAttachFormula: import("./define.js").ToolDef<{
34
+ sectionId: z.ZodString;
35
+ latex: z.ZodString;
36
+ description: z.ZodString;
37
+ formulaNumber: z.ZodString;
38
+ }>;
39
+ export declare const ingestAttachTable: import("./define.js").ToolDef<{
40
+ sectionId: z.ZodString;
41
+ data: z.ZodObject<{
42
+ headers: z.ZodArray<z.ZodCoercedString<unknown>>;
43
+ rows: z.ZodArray<z.ZodArray<z.ZodCoercedString<unknown>>>;
44
+ }, z.core.$strip>;
45
+ caption: z.ZodString;
46
+ tableNumber: z.ZodString;
47
+ }>;
48
+ export declare const ingestAttachCrossRef: import("./define.js").ToolDef<{
49
+ sourceSectionId: z.ZodString;
50
+ targetDocumentCode: z.ZodString;
51
+ targetSectionPath: z.ZodOptional<z.ZodString>;
52
+ refText: z.ZodString;
53
+ refType: z.ZodEnum<{
54
+ explicit: "explicit";
55
+ implicit: "implicit";
56
+ }>;
57
+ }>;
58
+ export declare const ingestUploadFigure: import("./define.js").ToolDef<{
59
+ sectionId: z.ZodString;
60
+ base64: z.ZodString;
61
+ mimeType: z.ZodEnum<{
62
+ "image/png": "image/png";
63
+ "image/jpeg": "image/jpeg";
64
+ "image/webp": "image/webp";
65
+ }>;
66
+ caption: z.ZodString;
67
+ figureNumber: z.ZodString;
68
+ }>;
69
+ export declare const ingestNormalizeCrossRefs: import("./define.js").ToolDef<{
70
+ documentId: z.ZodString;
71
+ }>;
72
+ export declare const ingestPublish: import("./define.js").ToolDef<{
73
+ documentId: z.ZodString;
74
+ }>;
75
+ export declare const ingestDelete: import("./define.js").ToolDef<{
76
+ documentId: z.ZodString;
77
+ }>;
78
+ export declare const ingestTools: (import("./define.js").ToolDef<{
79
+ code: z.ZodString;
80
+ }> | import("./define.js").ToolDef<{
81
+ code: z.ZodString;
82
+ year: z.ZodNumber;
83
+ title: z.ZodString;
84
+ language: z.ZodEnum<{
85
+ fr: "fr";
86
+ de: "de";
87
+ it: "it";
88
+ en: "en";
89
+ }>;
90
+ totalPages: z.ZodNumber;
91
+ }> | import("./define.js").ToolDef<{
92
+ documentId: z.ZodString;
93
+ sections: z.ZodArray<z.ZodObject<{
94
+ nodeId: z.ZodString;
95
+ parentNodeId: z.ZodOptional<z.ZodString>;
96
+ path: z.ZodString;
97
+ title: z.ZodString;
98
+ summary: z.ZodString;
99
+ depth: z.ZodNumber;
100
+ content: z.ZodString;
101
+ rawContent: z.ZodString;
102
+ pageStart: z.ZodNumber;
103
+ pageEnd: z.ZodNumber;
104
+ orderIndex: z.ZodNumber;
105
+ }, z.core.$strip>>;
106
+ }> | import("./define.js").ToolDef<{
107
+ sectionId: z.ZodString;
108
+ latex: z.ZodString;
109
+ description: z.ZodString;
110
+ formulaNumber: z.ZodString;
111
+ }> | import("./define.js").ToolDef<{
112
+ sectionId: z.ZodString;
113
+ data: z.ZodObject<{
114
+ headers: z.ZodArray<z.ZodCoercedString<unknown>>;
115
+ rows: z.ZodArray<z.ZodArray<z.ZodCoercedString<unknown>>>;
116
+ }, z.core.$strip>;
117
+ caption: z.ZodString;
118
+ tableNumber: z.ZodString;
119
+ }> | import("./define.js").ToolDef<{
120
+ sourceSectionId: z.ZodString;
121
+ targetDocumentCode: z.ZodString;
122
+ targetSectionPath: z.ZodOptional<z.ZodString>;
123
+ refText: z.ZodString;
124
+ refType: z.ZodEnum<{
125
+ explicit: "explicit";
126
+ implicit: "implicit";
127
+ }>;
128
+ }> | import("./define.js").ToolDef<{
129
+ sectionId: z.ZodString;
130
+ base64: z.ZodString;
131
+ mimeType: z.ZodEnum<{
132
+ "image/png": "image/png";
133
+ "image/jpeg": "image/jpeg";
134
+ "image/webp": "image/webp";
135
+ }>;
136
+ caption: z.ZodString;
137
+ figureNumber: z.ZodString;
138
+ }> | import("./define.js").ToolDef<{
139
+ documentId: z.ZodString;
140
+ }>)[];