@corva/ui 3.62.0-4 → 3.62.0-6
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/MCP_README.md +18 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts +2 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.d.ts +4 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
- package/mcp-server/server.mjs +468 -25
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/mcp-server/server.mjs
CHANGED
|
@@ -11,10 +11,10 @@ import { randomUUID } from 'crypto';
|
|
|
11
11
|
import { Resource } from '@opentelemetry/resources';
|
|
12
12
|
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
|
|
13
13
|
import { readFile } from 'fs/promises';
|
|
14
|
-
import { join as join$1,
|
|
15
|
-
import { fileURLToPath } from 'url';
|
|
14
|
+
import { join as join$1, resolve, dirname } from 'path';
|
|
16
15
|
import { z } from 'zod';
|
|
17
16
|
import { readFileSync } from 'fs';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
18
|
|
|
19
19
|
const LOG_SYMBOLS = {
|
|
20
20
|
success: '✓',
|
|
@@ -198,6 +198,7 @@ const createNoopMetricsClient = () => ({
|
|
|
198
198
|
recordToolEmptyResult: () => { },
|
|
199
199
|
recordPromptInvocation: () => { },
|
|
200
200
|
recordPromptError: () => { },
|
|
201
|
+
recordFeedback: () => { },
|
|
201
202
|
recordSession: () => { },
|
|
202
203
|
recordSessionEnd: () => { },
|
|
203
204
|
});
|
|
@@ -228,9 +229,9 @@ const validateDsn = (dsn) => {
|
|
|
228
229
|
return url.href;
|
|
229
230
|
};
|
|
230
231
|
|
|
231
|
-
const MCP_SERVER_VERSION = '1.
|
|
232
|
+
const MCP_SERVER_VERSION = '1.3.0';
|
|
232
233
|
|
|
233
|
-
var version = "3.62.0-
|
|
234
|
+
var version = "3.62.0-6";
|
|
234
235
|
|
|
235
236
|
const CORVA_UI_VERSION = version;
|
|
236
237
|
|
|
@@ -250,6 +251,9 @@ const createMetricsClient = (meter) => {
|
|
|
250
251
|
const promptErrorCounter = meter.createCounter('mcp.server.prompt.errors', {
|
|
251
252
|
description: 'Number of prompt invocation errors',
|
|
252
253
|
});
|
|
254
|
+
const feedbackCounter = meter.createCounter('mcp.server.feedback', {
|
|
255
|
+
description: 'Number of feedback submissions',
|
|
256
|
+
});
|
|
253
257
|
const operationDuration = meter.createHistogram('mcp.server.operation.duration', {
|
|
254
258
|
description: 'Duration of MCP operations (tool and prompt calls) in milliseconds',
|
|
255
259
|
unit: 'ms',
|
|
@@ -287,6 +291,12 @@ const createMetricsClient = (meter) => {
|
|
|
287
291
|
recordPromptError: (promptName, errorType) => {
|
|
288
292
|
promptErrorCounter.add(1, { 'gen_ai.prompt.name': promptName, 'error.type': errorType });
|
|
289
293
|
},
|
|
294
|
+
recordFeedback: (sentiment, category) => {
|
|
295
|
+
feedbackCounter.add(1, {
|
|
296
|
+
'corva.mcp.feedback.sentiment': sentiment,
|
|
297
|
+
...(category ? { 'corva.mcp.feedback.category': category } : {}),
|
|
298
|
+
});
|
|
299
|
+
},
|
|
290
300
|
recordSession: (clientName, clientVersion, projectIdentity) => {
|
|
291
301
|
sessionCounter.add(1, {
|
|
292
302
|
'mcp.client.name': clientName || UNKNOWN_CLIENT_ATTR,
|
|
@@ -530,7 +540,7 @@ const createTracerTelemetryClient = (tracer, sessionId, metrics, providerShutdow
|
|
|
530
540
|
};
|
|
531
541
|
};
|
|
532
542
|
|
|
533
|
-
const getLocalConfigPath = () => join$1(
|
|
543
|
+
const getLocalConfigPath = () => join$1(process.cwd(), 'mcp-server', 'telemetry-config.local.json');
|
|
534
544
|
|
|
535
545
|
const validateLocalConfig = (data) => {
|
|
536
546
|
if (!data || typeof data !== 'object') {
|
|
@@ -19340,6 +19350,8 @@ var clientsData = [
|
|
|
19340
19350
|
"acknowledge",
|
|
19341
19351
|
"classify",
|
|
19342
19352
|
"transition",
|
|
19353
|
+
"escalate",
|
|
19354
|
+
"deescalate",
|
|
19343
19355
|
"totals",
|
|
19344
19356
|
"details",
|
|
19345
19357
|
"alertworkflows",
|
|
@@ -19626,6 +19638,7 @@ var clientsData = [
|
|
|
19626
19638
|
"column_fields_list",
|
|
19627
19639
|
"flat",
|
|
19628
19640
|
"activity_code_mappings",
|
|
19641
|
+
"metrics_definitions",
|
|
19629
19642
|
"countries",
|
|
19630
19643
|
"country_list",
|
|
19631
19644
|
"revoltchat",
|
|
@@ -21648,6 +21661,20 @@ var clientsData = [
|
|
|
21648
21661
|
required: false,
|
|
21649
21662
|
description: "Levels could be a string or a comma-delimited list of strings"
|
|
21650
21663
|
},
|
|
21664
|
+
{
|
|
21665
|
+
name: "sort",
|
|
21666
|
+
"in": "query",
|
|
21667
|
+
type: "string",
|
|
21668
|
+
required: false,
|
|
21669
|
+
description: "Column to sort by, one of [alert_at, last_alert_at, created_at, status, status_changed_at, level, occurrences, acknowledged, validated, alert_classification, name]. Unrecognized values fall back to the default sort (alert_at descending)."
|
|
21670
|
+
},
|
|
21671
|
+
{
|
|
21672
|
+
name: "order",
|
|
21673
|
+
"in": "query",
|
|
21674
|
+
type: "string",
|
|
21675
|
+
required: false,
|
|
21676
|
+
description: "Sort direction, asc or desc. Applies only when sort is provided and defaults to asc; without sort, results are returned alert_at descending."
|
|
21677
|
+
},
|
|
21651
21678
|
{
|
|
21652
21679
|
name: "serializer",
|
|
21653
21680
|
"in": "query",
|
|
@@ -21864,6 +21891,86 @@ var clientsData = [
|
|
|
21864
21891
|
}
|
|
21865
21892
|
}
|
|
21866
21893
|
},
|
|
21894
|
+
{
|
|
21895
|
+
path: "/v1/alerts/{alert_id}/escalate",
|
|
21896
|
+
method: "POST",
|
|
21897
|
+
summary: "Escalate alert to specific users",
|
|
21898
|
+
tags: [
|
|
21899
|
+
"Alerts"
|
|
21900
|
+
],
|
|
21901
|
+
parameters: [
|
|
21902
|
+
{
|
|
21903
|
+
name: "alert_id",
|
|
21904
|
+
"in": "path",
|
|
21905
|
+
type: "integer",
|
|
21906
|
+
required: true,
|
|
21907
|
+
description: "Alert ID"
|
|
21908
|
+
}
|
|
21909
|
+
],
|
|
21910
|
+
requestBody: {
|
|
21911
|
+
contentType: "application/json",
|
|
21912
|
+
schema: "any",
|
|
21913
|
+
required: true
|
|
21914
|
+
},
|
|
21915
|
+
responses: {
|
|
21916
|
+
"200": {
|
|
21917
|
+
description: "Alert with new active escalation",
|
|
21918
|
+
schema: "any"
|
|
21919
|
+
},
|
|
21920
|
+
"401": {
|
|
21921
|
+
description: "Authentication error",
|
|
21922
|
+
schema: "any"
|
|
21923
|
+
},
|
|
21924
|
+
"403": {
|
|
21925
|
+
description: "Authorization error",
|
|
21926
|
+
schema: "any"
|
|
21927
|
+
},
|
|
21928
|
+
"404": {
|
|
21929
|
+
description: "Not found error",
|
|
21930
|
+
schema: "any"
|
|
21931
|
+
},
|
|
21932
|
+
"422": {
|
|
21933
|
+
description: "Invalid request (empty user_ids, users outside company, or alert in terminal state)"
|
|
21934
|
+
}
|
|
21935
|
+
}
|
|
21936
|
+
},
|
|
21937
|
+
{
|
|
21938
|
+
path: "/v1/alerts/{alert_id}/deescalate",
|
|
21939
|
+
method: "POST",
|
|
21940
|
+
summary: "Close active escalation on alert",
|
|
21941
|
+
tags: [
|
|
21942
|
+
"Alerts"
|
|
21943
|
+
],
|
|
21944
|
+
parameters: [
|
|
21945
|
+
{
|
|
21946
|
+
name: "alert_id",
|
|
21947
|
+
"in": "path",
|
|
21948
|
+
type: "integer",
|
|
21949
|
+
required: true,
|
|
21950
|
+
description: "Alert ID"
|
|
21951
|
+
}
|
|
21952
|
+
],
|
|
21953
|
+
responses: {
|
|
21954
|
+
"200": {
|
|
21955
|
+
description: "Alert with escalation closed",
|
|
21956
|
+
schema: "any"
|
|
21957
|
+
},
|
|
21958
|
+
"401": {
|
|
21959
|
+
description: "Authentication error",
|
|
21960
|
+
schema: "any"
|
|
21961
|
+
},
|
|
21962
|
+
"403": {
|
|
21963
|
+
description: "Only the escalated user or an admin can de-escalate"
|
|
21964
|
+
},
|
|
21965
|
+
"404": {
|
|
21966
|
+
description: "Not found error",
|
|
21967
|
+
schema: "any"
|
|
21968
|
+
},
|
|
21969
|
+
"422": {
|
|
21970
|
+
description: "Alert is not escalated"
|
|
21971
|
+
}
|
|
21972
|
+
}
|
|
21973
|
+
},
|
|
21867
21974
|
{
|
|
21868
21975
|
path: "/v1/alerts/totals",
|
|
21869
21976
|
method: "GET",
|
|
@@ -22081,6 +22188,20 @@ var clientsData = [
|
|
|
22081
22188
|
type: "any",
|
|
22082
22189
|
required: false,
|
|
22083
22190
|
description: "Levels could be a string or a comma-delimited list of strings"
|
|
22191
|
+
},
|
|
22192
|
+
{
|
|
22193
|
+
name: "sort",
|
|
22194
|
+
"in": "query",
|
|
22195
|
+
type: "string",
|
|
22196
|
+
required: false,
|
|
22197
|
+
description: "Column to sort by, one of [alert_at, last_alert_at, created_at, status, status_changed_at, level, occurrences, acknowledged, validated, alert_classification, name]. Unrecognized values fall back to the default sort (alert_at descending)."
|
|
22198
|
+
},
|
|
22199
|
+
{
|
|
22200
|
+
name: "order",
|
|
22201
|
+
"in": "query",
|
|
22202
|
+
type: "string",
|
|
22203
|
+
required: false,
|
|
22204
|
+
description: "Sort direction, asc or desc. Applies only when sort is provided and defaults to asc; without sort, results are returned alert_at descending."
|
|
22084
22205
|
}
|
|
22085
22206
|
],
|
|
22086
22207
|
responses: {
|
|
@@ -49214,6 +49335,47 @@ var clientsData = [
|
|
|
49214
49335
|
}
|
|
49215
49336
|
}
|
|
49216
49337
|
},
|
|
49338
|
+
{
|
|
49339
|
+
path: "/v2/data_export_app/metrics_definitions",
|
|
49340
|
+
method: "GET",
|
|
49341
|
+
summary: "Get dynamic metric definitions for a company",
|
|
49342
|
+
description: "Returns per-company dynamic metric metadata from the `corva#metrics.definitions`\nMongoDB collection. The FE uses this to render custom metrics (name, category,\nunit, ILT icon/color) without hardcoding them per company.\n\nNotes:\n- One entry per segment; only the **latest** document per segment is returned.\n- Backend-internal fields (`rules`, `restrict`, `description`) are stripped.\n- `usage_rules` is included as-is when present; FE matches wells by program name.\n- Metric **values** flow through the existing `/v2/data_export_app/flat` endpoint —\n no separate fetch is required.\n",
|
|
49343
|
+
tags: [
|
|
49344
|
+
"Data Export App"
|
|
49345
|
+
],
|
|
49346
|
+
parameters: [
|
|
49347
|
+
{
|
|
49348
|
+
name: "company_id",
|
|
49349
|
+
"in": "query",
|
|
49350
|
+
type: "integer",
|
|
49351
|
+
required: true,
|
|
49352
|
+
description: "Company ID to fetch metric definitions for"
|
|
49353
|
+
}
|
|
49354
|
+
],
|
|
49355
|
+
responses: {
|
|
49356
|
+
"200": {
|
|
49357
|
+
description: "Successful response with definitions(or empty array if none exist)",
|
|
49358
|
+
schema: "MetricsDefinitionsList"
|
|
49359
|
+
},
|
|
49360
|
+
"400": {
|
|
49361
|
+
description: "Bad request - company_id is required"
|
|
49362
|
+
},
|
|
49363
|
+
"401": {
|
|
49364
|
+
description: "Authentication error",
|
|
49365
|
+
schema: "AuthenticationError"
|
|
49366
|
+
},
|
|
49367
|
+
"403": {
|
|
49368
|
+
description: "Forbidden - user has no access to wells in this company"
|
|
49369
|
+
},
|
|
49370
|
+
"404": {
|
|
49371
|
+
description: "Not found error",
|
|
49372
|
+
schema: "NotFoundError"
|
|
49373
|
+
},
|
|
49374
|
+
"503": {
|
|
49375
|
+
description: "Service unavailable - upstream MongoDB error"
|
|
49376
|
+
}
|
|
49377
|
+
}
|
|
49378
|
+
},
|
|
49217
49379
|
{
|
|
49218
49380
|
path: "/v2/country_list",
|
|
49219
49381
|
method: "GET",
|
|
@@ -50505,6 +50667,20 @@ var clientsData = [
|
|
|
50505
50667
|
required: false,
|
|
50506
50668
|
description: "Levels could be a string or a comma-delimited list of strings"
|
|
50507
50669
|
},
|
|
50670
|
+
{
|
|
50671
|
+
name: "sort",
|
|
50672
|
+
"in": "query",
|
|
50673
|
+
type: "string",
|
|
50674
|
+
required: false,
|
|
50675
|
+
description: "Column to sort by, one of [alert_at, last_alert_at, created_at, status, status_changed_at, level, occurrences, acknowledged, validated, alert_classification, name]. Unrecognized values fall back to the default sort (alert_at descending)."
|
|
50676
|
+
},
|
|
50677
|
+
{
|
|
50678
|
+
name: "order",
|
|
50679
|
+
"in": "query",
|
|
50680
|
+
type: "string",
|
|
50681
|
+
required: false,
|
|
50682
|
+
description: "Sort direction, asc or desc. Applies only when sort is provided and defaults to asc; without sort, results are returned alert_at descending."
|
|
50683
|
+
},
|
|
50508
50684
|
{
|
|
50509
50685
|
name: "serializer",
|
|
50510
50686
|
"in": "query",
|
|
@@ -50893,6 +51069,86 @@ var clientsData = [
|
|
|
50893
51069
|
}
|
|
50894
51070
|
}
|
|
50895
51071
|
},
|
|
51072
|
+
{
|
|
51073
|
+
path: "/v1/alerts/{alert_id}/deescalate",
|
|
51074
|
+
method: "POST",
|
|
51075
|
+
summary: "Close active escalation on alert",
|
|
51076
|
+
tags: [
|
|
51077
|
+
"Alerts"
|
|
51078
|
+
],
|
|
51079
|
+
parameters: [
|
|
51080
|
+
{
|
|
51081
|
+
name: "alert_id",
|
|
51082
|
+
"in": "path",
|
|
51083
|
+
type: "integer",
|
|
51084
|
+
required: true,
|
|
51085
|
+
description: "Alert ID"
|
|
51086
|
+
}
|
|
51087
|
+
],
|
|
51088
|
+
responses: {
|
|
51089
|
+
"200": {
|
|
51090
|
+
description: "Alert with escalation closed",
|
|
51091
|
+
schema: "any"
|
|
51092
|
+
},
|
|
51093
|
+
"401": {
|
|
51094
|
+
description: "Authentication error",
|
|
51095
|
+
schema: "any"
|
|
51096
|
+
},
|
|
51097
|
+
"403": {
|
|
51098
|
+
description: "Only the escalated user or an admin can de-escalate"
|
|
51099
|
+
},
|
|
51100
|
+
"404": {
|
|
51101
|
+
description: "Not found error",
|
|
51102
|
+
schema: "any"
|
|
51103
|
+
},
|
|
51104
|
+
"422": {
|
|
51105
|
+
description: "Alert is not escalated"
|
|
51106
|
+
}
|
|
51107
|
+
}
|
|
51108
|
+
},
|
|
51109
|
+
{
|
|
51110
|
+
path: "/v1/alerts/{alert_id}/escalate",
|
|
51111
|
+
method: "POST",
|
|
51112
|
+
summary: "Escalate alert to specific users",
|
|
51113
|
+
tags: [
|
|
51114
|
+
"Alerts"
|
|
51115
|
+
],
|
|
51116
|
+
parameters: [
|
|
51117
|
+
{
|
|
51118
|
+
name: "alert_id",
|
|
51119
|
+
"in": "path",
|
|
51120
|
+
type: "integer",
|
|
51121
|
+
required: true,
|
|
51122
|
+
description: "Alert ID"
|
|
51123
|
+
}
|
|
51124
|
+
],
|
|
51125
|
+
requestBody: {
|
|
51126
|
+
contentType: "application/json",
|
|
51127
|
+
schema: "any",
|
|
51128
|
+
required: true
|
|
51129
|
+
},
|
|
51130
|
+
responses: {
|
|
51131
|
+
"200": {
|
|
51132
|
+
description: "Alert with new active escalation",
|
|
51133
|
+
schema: "any"
|
|
51134
|
+
},
|
|
51135
|
+
"401": {
|
|
51136
|
+
description: "Authentication error",
|
|
51137
|
+
schema: "any"
|
|
51138
|
+
},
|
|
51139
|
+
"403": {
|
|
51140
|
+
description: "Authorization error",
|
|
51141
|
+
schema: "any"
|
|
51142
|
+
},
|
|
51143
|
+
"404": {
|
|
51144
|
+
description: "Not found error",
|
|
51145
|
+
schema: "any"
|
|
51146
|
+
},
|
|
51147
|
+
"422": {
|
|
51148
|
+
description: "Invalid request (empty user_ids, users outside company, or alert in terminal state)"
|
|
51149
|
+
}
|
|
51150
|
+
}
|
|
51151
|
+
},
|
|
50896
51152
|
{
|
|
50897
51153
|
path: "/v1/alerts/{alert_id}/likes",
|
|
50898
51154
|
method: "GET",
|
|
@@ -51482,6 +51738,20 @@ var clientsData = [
|
|
|
51482
51738
|
type: "any",
|
|
51483
51739
|
required: false,
|
|
51484
51740
|
description: "Levels could be a string or a comma-delimited list of strings"
|
|
51741
|
+
},
|
|
51742
|
+
{
|
|
51743
|
+
name: "sort",
|
|
51744
|
+
"in": "query",
|
|
51745
|
+
type: "string",
|
|
51746
|
+
required: false,
|
|
51747
|
+
description: "Column to sort by, one of [alert_at, last_alert_at, created_at, status, status_changed_at, level, occurrences, acknowledged, validated, alert_classification, name]. Unrecognized values fall back to the default sort (alert_at descending)."
|
|
51748
|
+
},
|
|
51749
|
+
{
|
|
51750
|
+
name: "order",
|
|
51751
|
+
"in": "query",
|
|
51752
|
+
type: "string",
|
|
51753
|
+
required: false,
|
|
51754
|
+
description: "Sort direction, asc or desc. Applies only when sort is provided and defaults to asc; without sort, results are returned alert_at descending."
|
|
51485
51755
|
}
|
|
51486
51756
|
],
|
|
51487
51757
|
responses: {
|
|
@@ -68361,6 +68631,47 @@ var clientsData = [
|
|
|
68361
68631
|
schema: "any"
|
|
68362
68632
|
}
|
|
68363
68633
|
}
|
|
68634
|
+
},
|
|
68635
|
+
{
|
|
68636
|
+
path: "/v2/data_export_app/metrics_definitions",
|
|
68637
|
+
method: "GET",
|
|
68638
|
+
summary: "Get dynamic metric definitions for a company",
|
|
68639
|
+
description: "Returns per-company dynamic metric metadata from the `corva#metrics.definitions`\nMongoDB collection. The FE uses this to render custom metrics (name, category,\nunit, ILT icon/color) without hardcoding them per company.\n\nNotes:\n- One entry per segment; only the **latest** document per segment is returned.\n- Backend-internal fields (`rules`, `restrict`, `description`) are stripped.\n- `usage_rules` is included as-is when present; FE matches wells by program name.\n- Metric **values** flow through the existing `/v2/data_export_app/flat` endpoint —\n no separate fetch is required.\n",
|
|
68640
|
+
tags: [
|
|
68641
|
+
"Data Export App"
|
|
68642
|
+
],
|
|
68643
|
+
parameters: [
|
|
68644
|
+
{
|
|
68645
|
+
name: "company_id",
|
|
68646
|
+
"in": "query",
|
|
68647
|
+
type: "integer",
|
|
68648
|
+
required: true,
|
|
68649
|
+
description: "Company ID to fetch metric definitions for"
|
|
68650
|
+
}
|
|
68651
|
+
],
|
|
68652
|
+
responses: {
|
|
68653
|
+
"200": {
|
|
68654
|
+
description: "Successful response with definitions(or empty array if none exist)",
|
|
68655
|
+
schema: "MetricsDefinitionsList"
|
|
68656
|
+
},
|
|
68657
|
+
"400": {
|
|
68658
|
+
description: "Bad request - company_id is required"
|
|
68659
|
+
},
|
|
68660
|
+
"401": {
|
|
68661
|
+
description: "Authentication error",
|
|
68662
|
+
schema: "AuthenticationError"
|
|
68663
|
+
},
|
|
68664
|
+
"403": {
|
|
68665
|
+
description: "Forbidden - user has no access to wells in this company"
|
|
68666
|
+
},
|
|
68667
|
+
"404": {
|
|
68668
|
+
description: "Not found error",
|
|
68669
|
+
schema: "NotFoundError"
|
|
68670
|
+
},
|
|
68671
|
+
"503": {
|
|
68672
|
+
description: "Service unavailable - upstream MongoDB error"
|
|
68673
|
+
}
|
|
68674
|
+
}
|
|
68364
68675
|
}
|
|
68365
68676
|
],
|
|
68366
68677
|
DatasetTypes: [
|
|
@@ -91657,6 +91968,8 @@ var entries = [
|
|
|
91657
91968
|
"acknowledge",
|
|
91658
91969
|
"classify",
|
|
91659
91970
|
"transition",
|
|
91971
|
+
"escalate",
|
|
91972
|
+
"deescalate",
|
|
91660
91973
|
"totals",
|
|
91661
91974
|
"details",
|
|
91662
91975
|
"alertworkflows",
|
|
@@ -91943,6 +92256,7 @@ var entries = [
|
|
|
91943
92256
|
"column_fields_list",
|
|
91944
92257
|
"flat",
|
|
91945
92258
|
"activity_code_mappings",
|
|
92259
|
+
"metrics_definitions",
|
|
91946
92260
|
"countries",
|
|
91947
92261
|
"country_list",
|
|
91948
92262
|
"revoltchat",
|
|
@@ -91954,7 +92268,7 @@ var entries = [
|
|
|
91954
92268
|
],
|
|
91955
92269
|
category: "clients",
|
|
91956
92270
|
importPath: "@corva/ui/clients",
|
|
91957
|
-
searchText: "corvaapi main api client for corva platform. provides methods for get, put, patch, post, delete requests. api http request fetch rest get post put delete patch abilitycheck v2 ability_check check_feature check_permission feed activities alerts v1 comments likes toggle definitions context trigger close check templates enable disable alertdefinitions alertgroups alert_groups alert_group_users alert_group_assets alert_group_configurations occurrences acknowledge classify transition totals details alertworkflows alert_workflows appreviews app_reviews approve decline assets favorites settings type_wells type_well reruns ancestor_ids resolve autocomplete programs clusters pads frac_fleets app_wells wells active_wells rigs active_well well_cache drillout_units frac fleets wirelines dashboardappannotations dashboard_app_annotations last_annotations dashboards users dashboard_apps bulk_create batch_update dashboard_folders dashboard_shares dashboard_folder_shares use clone use_template available_timezones well planning dashboards well_planning_dashboards data data_filters data_filters#2 files file sign preview download download_link url security groups assign_users copy_users wellview integration ingest bha frac_stage_design frac_stage_summary frac_stage_summary_calculated job_settings plugs .well-known jwks.json jwks messageproducer message_producer notifications acknowledge_all count unread security_policies companies permissions bulk_destroy grouped picklists items tasks user_token#1 user_token#2 user_token#3 user_token#4 sessions verification schemas export streaks identity_verifiers api_keys deactivate apps install packages upload app_categories categories featured types secrets appdatasets app_datasets mark_followable app_help_contents signed_url applogs app_logs events search apptypes app_types appsettingstemplates app_settings_templates share unshare copy publish appstreamtemplate app_stream_templates appstreamtemplateapp add_app update_app remove_app datasettypes dataset_types datset_types documents document_sections rig_templates aggregated_values rig aggregated values rig_template_categories rig_template_items tiers productsubscriptions product_subscriptions cancel deny platformsubscriptions platform_subscriptions resume provisioningsubscriptions provisioning_subscriptions app_streams purchasesubscriptions purchase_subscriptions subscriptionfeatures subscription_features wellcache corva blacklisteddatasets blacklisted_datasets app metrics app_metrics for_selected_apps appassets packagereviews package_reviews apppurchases app_purchases datasets filtered_by_apps appruns app_runs stop duplicate_check appstream idle_worker_stats create_backfill_stream force_resume batch_destroy update_edr_provider_connection_status appconnection app_connections update_package apperroralert app_error_alerts subscribe unsubscribe usage summaries workflows workflow_content_blocks workflow_apps workflowroles workflow_roles columnmappertemplates column_mapper_templates add_asset remove_asset columnmappertemplatechannels column_mapper_template_channels columnmappertemplaterules column_mapper_template_rules dashboard_workflows ungroup ungroup_all change_asset competitoranalysis competitor_analysis statistics company app_companies appstoretemplates app_store_templates appstoretemplatesections app_store_template_sections app_store_template_section appstorearticles app_store_articles remove_section signedurl audits dataset_audits permission_audits group_membership_audits provisioning_subscription_audits platform_subscription_audits purchase_subscription_audits event audit appusage usage_analytics app_usage usage_list view_date_list top_apps top_users total_usage_trend partialwellreruns partial_reruns list start_merging fail restart app_progress partialwellrerunappprogresses app_progresses searchsuggestions search_suggestions goals projects projectfolders project_folders projectfiles project_files registeredmodels registered_models appschedule app_schedules bulk_update_status package_audits apikey api_keys_management activate edrproviders edr_providers test_connection api_key_audits typewells padfracfleets pad_frac_fleets fracfleetcontracts frac_fleet_contracts interventionunits intervention_units interventionunitevents intervention_unit_events data export app data_export_app column_fields column_fields_list flat activity_code_mappings countries country_list revoltchat revolt_chat_sessions interventionunitreruns intervention_unit_reruns"
|
|
92271
|
+
searchText: "corvaapi main api client for corva platform. provides methods for get, put, patch, post, delete requests. api http request fetch rest get post put delete patch abilitycheck v2 ability_check check_feature check_permission feed activities alerts v1 comments likes toggle definitions context trigger close check templates enable disable alertdefinitions alertgroups alert_groups alert_group_users alert_group_assets alert_group_configurations occurrences acknowledge classify transition escalate deescalate totals details alertworkflows alert_workflows appreviews app_reviews approve decline assets favorites settings type_wells type_well reruns ancestor_ids resolve autocomplete programs clusters pads frac_fleets app_wells wells active_wells rigs active_well well_cache drillout_units frac fleets wirelines dashboardappannotations dashboard_app_annotations last_annotations dashboards users dashboard_apps bulk_create batch_update dashboard_folders dashboard_shares dashboard_folder_shares use clone use_template available_timezones well planning dashboards well_planning_dashboards data data_filters data_filters#2 files file sign preview download download_link url security groups assign_users copy_users wellview integration ingest bha frac_stage_design frac_stage_summary frac_stage_summary_calculated job_settings plugs .well-known jwks.json jwks messageproducer message_producer notifications acknowledge_all count unread security_policies companies permissions bulk_destroy grouped picklists items tasks user_token#1 user_token#2 user_token#3 user_token#4 sessions verification schemas export streaks identity_verifiers api_keys deactivate apps install packages upload app_categories categories featured types secrets appdatasets app_datasets mark_followable app_help_contents signed_url applogs app_logs events search apptypes app_types appsettingstemplates app_settings_templates share unshare copy publish appstreamtemplate app_stream_templates appstreamtemplateapp add_app update_app remove_app datasettypes dataset_types datset_types documents document_sections rig_templates aggregated_values rig aggregated values rig_template_categories rig_template_items tiers productsubscriptions product_subscriptions cancel deny platformsubscriptions platform_subscriptions resume provisioningsubscriptions provisioning_subscriptions app_streams purchasesubscriptions purchase_subscriptions subscriptionfeatures subscription_features wellcache corva blacklisteddatasets blacklisted_datasets app metrics app_metrics for_selected_apps appassets packagereviews package_reviews apppurchases app_purchases datasets filtered_by_apps appruns app_runs stop duplicate_check appstream idle_worker_stats create_backfill_stream force_resume batch_destroy update_edr_provider_connection_status appconnection app_connections update_package apperroralert app_error_alerts subscribe unsubscribe usage summaries workflows workflow_content_blocks workflow_apps workflowroles workflow_roles columnmappertemplates column_mapper_templates add_asset remove_asset columnmappertemplatechannels column_mapper_template_channels columnmappertemplaterules column_mapper_template_rules dashboard_workflows ungroup ungroup_all change_asset competitoranalysis competitor_analysis statistics company app_companies appstoretemplates app_store_templates appstoretemplatesections app_store_template_sections app_store_template_section appstorearticles app_store_articles remove_section signedurl audits dataset_audits permission_audits group_membership_audits provisioning_subscription_audits platform_subscription_audits purchase_subscription_audits event audit appusage usage_analytics app_usage usage_list view_date_list top_apps top_users total_usage_trend partialwellreruns partial_reruns list start_merging fail restart app_progress partialwellrerunappprogresses app_progresses searchsuggestions search_suggestions goals projects projectfolders project_folders projectfiles project_files registeredmodels registered_models appschedule app_schedules bulk_update_status package_audits apikey api_keys_management activate edrproviders edr_providers test_connection api_key_audits typewells padfracfleets pad_frac_fleets fracfleetcontracts frac_fleet_contracts interventionunits intervention_units interventionunitevents intervention_unit_events data export app data_export_app column_fields column_fields_list flat activity_code_mappings metrics_definitions countries country_list revoltchat revolt_chat_sessions interventionunitreruns intervention_unit_reruns"
|
|
91958
92272
|
},
|
|
91959
92273
|
{
|
|
91960
92274
|
id: "client-corvaDataAPI",
|
|
@@ -100090,6 +100404,14 @@ const withTimeout = async (promise, ms) => {
|
|
|
100090
100404
|
}
|
|
100091
100405
|
};
|
|
100092
100406
|
|
|
100407
|
+
/**
|
|
100408
|
+
* Core @corva/ui entity kinds shared by tool schemas so the vocabulary stays in sync.
|
|
100409
|
+
* `search_corva_ui` (type filter) and `submit_feedback` (category) build their enums from this
|
|
100410
|
+
* base, each adding its own extra members. `list_corva_ui` intentionally uses a separate
|
|
100411
|
+
* plural/versioned representation (components-v1/v2, hooks, …) and is not derived from this list.
|
|
100412
|
+
*/
|
|
100413
|
+
const ENTITY_TYPES = ['component', 'hook', 'util', 'constant', 'client'];
|
|
100414
|
+
|
|
100093
100415
|
/**
|
|
100094
100416
|
* Split camelCase or PascalCase string into words
|
|
100095
100417
|
* e.g., "CustomGradient" -> ["custom", "gradient"]
|
|
@@ -100152,6 +100474,16 @@ const scoreMultiWordQuery = (entry, queryWords, weights) => {
|
|
|
100152
100474
|
return score;
|
|
100153
100475
|
};
|
|
100154
100476
|
|
|
100477
|
+
const SEARCH_TYPES = [
|
|
100478
|
+
'all',
|
|
100479
|
+
...ENTITY_TYPES,
|
|
100480
|
+
'permission',
|
|
100481
|
+
'icon',
|
|
100482
|
+
'hoc',
|
|
100483
|
+
'type',
|
|
100484
|
+
'testing',
|
|
100485
|
+
'style',
|
|
100486
|
+
];
|
|
100155
100487
|
const searchToolName = 'search_corva_ui';
|
|
100156
100488
|
const searchToolTitle = 'Search @corva/ui';
|
|
100157
100489
|
const searchToolDescription = `Search the @corva/ui component library by name, use case, or description.
|
|
@@ -100164,23 +100496,7 @@ Examples:
|
|
|
100164
100496
|
When category is 'v2' or 'v1' and the requested version has no match, the response surfaces a labeled fallback block from the other version so a single search still discovers a candidate. The agent should still prefer V2 when both versions match.`;
|
|
100165
100497
|
const searchToolSchema = {
|
|
100166
100498
|
query: z.string().describe('Search query - component name, use case, or description'),
|
|
100167
|
-
type: z
|
|
100168
|
-
.enum([
|
|
100169
|
-
'all',
|
|
100170
|
-
'component',
|
|
100171
|
-
'hook',
|
|
100172
|
-
'util',
|
|
100173
|
-
'constant',
|
|
100174
|
-
'client',
|
|
100175
|
-
'permission',
|
|
100176
|
-
'icon',
|
|
100177
|
-
'hoc',
|
|
100178
|
-
'type',
|
|
100179
|
-
'testing',
|
|
100180
|
-
'style',
|
|
100181
|
-
])
|
|
100182
|
-
.optional()
|
|
100183
|
-
.describe('Filter by type (default: all)'),
|
|
100499
|
+
type: z.enum(SEARCH_TYPES).optional().describe('Filter by type (default: all)'),
|
|
100184
100500
|
category: z
|
|
100185
100501
|
.enum(['all', 'v2', 'v1'])
|
|
100186
100502
|
.optional()
|
|
@@ -101096,6 +101412,53 @@ const handleGetDiagnostics = (stats, telemetry, identity) => {
|
|
|
101096
101412
|
};
|
|
101097
101413
|
};
|
|
101098
101414
|
|
|
101415
|
+
const FEEDBACK_CATEGORIES = [...ENTITY_TYPES, 'theme', 'tool', 'docs', 'other'];
|
|
101416
|
+
const submitFeedbackToolName = 'submit_feedback';
|
|
101417
|
+
const submitFeedbackToolTitle = 'Submit Feedback';
|
|
101418
|
+
const submitFeedbackToolDescription = `Send feedback about @corva/ui or this MCP server so the maintainers can improve docs and coverage.
|
|
101419
|
+
Use this when the user says something like "send feedback that…", or proactively when you hit a docs/coverage gap (a missing component, a wrong or incomplete prop, a hook that lacks an example, a search that should have matched but didn't).
|
|
101420
|
+
|
|
101421
|
+
Always infer sentiment and category from the feedback itself — do not leave them at the defaults. Reserve sentiment 'neutral' for genuinely factual/mixed feedback and category 'other' only when none of the specific categories fit.
|
|
101422
|
+
Set source to 'agent' when you are reporting a gap on your own initiative, or 'user' when relaying something the user said.
|
|
101423
|
+
Keep message specific and actionable; name the component/hook/util in target when the feedback is about a particular item.`;
|
|
101424
|
+
const submitFeedbackToolSchema = {
|
|
101425
|
+
message: z.string().min(1).describe('The feedback text (required). Be specific and actionable.'),
|
|
101426
|
+
sentiment: z
|
|
101427
|
+
.enum(['positive', 'negative', 'neutral'])
|
|
101428
|
+
.optional()
|
|
101429
|
+
.describe("Tone of the feedback — classify it from the message; don't default to neutral unless the feedback is genuinely neutral/factual (default: neutral)"),
|
|
101430
|
+
category: z
|
|
101431
|
+
.enum(FEEDBACK_CATEGORIES)
|
|
101432
|
+
.optional()
|
|
101433
|
+
.describe("What the feedback is about — pick the most specific category; use 'other' only when none apply"),
|
|
101434
|
+
target: z
|
|
101435
|
+
.string()
|
|
101436
|
+
.optional()
|
|
101437
|
+
.describe('The specific component/hook/util/tool the feedback is about (e.g. "Button")'),
|
|
101438
|
+
source: z
|
|
101439
|
+
.enum(['user', 'agent'])
|
|
101440
|
+
.optional()
|
|
101441
|
+
.describe("Who originated the feedback: 'user' (relayed) or 'agent' (default: user)"),
|
|
101442
|
+
};
|
|
101443
|
+
const handleSubmitFeedback = (args) => {
|
|
101444
|
+
const message = args.message?.trim() ?? '';
|
|
101445
|
+
if (!message) {
|
|
101446
|
+
throw new Error('Feedback message cannot be empty.');
|
|
101447
|
+
}
|
|
101448
|
+
const sentiment = args.sentiment ?? 'neutral';
|
|
101449
|
+
const source = args.source ?? 'user';
|
|
101450
|
+
const category = args.category?.trim() || undefined;
|
|
101451
|
+
const target = args.target?.trim() || undefined;
|
|
101452
|
+
return {
|
|
101453
|
+
response: createToolResponse(`Thanks — your feedback was recorded. (${sentiment})\nThe @corva/ui team uses this to improve the library and its docs.`),
|
|
101454
|
+
message,
|
|
101455
|
+
sentiment,
|
|
101456
|
+
category,
|
|
101457
|
+
target,
|
|
101458
|
+
source,
|
|
101459
|
+
};
|
|
101460
|
+
};
|
|
101461
|
+
|
|
101099
101462
|
// This file is auto-generated by `yarn mcp:generate-prompts`. Do not edit by hand.
|
|
101100
101463
|
// Source: ./figma-to-code.prompt.md
|
|
101101
101464
|
const figmaToCodePromptTemplate = "You are translating a Figma design into React components that consume the `@corva/ui` components library. Follow the\norchestration below strictly and prefer evidence from the target repo over assumptions.\n\n## Inputs\n\nUser request: {{input}}\n\nExtract the Figma URL from the user request by matching `figma.com/design/…`, `figma.com/make/…`, or\n`figma.com/board/…`. Treat the remainder as instructions (target path, file to extend, naming, behavior notes).\n\n## Precedence\n\nWhen sources of truth disagree on file layout, styling, or naming, follow this order (highest wins):\n\n1. Explicit instructions in the user request (target path, file to extend, naming).\n2. Figma Code Connect mappings returned by `mcp__figma__get_design_context`.\n3. `@corva/ui` MCP docs (`get_component_docs`, `get_theme_docs`, icon search, etc.). These are authoritative for what\n exists in the components library.\n4. `AGENTS.md` / `CLAUDE.md` in the target repo, looked up in this order and merged (earlier wins):\n a. the target directory,\n b. the nearest package root (walk up to the first `package.json`), which matters in monorepos,\n c. the repo root.\n5. 1–2 neighboring components in the target directory (fallback when 4 is silent on an axis).\n6. The minimal default policy in Step 8 (fallback when 4 and 5 are both silent).\n\n## Step 1 — Acknowledge (before any tool call)\n\nPrint one short line to the user confirming what you parsed: the Figma URL, the extracted `nodeId` and `fileKey`, and\nthe target path if stated. This is the only user-facing text until after Step 4 completes, so make it specific enough\nthat the user knows the command fired.\n\n## Step 2 — Verify Figma MCP availability\n\nBefore any other work, confirm the Figma Dev Mode MCP is active by checking whether `mcp__figma__get_design_context`\nappears in your available tools.\n\nIf the tool is NOT available:\n\n- Tell the user: \"The Figma Dev Mode MCP is not enabled in this Claude Code session. Enable it via Figma Desktop →\n Preferences → Enable Dev Mode MCP Server, then restart Claude Code and re-run `/figma_to_code`.\"\n- Stop immediately. Do not call any other tool, do not ask follow-up questions, and do not attempt to generate code\n without the design context.\n\nIf the tool IS available, proceed to the next step.\n\n## Step 3 — Resolve missing inputs\n\nIf no Figma URL is present in the user request, ask the user for it. If the target path (or file to extend) is not\nspecified, ask before generating. Do not invent a location.\n\n## Step 4 — Gather design context\n\nCall `mcp__figma__get_design_context` with the Figma URL. Inspect the response for:\n\n- Code Connect snippets / imports / designer instructions (use verbatim when present).\n- Design tokens exposed as CSS variables.\n- Screenshot and annotations.\n- Asset URLs (images, icons) that imply specific primitives.\n\nIf Code Connect coverage is unclear, `mcp__figma__get_code_connect_map` is a verification fallback.\nDo **not** call `mcp__figma__get_code_connect_suggestions`. That tool is for authoring new mappings, not codegen.\n\nIf the first `get_design_context` call returns a sparse \"too large\" response listing sublayer IDs, drill into only the\nheader, one representative row, and one content panel — do NOT recursively walk every child. A targeted sample is\nsufficient to infer the pattern for the remaining rows.\n\n## Step 5 — Read target-repo conventions\n\nBefore generating, read `AGENTS.md` / `CLAUDE.md` at precedence level 4 if present (target dir → nearest package root →\nrepo root). These files define the repo's conventions: file layout, directory structure, styling approach\n(SCSS / MUI `sx` / styled-components / CSS modules), size limits, naming, imports. Extract and apply what's relevant to\nthe target directory.\n\nIf no `AGENTS.md` / `CLAUDE.md` exists at any level, fall through to Step 8 (neighboring components).\n\nMatch the repo's documented import / module syntax (`@import` vs `@use`, named vs default exports, relative vs aliased\npaths). Do not refactor or \"modernize\" the convention as a side quest. If the documented form produces a build or type\nerror, substitute a working equivalent and list the substitution under \"Implementation deviations\" in the Gap Report so\nthe convention file can be updated.\n\n## Step 6 — Detect project mode\n\nRead `./package.json`:\n\n- `\"name\": \"@corva/ui\"` ⇒ **authoring mode**. You are contributing a new primitive to the library itself. If Step 5\n did not yield a concrete file-structure contract (target directory, file layout, export conventions), **stop and ask\n the user** where to scaffold before proceeding. Authoring a primitive in the wrong shape is worse than pausing.\n- `@corva/ui` listed in `dependencies` / `devDependencies` ⇒ **consumer mode** (default). Import from `@corva/ui` entry\n points; do not scaffold new primitives into the consumer repo.\n\n## Step 7 — Resolve @corva/ui primitives for each unmapped node\n\nPriority: **Reuse > Compose > Create**. Create a new primitive only in `@corva/ui` authoring mode (per Step 6) or when\nthe user explicitly asks. In consumer mode, always compose existing primitives — never scaffold new ones.\n\n**Search by capability, not by package name.** Before importing any third-party rendering or runtime package directly,\nsearch `@corva/ui` by capability terms drawn from the Figma node's visual and behavioral language — never let a vendor\nor library name be the decisive query. `@corva/ui` typically wraps third-party libraries (including but not limited to\ncharts, maps, code editors, virtualized lists, drag-and-drop, and rich text) behind a Corva shell whose name contains\nno library name, so queries like `highcharts` or `mapbox` return noise. Treat a Corva shell as the default hypothesis\nand disprove it with three capability search axes: (a) the user-facing widget shell (e.g. `chart container with zoom\nand pan`, `map viewport`); (b) its interaction control family (e.g. `axis dropdown`, `zoom button`,\n`chart type switch`); (c) any setup, provider, or config utility (e.g. `chart theme`, `map provider`). When a shell\nturns up, also pull in its companion controls instead of re-implementing toolbar UX. Each of the three axes must be\nqueried against both `category: 'v2'` and `category: 'v1'` — interaction-control families and shell wrappers (chart,\nmap, editor) often live only in V1, so a V2-only sweep can falsely conclude no Corva equivalent exists. A direct\nthird-party import is valid only if all three axes ran across both versions and returned no Corva equivalent — record\nthe import in the Gap Report's Implementation deviations and list the exact capability queries you ran for each\nversion, so the gap is auditable.\n\nBatch all unrelated primitive, icon, and theme lookups below into a single parallel tool call. Do not serialize them\nacross turns.\n\nFor every Figma subtree without a Code Connect hit:\n\n1. `mcp__corva-ui__search_corva_ui` with `{ query: '<descriptive term>', type: 'component', category: 'v2' }` to find\n candidate components. `query` is required; `type: 'component'` is required because category-only filtering does not\n exclude non-component entries. The tool surfaces a labeled V1 fallback block in the response when V2 has no match —\n when that block appears (or the response is \"No results\"), retry the same query with `category: 'v1'` and treat any\n hits there as candidates. Prefer V2 when both versions match; a capability is only a true gap once both V2 and V1\n have been queried explicitly.\n2. `mcp__corva-ui__get_component_docs` for each chosen component, passing the same `category` (`'v1'` or `'v2'`) that\n the search returned — names can collide across versions (e.g., `Autocomplete` exists in both). Use the returned\n import statement and prop schema verbatim. Variant values must come from the prop schema (e.g., the canonical\n union returned for `variant` or `size`); do not translate Figma variant labels (`\"Primary\"`, `\"Large\"`) by guessing.\n3. For icons: `mcp__corva-ui__search_corva_ui` with `{ query: '<icon description>', type: 'icon' }`. Import exactly the\n export name returned — naming is inconsistent (e.g., `DownSmallIcon`, `Pin`, `AttentionCustomIcon`). Do not guess a\n suffix. Use `mcp__corva-ui__list_corva_ui` with `{ type: 'icons' }` only to discover available icon sets (it lists\n sets and counts, not individual exports).\n4. For colors / spacing / typography / z-index: `mcp__corva-ui__get_theme_docs` — always use canonical token names, and\n never hard-code hex values. Express tokens through whichever mechanism the target repo's `AGENTS.md` or neighboring\n components already use (SCSS mixin, MUI `theme.*` helper, CSS custom property, Tailwind class, etc.). Match what's\n there rather than introducing a new style system.\n\n When a third-party config (chart libraries, mapping libs, canvas/WebGL code) requires palette / typography /\n semantic-color literals inline in JS/TS, do not paste Figma hex values. Source the values from `get_theme_docs`. If\n `@corva/ui` exposes a documented JS/TS theme module, import from it and cite the path. If no JS export exists,\n surface the role as an \"Unmapped token\" in the Gap Report — do not silently inline a hex. This rule does NOT apply\n to chart geometry (tick intervals, axis domains, heights, spacing) — those are domain values, not tokens.\n5. For hooks, constants, and clients implied by the design (subscriptions, feature flags, API calls, etc.):\n `mcp__corva-ui__get_hook_docs`, `mcp__corva-ui__get_constants_docs`, `mcp__corva-ui__get_client_docs`. For generic\n utilities (formatters, converters, helpers): `mcp__corva-ui__search_corva_ui` with `{ query, type: 'util' }`, or\n browse with `mcp__corva-ui__list_corva_ui({ type: 'utils' })`.\n\n## Step 8 — Fall back to neighboring components when conventions are silent\n\nIf `AGENTS.md` / `CLAUDE.md` didn't cover a given axis (styling, file layout, naming), read 1–2 neighboring components\nin the target directory and match what's already there. Do not introduce a new styling system on top of the repo's\nexisting one.\n\nIf neighbors are also inconclusive, use this minimal default policy:\n\n- **Tokens:** canonical names from `get_theme_docs`; never hard-code hex. In `.tsx`, prefer MUI `theme.*` helpers; in\n style files, prefer CSS custom properties.\n- **Component size:** prefer small, focused components. Split by responsibility when a single component starts handling\n multiple distinct concerns.\n- **Output files:** emit only what's needed to render the design. Do not generate documentation, example, or story\n files unless the user explicitly asked.\n\n## Step 9 — Generate\n\n- Emit the component file(s) at the path specified in the user's instructions (or at the location `AGENTS.md` /\n neighbors indicate).\n- Use Code Connect imports verbatim where provided.\n- Use the exact prop names, types, and `importPath` values returned by `get_component_docs`.\n- Do **not** invent @corva/ui primitives, props, icons, or tokens that the MCP tools did not surface.\n- Prefer semantic HTML first (`<button>`, `<nav>`, `<main>`, etc.); add ARIA only where native semantics are\n insufficient, and do not strip roles or semantics that `@corva/ui` primitives already provide.\n- When modifying an existing page/component, preserve existing data flow, state, and non-visual behavior unless the\n user explicitly asked to change them. Touch the UI layer only.\n- When a style value must vary per instance from data (per-row colors, per-segment widths, etc.), pass it via a CSS\n custom property rather than writing inline `style={{ <styling-property>: value }}`. Pattern:\n `<div style={{ '--phase-color': c, '--phase-flex': flex } as React.CSSProperties} />` paired with\n `background: var(--phase-color)` in the SCSS module. If the target repo uses a different style system, follow that\n system's typed dynamic-value mechanism instead.\n- Per-instance dynamic styling applies only to genuinely runtime values (user input, API data, layout measurement). A\n finite design palette of phase / status / category colors is NOT a runtime value — map those to `get_theme_docs`\n tokens or to a documented `@corva/ui` color export. If no token exists, surface them as Unmapped tokens in Step 10\n rather than committing raw hex anywhere (mock data, SCSS extension files, JS constants).\n\nBefore concluding, run this pre-delivery self-check:\n\n- Every `@corva/ui` import statement came from `get_component_docs` output — none guessed.\n- Every icon export name matches what `search_corva_ui` returned — no invented suffixes.\n- No hard-coded hex, rgba, or raw px spacing that should resolve through `get_theme_docs` tokens.\n- Every prop name **and value** matches the schema from `get_component_docs`, not a Figma variant label.\n- For every third-party rendering / runtime library I imported (chart, map, code editor, virtualization, etc.), I ran\n capability-based `@corva/ui` searches across all three axes (widget shell, interaction controls, setup / config\n utility) AND across both `category: 'v2'` and `category: 'v1'`, and either used the Corva shell with its companion\n control family or listed the import in Implementation deviations together with the exact capability queries I ran for\n each version.\n- The final section of this response is `## Gap Report` with the four required subsections (Step 10).\n\n## Step 10 — Gap Report (final section of your response)\n\nYour final assistant response must end with a top-level `## Gap Report` section using the exact shape below. When a\nsubsection has nothing to report, write `_None._` — do not omit subsections.\n\n ## Gap Report\n\n ### Unmapped design nodes\n - <node name / Figma id> — <why no @corva/ui primitive fit; suggested action>\n - …or `_None._`\n\n ### Unmapped tokens\n - <token role e.g. \"axis label color\"> — <Figma value> — <closest @corva/ui token, or \"no equivalent\">\n - …or `_None._`\n\n ### Implementation deviations\n - <departure from convention or design> — <reason> — <follow-up needed>\n - e.g. raw chart-config literals, custom HTML where a primitive existed, third-party rendering lib (chart, map,\n editor) imported directly after capability-based `@corva/ui` searches found no Corva shell — list the queries\n attempted across both `category: 'v2'` and `category: 'v1'`, deferred a11y, etc.\n - …or `_None._`\n\n ### Ambiguous props or interactions\n - <component / interaction> — <ambiguity> — <assumption made or question for the user>\n - …or `_None._`\n\nBegin with Step 1 now.\n";
|
|
@@ -101117,9 +101480,9 @@ const figmaToCodePromptArgsSchema = {
|
|
|
101117
101480
|
.optional()
|
|
101118
101481
|
.describe('Full user request. Include the Figma URL and any target path / extra context. If omitted, the assistant will ask the user before generating.'),
|
|
101119
101482
|
};
|
|
101120
|
-
const INPUT_FALLBACK = '(no input provided — ask the user for the Figma URL and target path/directory before generating)';
|
|
101483
|
+
const INPUT_FALLBACK$1 = '(no input provided — ask the user for the Figma URL and target path/directory before generating)';
|
|
101121
101484
|
const handleFigmaToCode = (args) => {
|
|
101122
|
-
const text = figmaToCodePromptTemplate.replace('{{input}}', args.input ?? INPUT_FALLBACK);
|
|
101485
|
+
const text = figmaToCodePromptTemplate.replace('{{input}}', args.input ?? INPUT_FALLBACK$1);
|
|
101123
101486
|
return {
|
|
101124
101487
|
description: figmaToCodePromptDescription,
|
|
101125
101488
|
messages: [
|
|
@@ -101131,6 +101494,44 @@ const handleFigmaToCode = (args) => {
|
|
|
101131
101494
|
};
|
|
101132
101495
|
};
|
|
101133
101496
|
|
|
101497
|
+
const feedbackPromptName = 'feedback';
|
|
101498
|
+
const feedbackPromptTitle = 'Send Feedback';
|
|
101499
|
+
const feedbackPromptDescription = `Send feedback about @corva/ui or this MCP server to the maintainers. Surfaces as /mcp__corva-ui__feedback.
|
|
101500
|
+
|
|
101501
|
+
Argument:
|
|
101502
|
+
- input: Your feedback. Optionally add a sentiment (positive / negative / neutral) and which component, hook, or tool it is about. If omitted, the assistant will ask before sending.
|
|
101503
|
+
|
|
101504
|
+
Why a single argument: Claude Code's MCP-prompt bridge splits positional string args by whitespace, so a multi-arg schema would swallow only the first token per arg. One freeform arg captures the whole message.`;
|
|
101505
|
+
const feedbackPromptArgsSchema = {
|
|
101506
|
+
input: z
|
|
101507
|
+
.string()
|
|
101508
|
+
.optional()
|
|
101509
|
+
.describe('Your feedback. Optionally mention the sentiment and which component/hook/tool it is about. If omitted, the assistant will ask before sending.'),
|
|
101510
|
+
};
|
|
101511
|
+
const INPUT_FALLBACK = '(no feedback provided — ask the user what feedback they would like to share before sending)';
|
|
101512
|
+
const handleFeedback = (args) => {
|
|
101513
|
+
const feedback = args.input?.trim() || INPUT_FALLBACK;
|
|
101514
|
+
const text = `The user wants to send feedback about @corva/ui (the shared component library) or this MCP server.
|
|
101515
|
+
|
|
101516
|
+
User feedback: ${feedback}
|
|
101517
|
+
|
|
101518
|
+
Do the following:
|
|
101519
|
+
1. If no feedback was provided above, ask the user what they would like to share and wait for their reply. Do not invent feedback.
|
|
101520
|
+
2. Infer a sentiment ('positive', 'negative', or 'neutral') from the feedback. If it is ambiguous, ask the user briefly or default to 'neutral'.
|
|
101521
|
+
3. If the feedback is about a specific item, set category (component, hook, util, constant, client, theme, tool, docs, or other) and target (e.g. the component or hook name).
|
|
101522
|
+
4. Call \`mcp__corva-ui__submit_feedback\` with the message and the fields above, and set \`source: "user"\` (this feedback is relayed from the user).
|
|
101523
|
+
5. Confirm to the user that the feedback was sent.`;
|
|
101524
|
+
return {
|
|
101525
|
+
description: feedbackPromptDescription,
|
|
101526
|
+
messages: [
|
|
101527
|
+
{
|
|
101528
|
+
role: 'user',
|
|
101529
|
+
content: { type: 'text', text },
|
|
101530
|
+
},
|
|
101531
|
+
],
|
|
101532
|
+
};
|
|
101533
|
+
};
|
|
101534
|
+
|
|
101134
101535
|
const readJsonField = (filePath, ...keys) => {
|
|
101135
101536
|
try {
|
|
101136
101537
|
let value = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
@@ -101560,6 +101961,40 @@ class CorvaUiMcpServer {
|
|
|
101560
101961
|
return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
101561
101962
|
}
|
|
101562
101963
|
});
|
|
101964
|
+
this.server.registerTool(submitFeedbackToolName, {
|
|
101965
|
+
title: submitFeedbackToolTitle,
|
|
101966
|
+
description: submitFeedbackToolDescription,
|
|
101967
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101968
|
+
inputSchema: submitFeedbackToolSchema,
|
|
101969
|
+
}, (args, extra) => {
|
|
101970
|
+
const parentContext = extractContextFromMeta(extra?._meta);
|
|
101971
|
+
try {
|
|
101972
|
+
return this.executeToolWithObservability(submitFeedbackToolName, args, () => {
|
|
101973
|
+
const result = handleSubmitFeedback(args);
|
|
101974
|
+
// Supplemental low-cardinality counter, in addition to the standard
|
|
101975
|
+
// tool-call span/metrics recorded by the wrapper. No-op when disabled.
|
|
101976
|
+
if (this.telemetry.isEnabled()) {
|
|
101977
|
+
this.telemetry.metrics.recordFeedback(result.sentiment, result.category);
|
|
101978
|
+
}
|
|
101979
|
+
return { ...result, isEmpty: false };
|
|
101980
|
+
}, r => `feedback recorded (${r.sentiment})`, {
|
|
101981
|
+
parentContext,
|
|
101982
|
+
getSpanAttributes: r => ({
|
|
101983
|
+
// Indexed copy of the message so it is searchable/groupable in
|
|
101984
|
+
// Uptrace (the gen_ai.tool.call.arguments copy is unindexed).
|
|
101985
|
+
'corva.mcp.feedback.message': r.message,
|
|
101986
|
+
'corva.mcp.feedback.sentiment': r.sentiment,
|
|
101987
|
+
'corva.mcp.feedback.source': r.source,
|
|
101988
|
+
'corva.mcp.feedback.message_length': r.message.length,
|
|
101989
|
+
...(r.category ? { 'corva.mcp.feedback.category': r.category } : {}),
|
|
101990
|
+
...(r.target ? { 'corva.mcp.feedback.target': r.target } : {}),
|
|
101991
|
+
}),
|
|
101992
|
+
});
|
|
101993
|
+
}
|
|
101994
|
+
catch (error) {
|
|
101995
|
+
return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
101996
|
+
}
|
|
101997
|
+
});
|
|
101563
101998
|
}
|
|
101564
101999
|
setupPrompts() {
|
|
101565
102000
|
this.server.registerPrompt(figmaToCodePromptName, {
|
|
@@ -101570,6 +102005,14 @@ class CorvaUiMcpServer {
|
|
|
101570
102005
|
const parentContext = extractContextFromMeta(extra?._meta);
|
|
101571
102006
|
return this.executePromptWithObservability(figmaToCodePromptName, args, () => handleFigmaToCode(args), { parentContext, requestId: extra?.requestId });
|
|
101572
102007
|
});
|
|
102008
|
+
this.server.registerPrompt(feedbackPromptName, {
|
|
102009
|
+
title: feedbackPromptTitle,
|
|
102010
|
+
description: feedbackPromptDescription,
|
|
102011
|
+
argsSchema: feedbackPromptArgsSchema,
|
|
102012
|
+
}, (args, extra) => {
|
|
102013
|
+
const parentContext = extractContextFromMeta(extra?._meta);
|
|
102014
|
+
return this.executePromptWithObservability(feedbackPromptName, args, () => handleFeedback(args), { parentContext, requestId: extra?.requestId });
|
|
102015
|
+
});
|
|
101573
102016
|
}
|
|
101574
102017
|
async run() {
|
|
101575
102018
|
const connectTimer = this.mcpLogger.time('transport-connect');
|