@next-vibe/checker 1.0.19 → 1.0.20
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/bin/vibe-runtime.js +355 -133
- package/.dist/bin/vibe-runtime.js.map +17 -17
- package/package.json +2 -2
- package/src/app/api/[locale]/system/check/test-project/tsconfig.tsbuildinfo +1 -1
- package/src/app/api/[locale]/system/check/vibe-check/definition.ts +11 -9
- package/src/app/api/[locale]/system/check/vibe-check/repository.ts +20 -5
- package/src/app/api/[locale]/system/check/vibe-check/route.ts +2 -2
- package/src/app/api/[locale]/system/help/interactive/repository.ts +278 -75
- package/src/app/api/[locale]/system/help/list/repository.ts +14 -7
- package/src/app/api/[locale]/system/help/repository.ts +68 -23
- package/src/app/api/[locale]/system/help/route.ts +2 -2
- package/src/app/api/[locale]/system/unified-interface/cli/i18n/de/index.ts +3 -0
- package/src/app/api/[locale]/system/unified-interface/cli/i18n/en/index.ts +3 -0
- package/src/app/api/[locale]/system/unified-interface/cli/i18n/pl/index.ts +3 -0
- package/src/app/api/[locale]/system/unified-interface/cli/vibe-runtime.ts +25 -14
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/grouped-list.ts +8 -8
- package/src/app/api/[locale]/system/unified-interface/mcp/registry.ts +8 -22
- package/src/app/api/[locale]/system/unified-interface/mcp/serve/repository.ts +6 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/server/server.ts +1 -0
|
@@ -19499,7 +19499,10 @@ var init_de23 = __esm(() => {
|
|
|
19499
19499
|
chooseLocale: "Sprache w\xE4hlen",
|
|
19500
19500
|
german: "Deutsch",
|
|
19501
19501
|
polish: "Polnisch",
|
|
19502
|
-
settingUpdated: "Einstellung erfolgreich aktualisiert"
|
|
19502
|
+
settingUpdated: "Einstellung erfolgreich aktualisiert",
|
|
19503
|
+
viewAllRoutes: "Alle Routen anzeigen",
|
|
19504
|
+
selectRoute: "W\xE4hlen Sie eine Route zur Ausf\xFChrung",
|
|
19505
|
+
backToNavigation: "Zur\xFCck zur Navigation"
|
|
19503
19506
|
}
|
|
19504
19507
|
}
|
|
19505
19508
|
}
|
|
@@ -23499,7 +23502,10 @@ var init_en24 = __esm(() => {
|
|
|
23499
23502
|
chooseLocale: "Choose locale",
|
|
23500
23503
|
german: "German",
|
|
23501
23504
|
polish: "Polish",
|
|
23502
|
-
settingUpdated: "Setting updated successfully"
|
|
23505
|
+
settingUpdated: "Setting updated successfully",
|
|
23506
|
+
viewAllRoutes: "View All Routes",
|
|
23507
|
+
selectRoute: "Select a route to execute",
|
|
23508
|
+
backToNavigation: "Back to Navigation"
|
|
23503
23509
|
}
|
|
23504
23510
|
}
|
|
23505
23511
|
}
|
|
@@ -27430,7 +27436,10 @@ var init_pl23 = __esm(() => {
|
|
|
27430
27436
|
chooseLocale: "Wybierz lokalizacj\u0119",
|
|
27431
27437
|
german: "Niemiecki",
|
|
27432
27438
|
polish: "Polski",
|
|
27433
|
-
settingUpdated: "Ustawienie zosta\u0142o pomy\u015Blnie zaktualizowane"
|
|
27439
|
+
settingUpdated: "Ustawienie zosta\u0142o pomy\u015Blnie zaktualizowane",
|
|
27440
|
+
viewAllRoutes: "Poka\u017C wszystkie trasy",
|
|
27441
|
+
selectRoute: "Wybierz tras\u0119 do wykonania",
|
|
27442
|
+
backToNavigation: "Wr\xF3\u0107 do nawigacji"
|
|
27434
27443
|
}
|
|
27435
27444
|
}
|
|
27436
27445
|
}
|
|
@@ -31318,7 +31327,7 @@ var init_definition3 = __esm(() => {
|
|
|
31318
31327
|
errors: exports_external.number(),
|
|
31319
31328
|
warnings: exports_external.number(),
|
|
31320
31329
|
total: exports_external.number()
|
|
31321
|
-
}))),
|
|
31330
|
+
})).optional()),
|
|
31322
31331
|
summary: responseField({
|
|
31323
31332
|
type: "code_quality_summary" /* CODE_QUALITY_SUMMARY */
|
|
31324
31333
|
}, exports_external.object({
|
|
@@ -41338,7 +41347,8 @@ class VibeCheckRepository {
|
|
|
41338
41347
|
static hasErrorSeverity(issues) {
|
|
41339
41348
|
return issues.some((issue2) => issue2.severity === "error");
|
|
41340
41349
|
}
|
|
41341
|
-
static async execute(data, logger) {
|
|
41350
|
+
static async execute(data, logger, platform) {
|
|
41351
|
+
const isMCP = platform === "mcp" /* MCP */;
|
|
41342
41352
|
try {
|
|
41343
41353
|
const configResult = await ensureConfigReady(logger, data.createConfig);
|
|
41344
41354
|
if (!configResult.ready) {
|
|
@@ -41435,7 +41445,7 @@ class VibeCheckRepository {
|
|
|
41435
41445
|
}
|
|
41436
41446
|
const { allIssues, hasErrors } = this.processCheckResults(allResults, performanceTimings);
|
|
41437
41447
|
const sortedIssues = this.sortIssues(allIssues);
|
|
41438
|
-
const response = this.buildResponse(sortedIssues, effectiveData.limit, effectiveData.page, effectiveData.maxFilesInSummary);
|
|
41448
|
+
const response = this.buildResponse(sortedIssues, effectiveData.limit, effectiveData.page, effectiveData.maxFilesInSummary, isMCP);
|
|
41439
41449
|
logger.debug("[Vibe Check] Response summary", {
|
|
41440
41450
|
totalIssues: response.issues.summary.totalIssues,
|
|
41441
41451
|
totalFiles: response.issues.summary.totalFiles,
|
|
@@ -41521,23 +41531,26 @@ class VibeCheckRepository {
|
|
|
41521
41531
|
return severityA - severityB;
|
|
41522
41532
|
});
|
|
41523
41533
|
}
|
|
41524
|
-
static buildResponse(allIssues, limit, page, maxFilesInSummary) {
|
|
41534
|
+
static buildResponse(allIssues, limit, page, maxFilesInSummary, skipFiles = false) {
|
|
41525
41535
|
const totalIssues = allIssues.length;
|
|
41526
41536
|
const totalFiles = new Set(allIssues.map((issue2) => issue2.file)).size;
|
|
41527
41537
|
const totalErrors = allIssues.filter((issue2) => issue2.severity === "error").length;
|
|
41528
|
-
const fileStats = this.buildFileStats(allIssues);
|
|
41529
|
-
const allFiles = this.formatFileStats(fileStats);
|
|
41530
|
-
const limitedFiles = allFiles.slice(0, maxFilesInSummary);
|
|
41531
41538
|
const totalPages = Math.ceil(totalIssues / limit);
|
|
41532
41539
|
const startIndex = (page - 1) * limit;
|
|
41533
41540
|
const endIndex = startIndex + limit;
|
|
41534
41541
|
const limitedIssues = allIssues.slice(startIndex, endIndex);
|
|
41535
41542
|
const displayedIssues = limitedIssues.length;
|
|
41536
41543
|
const displayedFiles = new Set(limitedIssues.map((issue2) => issue2.file)).size;
|
|
41544
|
+
let files;
|
|
41545
|
+
if (!skipFiles) {
|
|
41546
|
+
const fileStats = this.buildFileStats(allIssues);
|
|
41547
|
+
const allFiles = this.formatFileStats(fileStats);
|
|
41548
|
+
files = allFiles.slice(0, maxFilesInSummary);
|
|
41549
|
+
}
|
|
41537
41550
|
return {
|
|
41538
41551
|
issues: {
|
|
41539
41552
|
items: limitedIssues,
|
|
41540
|
-
files
|
|
41553
|
+
files,
|
|
41541
41554
|
summary: {
|
|
41542
41555
|
totalIssues,
|
|
41543
41556
|
totalFiles,
|
|
@@ -41583,6 +41596,7 @@ var init_repository6 = __esm(() => {
|
|
|
41583
41596
|
init_server_only();
|
|
41584
41597
|
init_response_schema();
|
|
41585
41598
|
init_utils();
|
|
41599
|
+
init_platform();
|
|
41586
41600
|
init_env2();
|
|
41587
41601
|
init_repository2();
|
|
41588
41602
|
init_repository3();
|
|
@@ -41606,8 +41620,8 @@ var init_route2 = __esm(() => {
|
|
|
41606
41620
|
({ POST: POST21, tools: tools2 } = endpointsHandler({
|
|
41607
41621
|
endpoint: definition_default3,
|
|
41608
41622
|
["POST" /* POST */]: {
|
|
41609
|
-
handler: ({ data, logger }) => {
|
|
41610
|
-
return VibeCheckRepository.execute(data, logger);
|
|
41623
|
+
handler: ({ data, logger, platform }) => {
|
|
41624
|
+
return VibeCheckRepository.execute(data, logger, platform);
|
|
41611
41625
|
}
|
|
41612
41626
|
}
|
|
41613
41627
|
}));
|
|
@@ -41706,6 +41720,59 @@ function endpointToToolName(endpoint) {
|
|
|
41706
41720
|
var PATH_SEPARATOR = "_";
|
|
41707
41721
|
|
|
41708
41722
|
// src/app/api/[locale]/system/unified-interface/shared/widgets/utils/field-helpers.ts
|
|
41723
|
+
var exports_field_helpers = {};
|
|
41724
|
+
__export(exports_field_helpers, {
|
|
41725
|
+
isResponseField: () => isResponseField,
|
|
41726
|
+
isRequestField: () => isRequestField,
|
|
41727
|
+
isFormInputField: () => isFormInputField,
|
|
41728
|
+
isFieldRequired: () => isFieldRequired,
|
|
41729
|
+
getTranslatorFromEndpoint: () => getTranslatorFromEndpoint,
|
|
41730
|
+
getTranslator: () => getTranslator,
|
|
41731
|
+
getFieldPlaceholder: () => getFieldPlaceholder,
|
|
41732
|
+
getFieldName: () => getFieldName
|
|
41733
|
+
});
|
|
41734
|
+
function isRequestField(field) {
|
|
41735
|
+
if ("usage" in field && field.usage && typeof field.usage === "object") {
|
|
41736
|
+
return "request" in field.usage && field.usage.request !== undefined;
|
|
41737
|
+
}
|
|
41738
|
+
return false;
|
|
41739
|
+
}
|
|
41740
|
+
function isFormInputField(field) {
|
|
41741
|
+
if (field.ui?.type !== "form_field" /* FORM_FIELD */) {
|
|
41742
|
+
return false;
|
|
41743
|
+
}
|
|
41744
|
+
return isRequestField(field);
|
|
41745
|
+
}
|
|
41746
|
+
function isResponseField(field) {
|
|
41747
|
+
if ("usage" in field && field.usage && typeof field.usage === "object") {
|
|
41748
|
+
return "response" in field.usage && field.usage.response === true;
|
|
41749
|
+
}
|
|
41750
|
+
return false;
|
|
41751
|
+
}
|
|
41752
|
+
function getFieldName(field) {
|
|
41753
|
+
if ("name" in field && typeof field.name === "string") {
|
|
41754
|
+
return field.name;
|
|
41755
|
+
}
|
|
41756
|
+
if ("apiKey" in field && typeof field.apiKey === "string") {
|
|
41757
|
+
return field.apiKey;
|
|
41758
|
+
}
|
|
41759
|
+
if ("uiKey" in field && typeof field.uiKey === "string") {
|
|
41760
|
+
return field.uiKey;
|
|
41761
|
+
}
|
|
41762
|
+
return "value";
|
|
41763
|
+
}
|
|
41764
|
+
function getFieldPlaceholder(field) {
|
|
41765
|
+
if ("ui" in field && field.ui && typeof field.ui === "object" && "placeholder" in field.ui && typeof field.ui.placeholder === "string") {
|
|
41766
|
+
return field.ui.placeholder;
|
|
41767
|
+
}
|
|
41768
|
+
return;
|
|
41769
|
+
}
|
|
41770
|
+
function isFieldRequired(field) {
|
|
41771
|
+
if ("required" in field && typeof field.required === "boolean") {
|
|
41772
|
+
return field.required;
|
|
41773
|
+
}
|
|
41774
|
+
return false;
|
|
41775
|
+
}
|
|
41709
41776
|
function getTranslator(context) {
|
|
41710
41777
|
if (context.scopedT) {
|
|
41711
41778
|
return context.scopedT(context.locale);
|
|
@@ -41858,7 +41925,7 @@ var init_registry2 = __esm(() => {
|
|
|
41858
41925
|
// src/app/api/[locale]/system/help/list/repository.ts
|
|
41859
41926
|
class HelpListRepository {
|
|
41860
41927
|
execute(data, user, locale, logger, platform) {
|
|
41861
|
-
logger.
|
|
41928
|
+
logger.debug("Discovering available commands");
|
|
41862
41929
|
try {
|
|
41863
41930
|
const endpoints11 = definitionsRegistry.getEndpointsForUser(platform, user, logger);
|
|
41864
41931
|
const sortedEndpoints = endpoints11.toSorted((a, b) => {
|
|
@@ -41874,18 +41941,18 @@ class HelpListRepository {
|
|
|
41874
41941
|
});
|
|
41875
41942
|
const formattedCommands = sortedEndpoints.map((ep) => {
|
|
41876
41943
|
const { t } = getTranslatorFromEndpoint(ep)(locale);
|
|
41877
|
-
const
|
|
41878
|
-
const translatedDescription = data.showDescriptions && ep.description ? t(ep.description) :
|
|
41944
|
+
const displayName = ep.aliases && ep.aliases.length > 0 ? ep.aliases[0] : ep.path.join("_");
|
|
41945
|
+
const translatedDescription = data.showDescriptions && ep.description ? t(ep.description) : displayName;
|
|
41879
41946
|
return {
|
|
41880
|
-
alias:
|
|
41947
|
+
alias: displayName,
|
|
41881
41948
|
message: translatedDescription,
|
|
41882
41949
|
description: data.showDescriptions && ep.description ? translatedDescription : undefined,
|
|
41883
41950
|
category: ep.category ? t(ep.category) : "",
|
|
41884
|
-
aliases: data.showAliases && ep.aliases ? ep.aliases.join(", ") : undefined,
|
|
41885
|
-
rule:
|
|
41951
|
+
aliases: data.showAliases && ep.aliases && ep.aliases.length > 1 ? ep.aliases.slice(1).join(", ") : undefined,
|
|
41952
|
+
rule: displayName
|
|
41886
41953
|
};
|
|
41887
41954
|
});
|
|
41888
|
-
logger.
|
|
41955
|
+
logger.debug("Command discovery completed", {
|
|
41889
41956
|
totalCommands: formattedCommands.length,
|
|
41890
41957
|
filteredBy: data.category || "none"
|
|
41891
41958
|
});
|
|
@@ -42834,8 +42901,8 @@ var init_route5 = __esm(() => {
|
|
|
42834
42901
|
|
|
42835
42902
|
// src/app/api/[locale]/system/help/repository.ts
|
|
42836
42903
|
class HelpRepository {
|
|
42837
|
-
execute(data, user, logger, platform) {
|
|
42838
|
-
logger.
|
|
42904
|
+
execute(data, user, logger, platform, locale) {
|
|
42905
|
+
logger.debug("Generating help information", {
|
|
42839
42906
|
command: data.command || "all"
|
|
42840
42907
|
});
|
|
42841
42908
|
try {
|
|
@@ -42853,11 +42920,11 @@ class HelpRepository {
|
|
|
42853
42920
|
});
|
|
42854
42921
|
}
|
|
42855
42922
|
const response2 = this.formatCommandHelp(command);
|
|
42856
|
-
logger.
|
|
42923
|
+
logger.debug("Command help generated successfully");
|
|
42857
42924
|
return success2(response2);
|
|
42858
42925
|
}
|
|
42859
|
-
const response = this.formatGeneralHelp();
|
|
42860
|
-
logger.
|
|
42926
|
+
const response = this.formatGeneralHelp(commands, locale);
|
|
42927
|
+
logger.debug("General help generated successfully");
|
|
42861
42928
|
return success2(response);
|
|
42862
42929
|
} catch (error46) {
|
|
42863
42930
|
const parsedError = parseError(error46);
|
|
@@ -42922,26 +42989,50 @@ class HelpRepository {
|
|
|
42922
42989
|
}
|
|
42923
42990
|
};
|
|
42924
42991
|
}
|
|
42925
|
-
formatGeneralHelp() {
|
|
42992
|
+
formatGeneralHelp(commands, locale) {
|
|
42993
|
+
const getDisplayName = (cmd) => cmd.aliases && cmd.aliases.length > 0 ? cmd.aliases[0] : endpointToToolName(cmd);
|
|
42994
|
+
const priorityCommands = ["check", "list", "help", "builder"];
|
|
42995
|
+
const sortedCommands = commands.toSorted((a, b) => {
|
|
42996
|
+
const aName = getDisplayName(a);
|
|
42997
|
+
const bName = getDisplayName(b);
|
|
42998
|
+
const aPriority = priorityCommands.indexOf(aName);
|
|
42999
|
+
const bPriority = priorityCommands.indexOf(bName);
|
|
43000
|
+
if (aPriority !== -1 && bPriority !== -1) {
|
|
43001
|
+
return aPriority - bPriority;
|
|
43002
|
+
}
|
|
43003
|
+
if (aPriority !== -1) {
|
|
43004
|
+
return -1;
|
|
43005
|
+
}
|
|
43006
|
+
if (bPriority !== -1) {
|
|
43007
|
+
return 1;
|
|
43008
|
+
}
|
|
43009
|
+
return aName.localeCompare(bName);
|
|
43010
|
+
});
|
|
43011
|
+
const commonCommands = sortedCommands.slice(0, 5).map((cmd) => {
|
|
43012
|
+
const { t } = getTranslatorFromEndpoint(cmd)(locale);
|
|
43013
|
+
return {
|
|
43014
|
+
command: getDisplayName(cmd),
|
|
43015
|
+
description: cmd.description ? t(cmd.description) : "No description available"
|
|
43016
|
+
};
|
|
43017
|
+
});
|
|
43018
|
+
const exampleCommands = sortedCommands.slice(0, 3).map((cmd) => {
|
|
43019
|
+
const { t } = getTranslatorFromEndpoint(cmd)(locale);
|
|
43020
|
+
const displayName = getDisplayName(cmd);
|
|
43021
|
+
return {
|
|
43022
|
+
command: `vibe ${displayName}`,
|
|
43023
|
+
description: cmd.description ? t(cmd.description) : `Run ${displayName}`
|
|
43024
|
+
};
|
|
43025
|
+
});
|
|
42926
43026
|
return {
|
|
42927
43027
|
header: {
|
|
42928
|
-
title: "Vibe CLI -
|
|
42929
|
-
description: "
|
|
43028
|
+
title: "Vibe CLI - Code Quality & Build Tool",
|
|
43029
|
+
description: "Fast, parallel code quality checks (Oxlint + ESLint + TypeScript) and build tooling for TypeScript/React projects"
|
|
42930
43030
|
},
|
|
42931
43031
|
usage: {
|
|
42932
43032
|
patterns: ["vibe <command> [options]", "vibe <command> --help"]
|
|
42933
43033
|
},
|
|
42934
43034
|
commonCommands: {
|
|
42935
|
-
items:
|
|
42936
|
-
{ command: "list", description: "List all available commands" },
|
|
42937
|
-
{
|
|
42938
|
-
command: "help <cmd>",
|
|
42939
|
-
description: "Show help for a specific command"
|
|
42940
|
-
},
|
|
42941
|
-
{ command: "check", description: "Run code quality checks" },
|
|
42942
|
-
{ command: "db:migrate", description: "Run database migrations" },
|
|
42943
|
-
{ command: "test", description: "Run test suite" }
|
|
42944
|
-
]
|
|
43035
|
+
items: commonCommands
|
|
42945
43036
|
},
|
|
42946
43037
|
details: {},
|
|
42947
43038
|
options: {
|
|
@@ -42969,12 +43060,7 @@ class HelpRepository {
|
|
|
42969
43060
|
]
|
|
42970
43061
|
},
|
|
42971
43062
|
examples: {
|
|
42972
|
-
items:
|
|
42973
|
-
{ command: "vibe list", description: "List all commands" },
|
|
42974
|
-
{ command: "vibe check src/", description: "Run checks" },
|
|
42975
|
-
{ command: "vibe db:migrate", description: "Run migrations" },
|
|
42976
|
-
{ command: "vibe help check", description: "Get command help" }
|
|
42977
|
-
]
|
|
43063
|
+
items: exampleCommands
|
|
42978
43064
|
}
|
|
42979
43065
|
};
|
|
42980
43066
|
}
|
|
@@ -42984,6 +43070,7 @@ var init_repository12 = __esm(() => {
|
|
|
42984
43070
|
init_response_schema();
|
|
42985
43071
|
init_utils();
|
|
42986
43072
|
init_registry2();
|
|
43073
|
+
init_field_helpers();
|
|
42987
43074
|
helpRepository = new HelpRepository;
|
|
42988
43075
|
});
|
|
42989
43076
|
|
|
@@ -43003,8 +43090,8 @@ var init_route6 = __esm(() => {
|
|
|
43003
43090
|
({ POST: POST25, tools: tools6 } = endpointsHandler({
|
|
43004
43091
|
endpoint: definition_default7,
|
|
43005
43092
|
["POST" /* POST */]: {
|
|
43006
|
-
handler: ({ data, user, logger, platform }) => {
|
|
43007
|
-
return helpRepository.execute(data, user, logger, platform);
|
|
43093
|
+
handler: ({ data, user, logger, platform, locale }) => {
|
|
43094
|
+
return helpRepository.execute(data, user, logger, platform, locale);
|
|
43008
43095
|
}
|
|
43009
43096
|
}
|
|
43010
43097
|
}));
|
|
@@ -45582,18 +45669,21 @@ class InteractiveRepositoryImpl {
|
|
|
45582
45669
|
});
|
|
45583
45670
|
}
|
|
45584
45671
|
try {
|
|
45585
|
-
this.logger = logger;
|
|
45586
45672
|
this.initializeDefaultSession(locale, user, platform);
|
|
45587
45673
|
this.setupSignalHandlers();
|
|
45588
45674
|
const { t } = simpleT(this.getSession().locale);
|
|
45589
|
-
|
|
45590
|
-
|
|
45591
|
-
|
|
45675
|
+
logger.info(`
|
|
45676
|
+
${"\u2550".repeat(60)}`);
|
|
45677
|
+
logger.info(` ${t("app.api.system.unifiedInterface.cli.vibe.interactive.welcome")}`);
|
|
45678
|
+
logger.info("\u2550".repeat(60));
|
|
45679
|
+
logger.info(` ${t("app.api.system.unifiedInterface.cli.vibe.help.description")}`);
|
|
45680
|
+
logger.info(`${"\u2550".repeat(60)}
|
|
45681
|
+
`);
|
|
45592
45682
|
const discoveredEndpoints = definitionsRegistry.getEndpointsForUser(platform, user, logger);
|
|
45593
45683
|
this.buildRouteTree(discoveredEndpoints);
|
|
45594
45684
|
this.currentNode = this.routeTree;
|
|
45595
45685
|
this.updateBreadcrumbs();
|
|
45596
|
-
await this.navigationLoop();
|
|
45686
|
+
await this.navigationLoop(logger);
|
|
45597
45687
|
return success2({ started: true });
|
|
45598
45688
|
} catch (error46) {
|
|
45599
45689
|
logger.error("Failed to start interactive mode", parseError(error46));
|
|
@@ -45711,18 +45801,19 @@ class InteractiveRepositoryImpl {
|
|
|
45711
45801
|
current = current.parent || null;
|
|
45712
45802
|
}
|
|
45713
45803
|
}
|
|
45714
|
-
async showNavigationMenu() {
|
|
45804
|
+
async showNavigationMenu(logger) {
|
|
45715
45805
|
if (!this.currentNode) {
|
|
45716
45806
|
return "exit";
|
|
45717
45807
|
}
|
|
45718
45808
|
const { t } = simpleT(this.getSession().locale);
|
|
45719
45809
|
const breadcrumbPath = this.breadcrumbs.map((b) => b.name).join(" > ");
|
|
45720
|
-
|
|
45810
|
+
logger.info(`
|
|
45811
|
+
${t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.directoryIcon")} ${breadcrumbPath}`);
|
|
45721
45812
|
const choices = [];
|
|
45722
45813
|
if (this.currentNode.parent) {
|
|
45723
45814
|
const upIcon = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.upIcon");
|
|
45724
45815
|
const goUpText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.goUp");
|
|
45725
|
-
const upName = `${upIcon}
|
|
45816
|
+
const upName = `${upIcon} ${goUpText}`;
|
|
45726
45817
|
choices.push({
|
|
45727
45818
|
name: upName,
|
|
45728
45819
|
value: InteractiveRepositoryImpl.UP_ACTION
|
|
@@ -45742,18 +45833,29 @@ class InteractiveRepositoryImpl {
|
|
|
45742
45833
|
value: InteractiveRepositoryImpl.NAV_PREFIX + child.path
|
|
45743
45834
|
});
|
|
45744
45835
|
} else if (child.type === "route" && child.route) {
|
|
45745
|
-
const
|
|
45746
|
-
const
|
|
45836
|
+
const route = child.route;
|
|
45837
|
+
const { t: routeT } = this.getTranslatorForRoute(route);
|
|
45838
|
+
const description = route.description ? routeT(route.description) : noDescriptionText;
|
|
45839
|
+
const displayName = route.aliases && route.aliases.length > 0 ? route.aliases[0] : child.name;
|
|
45840
|
+
const additionalAliases = route.aliases && route.aliases.length > 1 ? ` [${route.aliases.slice(1).join(", ")}]` : "";
|
|
45841
|
+
const routeName = `${routeIcon} ${displayName}${additionalAliases} - ${description}`;
|
|
45747
45842
|
choices.push({
|
|
45748
45843
|
name: routeName,
|
|
45749
|
-
value: InteractiveRepositoryImpl.EXEC_PREFIX +
|
|
45844
|
+
value: InteractiveRepositoryImpl.EXEC_PREFIX + route.path
|
|
45750
45845
|
});
|
|
45751
45846
|
}
|
|
45752
45847
|
}
|
|
45753
45848
|
}
|
|
45754
45849
|
if (choices.length > 0) {
|
|
45755
|
-
choices.push({
|
|
45850
|
+
choices.push({
|
|
45851
|
+
name: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
45852
|
+
value: "separator"
|
|
45853
|
+
});
|
|
45756
45854
|
}
|
|
45855
|
+
choices.push({
|
|
45856
|
+
name: `\uD83D\uDCCB ${t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.viewAllRoutes")}`,
|
|
45857
|
+
value: "view_all"
|
|
45858
|
+
});
|
|
45757
45859
|
const settingsIcon = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.settingsIcon");
|
|
45758
45860
|
const settingsText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.settings");
|
|
45759
45861
|
const exitIcon = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.exitIcon");
|
|
@@ -45769,10 +45871,88 @@ class InteractiveRepositoryImpl {
|
|
|
45769
45871
|
const action = await dist_default5({
|
|
45770
45872
|
message: navigateMessage,
|
|
45771
45873
|
choices,
|
|
45772
|
-
pageSize:
|
|
45874
|
+
pageSize: 20
|
|
45875
|
+
});
|
|
45876
|
+
return action;
|
|
45877
|
+
}
|
|
45878
|
+
getTranslatorForRoute(route) {
|
|
45879
|
+
const {
|
|
45880
|
+
getTranslatorFromEndpoint: getTranslatorFromEndpoint2
|
|
45881
|
+
} = (init_field_helpers(), __toCommonJS(exports_field_helpers));
|
|
45882
|
+
return getTranslatorFromEndpoint2(route)(this.getSession().locale);
|
|
45883
|
+
}
|
|
45884
|
+
async showAllRoutesMenu() {
|
|
45885
|
+
const { t } = simpleT(this.getSession().locale);
|
|
45886
|
+
const allRoutes = this.getAllRoutes(this.routeTree);
|
|
45887
|
+
const routesByCategory = new Map;
|
|
45888
|
+
for (const route of allRoutes) {
|
|
45889
|
+
const category = route.category || "Other";
|
|
45890
|
+
if (!routesByCategory.has(category)) {
|
|
45891
|
+
routesByCategory.set(category, []);
|
|
45892
|
+
}
|
|
45893
|
+
routesByCategory.get(category)?.push(route);
|
|
45894
|
+
}
|
|
45895
|
+
const sortedCategories = [...routesByCategory.keys()].toSorted();
|
|
45896
|
+
const choices = [];
|
|
45897
|
+
for (const category of sortedCategories) {
|
|
45898
|
+
const routes = routesByCategory.get(category) || [];
|
|
45899
|
+
let translatedCategory = category;
|
|
45900
|
+
if (routes.length > 0 && category && category !== "Other") {
|
|
45901
|
+
const { t: categoryT } = this.getTranslatorForRoute(routes[0]);
|
|
45902
|
+
translatedCategory = categoryT(category);
|
|
45903
|
+
}
|
|
45904
|
+
choices.push({
|
|
45905
|
+
name: `
|
|
45906
|
+
\u2501\u2501 ${translatedCategory} \u2501\u2501`,
|
|
45907
|
+
value: "separator"
|
|
45908
|
+
});
|
|
45909
|
+
const sortedRoutes = routes.toSorted((a, b) => {
|
|
45910
|
+
const nameA = a.aliases && a.aliases.length > 0 ? a.aliases[0] : endpointToToolName(a);
|
|
45911
|
+
const nameB = b.aliases && b.aliases.length > 0 ? b.aliases[0] : endpointToToolName(b);
|
|
45912
|
+
return nameA.localeCompare(nameB);
|
|
45913
|
+
});
|
|
45914
|
+
for (const route of sortedRoutes) {
|
|
45915
|
+
const { t: routeT } = this.getTranslatorForRoute(route);
|
|
45916
|
+
const displayName = route.aliases && route.aliases.length > 0 ? route.aliases[0] : endpointToToolName(route);
|
|
45917
|
+
const description = route.description ? routeT(route.description) : "";
|
|
45918
|
+
const additionalAliases = route.aliases && route.aliases.length > 1 ? ` [${route.aliases.slice(1).join(", ")}]` : "";
|
|
45919
|
+
choices.push({
|
|
45920
|
+
name: ` \uD83D\uDD27 ${displayName.padEnd(20)}${additionalAliases} ${description}`,
|
|
45921
|
+
value: InteractiveRepositoryImpl.EXEC_PREFIX + route.path
|
|
45922
|
+
});
|
|
45923
|
+
}
|
|
45924
|
+
}
|
|
45925
|
+
choices.push({
|
|
45926
|
+
name: `
|
|
45927
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
45928
|
+
value: "separator"
|
|
45929
|
+
});
|
|
45930
|
+
choices.push({
|
|
45931
|
+
name: `\u2B05\uFE0F ${t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.backToNavigation")}`,
|
|
45932
|
+
value: "back"
|
|
45933
|
+
});
|
|
45934
|
+
const action = await dist_default5({
|
|
45935
|
+
message: t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.selectRoute"),
|
|
45936
|
+
choices,
|
|
45937
|
+
pageSize: 20
|
|
45773
45938
|
});
|
|
45774
45939
|
return action;
|
|
45775
45940
|
}
|
|
45941
|
+
getAllRoutes(node) {
|
|
45942
|
+
if (!node) {
|
|
45943
|
+
return [];
|
|
45944
|
+
}
|
|
45945
|
+
const routes = [];
|
|
45946
|
+
if (node.type === "route" && node.route) {
|
|
45947
|
+
routes.push(node.route);
|
|
45948
|
+
}
|
|
45949
|
+
if (node.children) {
|
|
45950
|
+
for (const child of node.children) {
|
|
45951
|
+
routes.push(...this.getAllRoutes(child));
|
|
45952
|
+
}
|
|
45953
|
+
}
|
|
45954
|
+
return routes;
|
|
45955
|
+
}
|
|
45776
45956
|
countRoutesInDirectory(node) {
|
|
45777
45957
|
let count = 0;
|
|
45778
45958
|
if (node.type === "route") {
|
|
@@ -45815,13 +45995,13 @@ class InteractiveRepositoryImpl {
|
|
|
45815
45995
|
}
|
|
45816
45996
|
return null;
|
|
45817
45997
|
}
|
|
45818
|
-
async executeRouteByPath(routePath) {
|
|
45998
|
+
async executeRouteByPath(routePath, logger) {
|
|
45819
45999
|
if (!this.routeTree) {
|
|
45820
46000
|
return;
|
|
45821
46001
|
}
|
|
45822
46002
|
const route = this.findRouteByPath(this.routeTree, routePath);
|
|
45823
46003
|
if (route) {
|
|
45824
|
-
await this.executeRouteWithDataDrivenUI(route);
|
|
46004
|
+
await this.executeRouteWithDataDrivenUI(route, logger);
|
|
45825
46005
|
}
|
|
45826
46006
|
}
|
|
45827
46007
|
findRouteByPath(node, path) {
|
|
@@ -45842,7 +46022,7 @@ class InteractiveRepositoryImpl {
|
|
|
45842
46022
|
}
|
|
45843
46023
|
return null;
|
|
45844
46024
|
}
|
|
45845
|
-
async executeRouteWithDataDrivenUI(route) {
|
|
46025
|
+
async executeRouteWithDataDrivenUI(route, logger) {
|
|
45846
46026
|
const { t } = simpleT(this.getSession().locale);
|
|
45847
46027
|
const executingText = t("app.api.system.unifiedInterface.cli.vibe.executing");
|
|
45848
46028
|
const routeText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.route");
|
|
@@ -45851,24 +46031,31 @@ class InteractiveRepositoryImpl {
|
|
|
45851
46031
|
const pathArray = route.path;
|
|
45852
46032
|
const routePath = Array.isArray(pathArray) ? pathArray.join("/") : pathArray;
|
|
45853
46033
|
const alias = route.aliases && route.aliases.length > 0 ? route.aliases[0] : undefined;
|
|
45854
|
-
|
|
45855
|
-
|
|
45856
|
-
|
|
46034
|
+
logger.info(`
|
|
46035
|
+
${"\u2500".repeat(60)}`);
|
|
46036
|
+
logger.info(` \uD83D\uDE80 ${executingText}: ${alias || routePath}`);
|
|
46037
|
+
logger.info("\u2500".repeat(60));
|
|
46038
|
+
logger.info(` ${routeText}: ${routePath}`);
|
|
46039
|
+
logger.info(` ${methodText}: ${route.method}`);
|
|
45857
46040
|
if (route.description) {
|
|
45858
|
-
this.
|
|
46041
|
+
const { t: routeT } = this.getTranslatorForRoute(route);
|
|
46042
|
+
const translatedDescription = routeT(route.description);
|
|
46043
|
+
logger.info(` ${descriptionText}: ${translatedDescription}`);
|
|
45859
46044
|
}
|
|
46045
|
+
logger.info(`${"\u2500".repeat(60)}
|
|
46046
|
+
`);
|
|
45860
46047
|
try {
|
|
45861
|
-
const endpoint = await this.getCreateApiEndpoint(route);
|
|
46048
|
+
const endpoint = await this.getCreateApiEndpoint(route, logger);
|
|
45862
46049
|
if (!endpoint) {
|
|
45863
46050
|
const noDefinitionText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.noDefinition");
|
|
45864
|
-
|
|
45865
|
-
await this.executeRouteBasic(route);
|
|
46051
|
+
logger.warn(noDefinitionText);
|
|
46052
|
+
await this.executeRouteBasic(route, logger);
|
|
45866
46053
|
return;
|
|
45867
46054
|
}
|
|
45868
|
-
await this.generateDataDrivenForm(route,
|
|
46055
|
+
await this.generateDataDrivenForm(route, logger);
|
|
45869
46056
|
} catch (error46) {
|
|
45870
46057
|
const executionFailedText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.executionFailed");
|
|
45871
|
-
|
|
46058
|
+
logger.error(executionFailedText, parseError(error46));
|
|
45872
46059
|
}
|
|
45873
46060
|
const executeAnotherText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.executeAnother");
|
|
45874
46061
|
const shouldContinue = await dist_default3({
|
|
@@ -45897,13 +46084,13 @@ class InteractiveRepositoryImpl {
|
|
|
45897
46084
|
});
|
|
45898
46085
|
return locale;
|
|
45899
46086
|
}
|
|
45900
|
-
async generateDataDrivenForm(
|
|
45901
|
-
const routePath =
|
|
45902
|
-
const alias =
|
|
46087
|
+
async generateDataDrivenForm(endpoint, logger) {
|
|
46088
|
+
const routePath = endpoint.path.join("/");
|
|
46089
|
+
const alias = endpoint.aliases && endpoint.aliases.length > 0 ? endpoint.aliases[0] : undefined;
|
|
45903
46090
|
const title = endpoint.title || alias || routePath;
|
|
45904
|
-
|
|
46091
|
+
logger.info(title);
|
|
45905
46092
|
if (endpoint.description) {
|
|
45906
|
-
|
|
46093
|
+
logger.info(endpoint.description);
|
|
45907
46094
|
}
|
|
45908
46095
|
const selectedLocale = await this.collectLocaleSelection();
|
|
45909
46096
|
this.getSession().locale = selectedLocale;
|
|
@@ -45911,27 +46098,39 @@ class InteractiveRepositoryImpl {
|
|
|
45911
46098
|
let requestData = {};
|
|
45912
46099
|
if (endpoint.requestSchema && !this.isEmptySchema(endpoint.requestSchema)) {
|
|
45913
46100
|
const requestDataText = tSelected("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.requestData");
|
|
45914
|
-
|
|
45915
|
-
|
|
46101
|
+
logger.info(`
|
|
46102
|
+
\uD83D\uDCDD ${requestDataText}`);
|
|
46103
|
+
logger.info("\u2500".repeat(60));
|
|
46104
|
+
requestData = await this.generateFormFromSchema(endpoint.requestSchema, requestDataText, logger);
|
|
45916
46105
|
}
|
|
45917
46106
|
let urlPathParams = {};
|
|
45918
46107
|
if (endpoint.requestUrlPathParamsSchema && !this.isEmptySchema(endpoint.requestUrlPathParamsSchema)) {
|
|
45919
46108
|
const urlParametersText = tSelected("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.urlParameters");
|
|
45920
|
-
|
|
45921
|
-
|
|
46109
|
+
logger.info(`
|
|
46110
|
+
\uD83D\uDD17 ${urlParametersText}`);
|
|
46111
|
+
logger.info("\u2500".repeat(60));
|
|
46112
|
+
urlPathParams = await this.generateFormFromSchema(endpoint.requestUrlPathParamsSchema, urlParametersText, logger);
|
|
45922
46113
|
}
|
|
45923
46114
|
if (Object.keys(requestData).length > 0 || Object.keys(urlPathParams).length > 0) {
|
|
45924
46115
|
const previewText = tSelected("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.preview");
|
|
45925
46116
|
const requestDataText = tSelected("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.requestData");
|
|
45926
46117
|
const urlParametersText = tSelected("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.urlParameters");
|
|
45927
46118
|
const executeWithParamsText = tSelected("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.executeWithParams");
|
|
45928
|
-
|
|
46119
|
+
logger.info(`
|
|
46120
|
+
${"\u2550".repeat(60)}`);
|
|
46121
|
+
logger.info(` \uD83D\uDC40 ${previewText}`);
|
|
46122
|
+
logger.info("\u2550".repeat(60));
|
|
45929
46123
|
if (Object.keys(requestData).length > 0) {
|
|
45930
|
-
|
|
46124
|
+
logger.info(`
|
|
46125
|
+
${requestDataText}:`);
|
|
46126
|
+
logger.info(JSON.stringify(requestData, null, 2));
|
|
45931
46127
|
}
|
|
45932
46128
|
if (Object.keys(urlPathParams).length > 0) {
|
|
45933
|
-
|
|
46129
|
+
logger.info(`
|
|
46130
|
+
${urlParametersText}:`);
|
|
46131
|
+
logger.info(JSON.stringify(urlPathParams, null, 2));
|
|
45934
46132
|
}
|
|
46133
|
+
logger.info("");
|
|
45935
46134
|
const shouldExecute = await dist_default3({
|
|
45936
46135
|
message: executeWithParamsText,
|
|
45937
46136
|
default: true
|
|
@@ -45940,9 +46139,9 @@ class InteractiveRepositoryImpl {
|
|
|
45940
46139
|
return;
|
|
45941
46140
|
}
|
|
45942
46141
|
}
|
|
45943
|
-
await this.executeRouteWithData(
|
|
46142
|
+
await this.executeRouteWithData(endpoint, requestData, urlPathParams, logger);
|
|
45944
46143
|
}
|
|
45945
|
-
async generateFormFromSchema(schema, title) {
|
|
46144
|
+
async generateFormFromSchema(schema, title, logger) {
|
|
45946
46145
|
try {
|
|
45947
46146
|
const fields = schemaUIHandler.parseSchema(schema);
|
|
45948
46147
|
const config3 = {
|
|
@@ -45952,7 +46151,7 @@ class InteractiveRepositoryImpl {
|
|
|
45952
46151
|
const result = await schemaUIHandler.generateForm(config3);
|
|
45953
46152
|
return result;
|
|
45954
46153
|
} catch (error46) {
|
|
45955
|
-
|
|
46154
|
+
logger.warn(`Failed to generate form for ${title}`, {
|
|
45956
46155
|
errorMessage: parseError(error46).message
|
|
45957
46156
|
});
|
|
45958
46157
|
return {};
|
|
@@ -45973,7 +46172,7 @@ class InteractiveRepositoryImpl {
|
|
|
45973
46172
|
}
|
|
45974
46173
|
return false;
|
|
45975
46174
|
}
|
|
45976
|
-
async getCreateApiEndpoint(route) {
|
|
46175
|
+
async getCreateApiEndpoint(route, logger) {
|
|
45977
46176
|
const { definitionLoader: definitionLoader2 } = await Promise.resolve().then(() => (init_loader(), exports_loader));
|
|
45978
46177
|
const routePath = route.path.join("/");
|
|
45979
46178
|
const alias = route.aliases && route.aliases.length > 0 ? route.aliases[0] : undefined;
|
|
@@ -45982,17 +46181,17 @@ class InteractiveRepositoryImpl {
|
|
|
45982
46181
|
identifier: resolvedCommand,
|
|
45983
46182
|
platform: this.session.platform,
|
|
45984
46183
|
user: this.session.user,
|
|
45985
|
-
logger
|
|
46184
|
+
logger
|
|
45986
46185
|
});
|
|
45987
46186
|
if (!result.success) {
|
|
45988
|
-
|
|
46187
|
+
logger.warn(`Failed to load endpoint definition for ${routePath}`, {
|
|
45989
46188
|
error: result.message
|
|
45990
46189
|
});
|
|
45991
46190
|
return null;
|
|
45992
46191
|
}
|
|
45993
46192
|
return result.data;
|
|
45994
46193
|
}
|
|
45995
|
-
async executeRouteWithData(route, requestData, urlPathParams) {
|
|
46194
|
+
async executeRouteWithData(route, requestData, urlPathParams, logger) {
|
|
45996
46195
|
const session = this.getSession();
|
|
45997
46196
|
const toolName = endpointToToolName(route);
|
|
45998
46197
|
const resolvedCommand = route.aliases && route.aliases[0] || toolName;
|
|
@@ -46004,21 +46203,21 @@ class InteractiveRepositoryImpl {
|
|
|
46004
46203
|
locale: session.locale,
|
|
46005
46204
|
timestamp: Date.now(),
|
|
46006
46205
|
options: session.options,
|
|
46007
|
-
logger
|
|
46206
|
+
logger,
|
|
46008
46207
|
platform: session.platform
|
|
46009
46208
|
};
|
|
46010
46209
|
try {
|
|
46011
|
-
const result = await routeDelegationHandler.executeRoute(resolvedCommand, context,
|
|
46012
|
-
const endpointDefinition = await this.getCreateApiEndpoint(route);
|
|
46013
|
-
const formattedResult = routeDelegationHandler.formatResult(result, session.options?.output || "pretty", endpointDefinition, session.locale, session.options?.verbose || false,
|
|
46014
|
-
|
|
46210
|
+
const result = await routeDelegationHandler.executeRoute(resolvedCommand, context, logger, session.locale);
|
|
46211
|
+
const endpointDefinition = await this.getCreateApiEndpoint(route, logger);
|
|
46212
|
+
const formattedResult = routeDelegationHandler.formatResult(result, session.options?.output || "pretty", endpointDefinition, session.locale, session.options?.verbose || false, logger);
|
|
46213
|
+
logger.info(formattedResult);
|
|
46015
46214
|
} catch (error46) {
|
|
46016
46215
|
const { t } = simpleT(session.locale);
|
|
46017
46216
|
const executionFailedText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.executionFailed");
|
|
46018
|
-
|
|
46217
|
+
logger.error(executionFailedText, parseError(error46));
|
|
46019
46218
|
}
|
|
46020
46219
|
}
|
|
46021
|
-
async executeRouteBasic(route) {
|
|
46220
|
+
async executeRouteBasic(route, logger) {
|
|
46022
46221
|
const session = this.getSession();
|
|
46023
46222
|
const toolName = endpointToToolName(route);
|
|
46024
46223
|
const resolvedCommand = route.aliases && route.aliases[0] || toolName;
|
|
@@ -46029,33 +46228,37 @@ class InteractiveRepositoryImpl {
|
|
|
46029
46228
|
locale: session.locale,
|
|
46030
46229
|
timestamp: Date.now(),
|
|
46031
46230
|
options: session.options,
|
|
46032
|
-
logger
|
|
46231
|
+
logger,
|
|
46033
46232
|
platform: session.platform
|
|
46034
46233
|
};
|
|
46035
46234
|
try {
|
|
46036
|
-
const result = await routeDelegationHandler.executeRoute(resolvedCommand, context,
|
|
46037
|
-
const endpointDefinition = await this.getCreateApiEndpoint(route);
|
|
46038
|
-
const formattedResult = routeDelegationHandler.formatResult(result, session.options?.output || "pretty", endpointDefinition, session.locale, session.options?.verbose || false,
|
|
46039
|
-
|
|
46235
|
+
const result = await routeDelegationHandler.executeRoute(resolvedCommand, context, logger, session.locale);
|
|
46236
|
+
const endpointDefinition = await this.getCreateApiEndpoint(route, logger);
|
|
46237
|
+
const formattedResult = routeDelegationHandler.formatResult(result, session.options?.output || "pretty", endpointDefinition, session.locale, session.options?.verbose || false, logger);
|
|
46238
|
+
logger.info(formattedResult);
|
|
46040
46239
|
} catch (error46) {
|
|
46041
46240
|
const { t } = simpleT(session.locale);
|
|
46042
46241
|
const executionFailedText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.executionFailed");
|
|
46043
|
-
|
|
46242
|
+
logger.error(executionFailedText, parseError(error46));
|
|
46044
46243
|
}
|
|
46045
46244
|
}
|
|
46046
|
-
async navigationLoop() {
|
|
46245
|
+
async navigationLoop(logger) {
|
|
46047
46246
|
while (true) {
|
|
46048
46247
|
try {
|
|
46049
|
-
const action = await this.showNavigationMenu();
|
|
46248
|
+
const action = await this.showNavigationMenu(logger);
|
|
46050
46249
|
if (action === InteractiveRepositoryImpl.EXIT_ACTION) {
|
|
46051
46250
|
const { t } = simpleT(this.getSession().locale);
|
|
46052
46251
|
const goodbyeText = t("app.api.system.unifiedInterface.cli.vibe.interactive.goodbye");
|
|
46053
|
-
|
|
46252
|
+
logger.info(`
|
|
46253
|
+
${goodbyeText}
|
|
46254
|
+
`);
|
|
46054
46255
|
break;
|
|
46055
46256
|
} else if (action === "separator") {
|
|
46056
46257
|
continue;
|
|
46258
|
+
} else if (action === "view_all") {
|
|
46259
|
+
await this.handleViewAllRoutes(logger);
|
|
46057
46260
|
} else if (action === InteractiveRepositoryImpl.SETTINGS_ACTION) {
|
|
46058
|
-
await this.showSettingsMenu();
|
|
46261
|
+
await this.showSettingsMenu(logger);
|
|
46059
46262
|
} else if (action === InteractiveRepositoryImpl.UP_ACTION) {
|
|
46060
46263
|
this.navigateUp();
|
|
46061
46264
|
} else if (action.startsWith(InteractiveRepositoryImpl.NAV_PREFIX)) {
|
|
@@ -46063,16 +46266,28 @@ class InteractiveRepositoryImpl {
|
|
|
46063
46266
|
this.navigateToPath(targetPath);
|
|
46064
46267
|
} else if (action.startsWith(InteractiveRepositoryImpl.EXEC_PREFIX)) {
|
|
46065
46268
|
const routePath = action.replace(InteractiveRepositoryImpl.EXEC_PREFIX, "");
|
|
46066
|
-
await this.executeRouteByPath(routePath);
|
|
46269
|
+
await this.executeRouteByPath(routePath, logger);
|
|
46067
46270
|
}
|
|
46068
46271
|
} catch (error46) {
|
|
46069
46272
|
const { t } = simpleT(this.getSession().locale);
|
|
46070
46273
|
const navigationErrorText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.navigationError");
|
|
46071
|
-
|
|
46274
|
+
logger.error(navigationErrorText, parseError(error46));
|
|
46275
|
+
}
|
|
46276
|
+
}
|
|
46277
|
+
}
|
|
46278
|
+
async handleViewAllRoutes(logger) {
|
|
46279
|
+
while (true) {
|
|
46280
|
+
const action = await this.showAllRoutesMenu();
|
|
46281
|
+
if (action === "back" || action === "separator") {
|
|
46282
|
+
break;
|
|
46283
|
+
} else if (action.startsWith(InteractiveRepositoryImpl.EXEC_PREFIX)) {
|
|
46284
|
+
const routePath = action.replace(InteractiveRepositoryImpl.EXEC_PREFIX, "");
|
|
46285
|
+
await this.executeRouteByPath(routePath, logger);
|
|
46286
|
+
break;
|
|
46072
46287
|
}
|
|
46073
46288
|
}
|
|
46074
46289
|
}
|
|
46075
|
-
async showSettingsMenu() {
|
|
46290
|
+
async showSettingsMenu(logger) {
|
|
46076
46291
|
const session = this.getSession();
|
|
46077
46292
|
const { t } = simpleT(session.locale);
|
|
46078
46293
|
const chooseSettingText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.chooseSettingToModify");
|
|
@@ -46101,9 +46316,9 @@ class InteractiveRepositoryImpl {
|
|
|
46101
46316
|
if (setting === "back") {
|
|
46102
46317
|
return;
|
|
46103
46318
|
}
|
|
46104
|
-
await this.updateSetting(setting);
|
|
46319
|
+
await this.updateSetting(setting, logger);
|
|
46105
46320
|
}
|
|
46106
|
-
async updateSetting(setting) {
|
|
46321
|
+
async updateSetting(setting, logger) {
|
|
46107
46322
|
const session = this.getSession();
|
|
46108
46323
|
switch (setting) {
|
|
46109
46324
|
case "output": {
|
|
@@ -46161,7 +46376,7 @@ class InteractiveRepositoryImpl {
|
|
|
46161
46376
|
}
|
|
46162
46377
|
const { t } = simpleT(session.locale);
|
|
46163
46378
|
const settingUpdatedText = t("app.api.system.unifiedInterface.cli.vibe.interactive.navigation.settingUpdated");
|
|
46164
|
-
|
|
46379
|
+
logger.info(settingUpdatedText);
|
|
46165
46380
|
}
|
|
46166
46381
|
}
|
|
46167
46382
|
var interactiveRepository;
|
|
@@ -46842,16 +47057,9 @@ class MCPRegistry {
|
|
|
46842
47057
|
const { t } = simpleT(locale);
|
|
46843
47058
|
const errorMessage = result.message ? t(result.message, result.messageParams) : t("app.api.system.unifiedInterface.mcp.registry.toolExecutionFailed");
|
|
46844
47059
|
const errorDetails = {
|
|
46845
|
-
toolName,
|
|
46846
|
-
|
|
46847
|
-
message: result.message,
|
|
46848
|
-
messageParams: result.messageParams
|
|
47060
|
+
tool: toolName,
|
|
47061
|
+
error: result
|
|
46849
47062
|
};
|
|
46850
|
-
if (result.cause) {
|
|
46851
|
-
errorDetails.cause = result.cause.message;
|
|
46852
|
-
errorDetails.causeType = result.cause.errorType?.errorKey;
|
|
46853
|
-
errorDetails.causeParams = result.cause.messageParams;
|
|
46854
|
-
}
|
|
46855
47063
|
return this.fail({
|
|
46856
47064
|
error: errorMessage,
|
|
46857
47065
|
code: -32002 /* TOOL_EXECUTION_FAILED */,
|
|
@@ -47180,7 +47388,8 @@ class MCPServer {
|
|
|
47180
47388
|
name: "Vibe MCP Server",
|
|
47181
47389
|
version: "1.0.0",
|
|
47182
47390
|
locale,
|
|
47183
|
-
debug: logger.isDebugEnabled
|
|
47391
|
+
debug: logger.isDebugEnabled,
|
|
47392
|
+
projectRoot: process.env.PROJECT_ROOT || process.cwd()
|
|
47184
47393
|
});
|
|
47185
47394
|
const protocolHandler = await createMCPProtocolHandler(logger, locale);
|
|
47186
47395
|
this.transport = new StdioTransport(logger);
|
|
@@ -47253,6 +47462,10 @@ var init_server = __esm(() => {
|
|
|
47253
47462
|
// src/app/api/[locale]/system/unified-interface/mcp/serve/repository.ts
|
|
47254
47463
|
class MCPServeRepository {
|
|
47255
47464
|
async startServer(logger, locale) {
|
|
47465
|
+
logger.info("[MCP] Starting MCP server", {
|
|
47466
|
+
cwd: process.cwd(),
|
|
47467
|
+
projectRoot: process.env.PROJECT_ROOT
|
|
47468
|
+
});
|
|
47256
47469
|
const mcpServer = new MCPServer;
|
|
47257
47470
|
await mcpServer.start(logger, locale);
|
|
47258
47471
|
return success2({
|
|
@@ -54788,13 +55001,13 @@ var init_grouped_list = __esm(() => {
|
|
|
54788
55001
|
parts.push(ruleText);
|
|
54789
55002
|
}
|
|
54790
55003
|
} else {
|
|
55004
|
+
if (item.rule && typeof item.rule === "string" && item.rule !== "unknown") {
|
|
55005
|
+
const commandName = this.styleText(item.rule.padEnd(20), "bold", context);
|
|
55006
|
+
parts.push(commandName);
|
|
55007
|
+
}
|
|
54791
55008
|
if (item.message) {
|
|
54792
55009
|
parts.push(item.message);
|
|
54793
55010
|
}
|
|
54794
|
-
if (item.rule && typeof item.rule === "string" && item.rule !== "unknown") {
|
|
54795
|
-
const ruleText = this.styleText(`[${item.rule}]`, "dim", context);
|
|
54796
|
-
parts.push(ruleText);
|
|
54797
|
-
}
|
|
54798
55011
|
}
|
|
54799
55012
|
return parts.join(" ");
|
|
54800
55013
|
}
|
|
@@ -57232,6 +57445,10 @@ var init_vibe_runtime = __esm(() => {
|
|
|
57232
57445
|
program2.argument("[command]", earlyT("app.api.system.unifiedInterface.cli.vibe.help.usage")).argument("[args...]", earlyT("app.api.system.unifiedInterface.cli.vibe.help.commands")).option("-d, --data <json>", earlyT("app.api.system.unifiedInterface.cli.vibe.executeCommand")).option("-u, --user-type <type>", earlyT("app.api.system.unifiedInterface.cli.vibe.help.userType"), "ADMIN").option("-l, --locale <locale>", earlyT("app.api.system.unifiedInterface.cli.vibe.help.locale"), cliEnv.VIBE_CLI_LOCALE).option("-o, --output <format>", earlyT("app.api.system.unifiedInterface.cli.vibe.output"), CLI_CONSTANTS.DEFAULT_OUTPUT).option("-v, --verbose", earlyT("app.api.system.unifiedInterface.cli.vibe.help.verbose"), false).option("-x, --debug", earlyT("app.api.system.unifiedInterface.cli.vibe.help.verbose"), false).option("-i, --interactive", earlyT("app.api.system.unifiedInterface.cli.vibe.help.interactive"), false).option("--dry-run", earlyT("app.api.system.unifiedInterface.cli.vibe.help.dryRun"), false).allowUnknownOption().action(async (command, args, options, cmd) => {
|
|
57233
57446
|
if (command === "mcp") {
|
|
57234
57447
|
enableMcpSilentMode();
|
|
57448
|
+
const projectRoot2 = process.env.PROJECT_ROOT;
|
|
57449
|
+
if (projectRoot2) {
|
|
57450
|
+
process.chdir(projectRoot2);
|
|
57451
|
+
}
|
|
57235
57452
|
}
|
|
57236
57453
|
const debug = options.debug || options.verbose;
|
|
57237
57454
|
const logger = createEndpointLogger(debug ?? false, Date.now(), options.locale);
|
|
@@ -57254,8 +57471,8 @@ var init_vibe_runtime = __esm(() => {
|
|
|
57254
57471
|
performanceMonitor.mark("initStart");
|
|
57255
57472
|
performanceMonitor.mark("initEnd");
|
|
57256
57473
|
if (!command) {
|
|
57257
|
-
|
|
57258
|
-
await cliEntryPoint.executeCommand("
|
|
57474
|
+
performanceMonitor.mark("routeStart");
|
|
57475
|
+
const helpResult = await cliEntryPoint.executeCommand("help", {
|
|
57259
57476
|
user: undefined,
|
|
57260
57477
|
locale: options.locale,
|
|
57261
57478
|
platform: cliPlatform,
|
|
@@ -57264,6 +57481,14 @@ var init_vibe_runtime = __esm(() => {
|
|
|
57264
57481
|
interactive: options.interactive ?? false,
|
|
57265
57482
|
dryRun: options.dryRun ?? false
|
|
57266
57483
|
}, logger, t, options.locale);
|
|
57484
|
+
performanceMonitor.mark("routeEnd");
|
|
57485
|
+
performanceMonitor.mark("renderStart");
|
|
57486
|
+
if (helpResult.formattedOutput) {
|
|
57487
|
+
process.stdout.write(`${helpResult.formattedOutput}
|
|
57488
|
+
`);
|
|
57489
|
+
}
|
|
57490
|
+
performanceMonitor.mark("renderEnd");
|
|
57491
|
+
await cliResourceManager2.cleanupAndExit(logger, debug ?? false, helpResult);
|
|
57267
57492
|
return;
|
|
57268
57493
|
}
|
|
57269
57494
|
const cmdWithParent = cmd;
|
|
@@ -57325,9 +57550,6 @@ var init_vibe_runtime = __esm(() => {
|
|
|
57325
57550
|
}
|
|
57326
57551
|
});
|
|
57327
57552
|
program2.parse();
|
|
57328
|
-
if (process.argv.slice(2).length === 0) {
|
|
57329
|
-
program2.help();
|
|
57330
|
-
}
|
|
57331
57553
|
});
|
|
57332
57554
|
init_vibe_runtime();
|
|
57333
57555
|
|
|
@@ -57338,4 +57560,4 @@ export {
|
|
|
57338
57560
|
binaryStartTime
|
|
57339
57561
|
};
|
|
57340
57562
|
|
|
57341
|
-
//# debugId=
|
|
57563
|
+
//# debugId=CBA91487AC5FEA3064756E2164756E21
|