@malloy-publisher/server 0.0.232 → 0.0.234
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/README.docker.md +1 -0
- package/dist/app/api-doc.yaml +269 -10
- package/dist/app/assets/{EnvironmentPage-DXEaZIPx.js → EnvironmentPage-DTZQ4Gxc.js} +1 -1
- package/dist/app/assets/{HomePage-kofsqpZt.js → HomePage-C5mlDPXK.js} +1 -1
- package/dist/app/assets/{LightMode-CNhIlIlJ.js → LightMode-DGNmhG0u.js} +1 -1
- package/dist/app/assets/{MainPage-Bgqo8jCy.js → MainPage-CVL_wmP4.js} +1 -1
- package/dist/app/assets/{MaterializationsPage-CgBlgGz2.js → MaterializationsPage-DmzMBCpy.js} +1 -1
- package/dist/app/assets/{ModelPage-B0TjoDtf.js → ModelPage-Dbvf4QbB.js} +1 -1
- package/dist/app/assets/{PackagePage-BL8vnFj1.js → PackagePage-DxdHc2Qs.js} +1 -1
- package/dist/app/assets/{RouteError-BzPby0X2.js → RouteError-OJdT4tCd.js} +1 -1
- package/dist/app/assets/{ThemeEditorPage-CTEP_9r3.js → ThemeEditorPage-Bk7s0KXY.js} +1 -1
- package/dist/app/assets/{WorkbookPage-BwM3BmKw.js → WorkbookPage-j_vCWdN3.js} +1 -1
- package/dist/app/assets/{core-CK68iv6w.es-CpRxXBt7.js → core-Rj_4rRnA.es-DoIfLxDJ.js} +1 -1
- package/dist/app/assets/{index-B33zGctF.js → index-B_jKMR35.js} +4 -4
- package/dist/app/assets/{index-CmkW1MiE.js → index-D-rDyK11.js} +1 -1
- package/dist/app/assets/{index-tXJXwdyj.js → index-DWIe_hK0.js} +1 -1
- package/dist/app/assets/{index-BkiWKaAF.js → index-hw-xn0X7.js} +1 -1
- package/dist/app/index.html +1 -1
- package/dist/package_load_worker.mjs +53 -3
- package/dist/server.mjs +20277 -925
- package/package.json +1 -1
- package/src/config.ts +35 -1
- package/src/controller/connection.controller.spec.ts +46 -0
- package/src/controller/connection.controller.ts +105 -2
- package/src/controller/materialization.controller.spec.ts +25 -0
- package/src/controller/materialization.controller.ts +60 -0
- package/src/controller/model.controller.ts +24 -0
- package/src/controller/query.controller.ts +83 -10
- package/src/json_utils.spec.ts +51 -0
- package/src/json_utils.ts +33 -0
- package/src/mcp/handler_utils.ts +10 -2
- package/src/mcp/query_envelope.spec.ts +229 -0
- package/src/mcp/query_envelope.ts +240 -0
- package/src/mcp/server.protocol.spec.ts +128 -16
- package/src/mcp/skills/build_skills_bundle.ts +94 -4
- package/src/mcp/skills/skills_bundle.json +1 -1
- package/src/mcp/skills/skills_bundle.spec.ts +113 -4
- package/src/mcp/tool_response.spec.ts +108 -0
- package/src/mcp/tool_response.ts +138 -0
- package/src/mcp/tools/compile_tool.spec.ts +112 -4
- package/src/mcp/tools/compile_tool.ts +61 -30
- package/src/mcp/tools/docs_search_tool.ts +6 -16
- package/src/mcp/tools/execute_query_tool.spec.ts +154 -3
- package/src/mcp/tools/execute_query_tool.ts +131 -155
- package/src/mcp/tools/get_context_tool.spec.ts +63 -3
- package/src/mcp/tools/get_context_tool.ts +43 -46
- package/src/mcp/tools/reload_package_tool.ts +3 -29
- package/src/mcp_config.spec.ts +919 -0
- package/src/mcp_config.ts +425 -0
- package/src/oom_guards.integration.spec.ts +11 -3
- package/src/package_load/package_load_pool.ts +2 -0
- package/src/package_load/package_load_worker.ts +17 -5
- package/src/package_load/protocol.ts +6 -0
- package/src/query_metadata_metrics.ts +49 -0
- package/src/server.ts +99 -3
- package/src/service/build_plan.spec.ts +125 -0
- package/src/service/build_plan.ts +108 -7
- package/src/service/compile_fragment_techniques.spec.ts +156 -0
- package/src/service/connection.spec.ts +371 -1
- package/src/service/connection.ts +77 -14
- package/src/service/connection_config.spec.ts +60 -0
- package/src/service/connection_config.ts +75 -0
- package/src/service/duckdb_instance_isolation.spec.ts +137 -0
- package/src/service/environment.ts +57 -3
- package/src/service/materialization_config_validation.spec.ts +99 -0
- package/src/service/materialization_config_validation.ts +120 -0
- package/src/service/materialization_schedule_surface.spec.ts +124 -0
- package/src/service/materialization_service.spec.ts +119 -0
- package/src/service/materialization_service.ts +186 -3
- package/src/service/materialization_test_fixtures.ts +86 -21
- package/src/service/model.spec.ts +45 -1
- package/src/service/model.ts +171 -23
- package/src/service/model_limits.spec.ts +28 -0
- package/src/service/model_limits.ts +21 -0
- package/src/service/package.ts +24 -1
- package/src/service/package_manifest.spec.ts +137 -4
- package/src/service/package_manifest.ts +140 -5
- package/src/service/persist_annotation_validation.spec.ts +12 -0
- package/src/service/persist_annotation_validation.ts +9 -4
- package/src/service/query_metadata.spec.ts +408 -0
- package/src/service/query_metadata.ts +492 -0
- package/src/service/query_metadata_identity.spec.ts +149 -0
- package/tests/integration/mcp/mcp_execute_query_tool.integration.spec.ts +37 -12
|
@@ -71,7 +71,7 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
71
71
|
for (const block of content) {
|
|
72
72
|
expect(block.type).toBe("resource");
|
|
73
73
|
expect(block.resource).toBeDefined();
|
|
74
|
-
expect(block.resource.
|
|
74
|
+
expect(block.resource.mimeType).toBe("application/json");
|
|
75
75
|
expect(block.resource.text).toBeDefined();
|
|
76
76
|
expect(typeof block.resource.text).toBe("string");
|
|
77
77
|
}
|
|
@@ -80,12 +80,24 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
80
80
|
|
|
81
81
|
const queryResultBlock = content[0].resource;
|
|
82
82
|
expect(queryResultBlock.uri).toContain("#result");
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
expect(Array.isArray(
|
|
88
|
-
|
|
83
|
+
const envelope = JSON.parse(queryResultBlock.text);
|
|
84
|
+
|
|
85
|
+
// Flat rows keyed by column name: the same shape an in-package data
|
|
86
|
+
// app receives, not the type-tagged Malloy cell envelope.
|
|
87
|
+
expect(Array.isArray(envelope.rows)).toBe(true);
|
|
88
|
+
expect(envelope.rows.length).toBeGreaterThan(0);
|
|
89
|
+
expect(typeof envelope.rows[0]).toBe("object");
|
|
90
|
+
expect(envelope.rows[0].data).toBeUndefined();
|
|
91
|
+
|
|
92
|
+
// Credible's field names, so an agent sees one shape whether the
|
|
93
|
+
// app is authored locally against Publisher or served in production.
|
|
94
|
+
expect(typeof envelope._query_row_limit).toBe("number");
|
|
95
|
+
expect(typeof envelope._limit_hit).toBe("boolean");
|
|
96
|
+
// Absent rather than false when nothing was dropped.
|
|
97
|
+
expect("_rows_truncated" in envelope).toBe(false);
|
|
98
|
+
// The metadata flat rows drop.
|
|
99
|
+
expect(envelope._meta.schema).toBeDefined();
|
|
100
|
+
expect(typeof envelope._meta.connection_name).toBe("string");
|
|
89
101
|
},
|
|
90
102
|
{ timeout: 30000 },
|
|
91
103
|
);
|
|
@@ -120,7 +132,7 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
120
132
|
const queryResultBlock = result.content![0];
|
|
121
133
|
expect(queryResultBlock.type).toBe("resource");
|
|
122
134
|
expect(queryResultBlock.resource).toBeDefined();
|
|
123
|
-
expect(queryResultBlock.resource.
|
|
135
|
+
expect(queryResultBlock.resource.mimeType).toBe("application/json");
|
|
124
136
|
expect(queryResultBlock.resource.uri).toMatch(/result/); // Check URI contains queryResult
|
|
125
137
|
expect(queryResultBlock.resource.text).toBeDefined();
|
|
126
138
|
|
|
@@ -159,7 +171,7 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
159
171
|
const errorBlockSyntax = result.content![0];
|
|
160
172
|
expect(errorBlockSyntax.type).toBe("resource");
|
|
161
173
|
expect(errorBlockSyntax.resource).toBeDefined();
|
|
162
|
-
expect(errorBlockSyntax.resource.
|
|
174
|
+
expect(errorBlockSyntax.resource.mimeType).toBe("application/json");
|
|
163
175
|
|
|
164
176
|
// Check for Malloy compilation error message from getMalloyErrorDetails
|
|
165
177
|
const errorJsonTextSyntax = errorBlockSyntax.resource
|
|
@@ -169,6 +181,17 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
169
181
|
/syntax error|no viable alternative/i,
|
|
170
182
|
);
|
|
171
183
|
expect(Array.isArray(errorPayloadSyntax.suggestions)).toBe(true);
|
|
184
|
+
|
|
185
|
+
// The resource block is invisible to a client that renders only
|
|
186
|
+
// text on an isError result, which is how a real diagnostic gets
|
|
187
|
+
// reported as a bare "Unknown error". Pinned here, over the real
|
|
188
|
+
// HTTP transport, because the unit spec calls the handler directly
|
|
189
|
+
// and so cannot catch the block being dropped in serialization.
|
|
190
|
+
const textBlockSyntax = result.content!.find(
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
192
|
+
(b: any) => b.type === "text",
|
|
193
|
+
);
|
|
194
|
+
expect(textBlockSyntax?.text).toContain(errorPayloadSyntax.error);
|
|
172
195
|
},
|
|
173
196
|
{ timeout: 30000 },
|
|
174
197
|
);
|
|
@@ -277,7 +300,9 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
277
300
|
const errorBlockPkgNotFound = result.content![0];
|
|
278
301
|
expect(errorBlockPkgNotFound.type).toBe("resource");
|
|
279
302
|
expect(errorBlockPkgNotFound.resource).toBeDefined();
|
|
280
|
-
expect(errorBlockPkgNotFound.resource.
|
|
303
|
+
expect(errorBlockPkgNotFound.resource.mimeType).toBe(
|
|
304
|
+
"application/json",
|
|
305
|
+
);
|
|
281
306
|
|
|
282
307
|
// Parse the JSON string from the resource text content
|
|
283
308
|
const errorJsonTextPkgNotFound = errorBlockPkgNotFound.resource
|
|
@@ -321,7 +346,7 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
321
346
|
const errorBlockModel = result.content![0];
|
|
322
347
|
expect(errorBlockModel.type).toBe("resource");
|
|
323
348
|
expect(errorBlockModel.resource).toBeDefined();
|
|
324
|
-
expect(errorBlockModel.resource.
|
|
349
|
+
expect(errorBlockModel.resource.mimeType).toBe("application/json");
|
|
325
350
|
|
|
326
351
|
// Parse the JSON string from the resource text content
|
|
327
352
|
const errorJsonTextModel = errorBlockModel.resource.text as string;
|
|
@@ -398,7 +423,7 @@ describe.serial("MCP Tool Handlers (E2E Integration)", () => {
|
|
|
398
423
|
const errorBlock = result.content![0];
|
|
399
424
|
expect(errorBlock.type).toBe("resource");
|
|
400
425
|
expect(errorBlock.resource).toBeDefined();
|
|
401
|
-
expect(errorBlock.resource.
|
|
426
|
+
expect(errorBlock.resource.mimeType).toBe("application/json");
|
|
402
427
|
|
|
403
428
|
// Check for Malloy error indicating the query/view wasn't found at the top level
|
|
404
429
|
const errorJsonText = errorBlock.resource.text as string;
|