@myvillage/cli 1.26.0 → 1.30.0

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/src/utils/api.js CHANGED
@@ -456,55 +456,6 @@ export async function rotateClientAgentKey(configId) {
456
456
  return response.data;
457
457
  }
458
458
 
459
- // ── BizReqs API Client (/api/bizreqs) ───────────────────
460
-
461
- export function getBizReqsClient() {
462
- const config = getConfig();
463
- return createClient(config.bizreqsBaseUrl);
464
- }
465
-
466
- export async function createBizReqsSubmission(data) {
467
- const client = getBizReqsClient();
468
- const response = await client.post('/', data);
469
- return response.data;
470
- }
471
-
472
- export async function listBizReqsSubmissions(params = {}) {
473
- const client = getBizReqsClient();
474
- const response = await client.get('/', { params });
475
- return response.data;
476
- }
477
-
478
- export async function getBizReqsSubmission(id) {
479
- const client = getBizReqsClient();
480
- const response = await client.get(`/${encodeURIComponent(id)}`);
481
- return response.data;
482
- }
483
-
484
- export async function updateBizReqsSubmission(id, data) {
485
- const client = getBizReqsClient();
486
- const response = await client.patch(`/${encodeURIComponent(id)}`, data);
487
- return response.data;
488
- }
489
-
490
- export async function getBizReqsStatus(id) {
491
- const client = getBizReqsClient();
492
- const response = await client.get(`/${encodeURIComponent(id)}/status`);
493
- return response.data;
494
- }
495
-
496
- export async function saveBizReqsSpec(id, data) {
497
- const client = getBizReqsClient();
498
- const response = await client.post(`/${encodeURIComponent(id)}/spec`, data);
499
- return response.data;
500
- }
501
-
502
- export async function getBizReqsSpec(id) {
503
- const client = getBizReqsClient();
504
- const response = await client.get(`/${encodeURIComponent(id)}/spec`);
505
- return response.data;
506
- }
507
-
508
459
  // ── Media Drafts API (/api/media/drafts) ────────────────
509
460
 
510
461
  export async function createMediaDraft(data) {
@@ -8,7 +8,6 @@ const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
8
8
  const DEFAULT_CONFIG = {
9
9
  apiBaseUrl: 'https://portal.myvillageproject.ai/api/v1',
10
10
  networkBaseUrl: 'https://portal.myvillageproject.ai/api/network',
11
- bizreqsBaseUrl: 'https://portal.myvillageproject.ai/api/bizreqs',
12
11
  oauthBaseUrl: 'https://portal.myvillageproject.ai/api/oauth',
13
12
  soulprintBaseUrl: 'https://soulprint-studio.myvillageproject.ai/api',
14
13
  platformBaseUrl: 'https://portal.myvillageproject.ai/api',
@@ -630,186 +630,6 @@ export function formatSearchResults(results) {
630
630
  }
631
631
  }
632
632
 
633
- // ── BizReqs Formatting ─────────────────────────────────
634
-
635
- const BIZREQS_STATUS_COLORS = {
636
- NEW: chalk.cyan,
637
- IN_REVIEW: chalk.yellow,
638
- SPEC_READY: chalk.green,
639
- ASSIGNED: chalk.blue,
640
- IN_PROGRESS: chalk.magenta,
641
- DELIVERED: chalk.greenBright,
642
- CANCELLED: chalk.red,
643
- };
644
-
645
- const BIZREQS_PRIORITY_COLORS = {
646
- LOW: chalk.dim,
647
- MEDIUM: chalk.white,
648
- HIGH: chalk.yellow,
649
- URGENT: chalk.red,
650
- };
651
-
652
- export function formatBizReqsList(submissions) {
653
- if (!submissions || submissions.length === 0) {
654
- console.log(chalk.dim('\n No submissions found.\n'));
655
- return;
656
- }
657
-
658
- console.log('');
659
- console.log(
660
- ` ${brand.teal(padRight('ID', 16))}${padRight('Organization', 30)}${padRight('Solution', 20)}${padRight('Submitted', 12)}${padRight('Complexity', 12)}Status`
661
- );
662
- console.log(brand.darkGold(` ${'\u2500'.repeat(14)} ${'\u2500'.repeat(28)} ${'\u2500'.repeat(18)} ${'\u2500'.repeat(10)} ${'\u2500'.repeat(10)} ${'\u2500'.repeat(12)}`));
663
-
664
- for (const s of submissions) {
665
- const id = chalk.cyan(padRight(s.submissionId, 16));
666
- const org = padRight(truncate(s.organizationName, 28), 30);
667
- const solution = padRight(truncate(s.solutionName || '—', 18), 20);
668
- const date = padRight(relativeTime(s.createdAt), 12);
669
- const complexity = padRight(s.overallComplexity || '—', 12);
670
- const statusFn = BIZREQS_STATUS_COLORS[s.status] || chalk.white;
671
- const status = statusFn(s.status.replace('_', ' '));
672
- console.log(` ${id}${org}${solution}${date}${complexity}${status}`);
673
- }
674
- console.log('');
675
- }
676
-
677
- export function formatBizReqsStatusCounts(counts) {
678
- if (!counts || Object.keys(counts).length === 0) return;
679
-
680
- const parts = [];
681
- const order = ['NEW', 'IN_REVIEW', 'SPEC_READY', 'ASSIGNED', 'IN_PROGRESS', 'DELIVERED'];
682
- for (const status of order) {
683
- if (counts[status]) {
684
- const colorFn = BIZREQS_STATUS_COLORS[status] || chalk.white;
685
- parts.push(colorFn(`${counts[status]} ${status.toLowerCase().replace('_', ' ')}`));
686
- }
687
- }
688
- if (parts.length > 0) {
689
- console.log(` ${parts.join(chalk.dim(' | '))}\n`);
690
- }
691
- }
692
-
693
- export function formatBizReqsStatus(data) {
694
- const lines = [];
695
-
696
- lines.push('');
697
- const statusFn = BIZREQS_STATUS_COLORS[data.status] || chalk.white;
698
- lines.push(` ${chalk.bold(data.submissionId)} ${chalk.dim('·')} ${statusFn(data.status.replace('_', ' '))}`);
699
- lines.push(` ${brand.darkGold('\u2500'.repeat(50))}`);
700
- lines.push('');
701
- lines.push(` ${chalk.dim('Organization:')} ${data.organizationName}`);
702
-
703
- if (data.solutionName) {
704
- lines.push(` ${chalk.dim('Solution:')} ${data.solutionName}`);
705
- }
706
-
707
- if (data.overallComplexity) {
708
- lines.push(` ${chalk.dim('Complexity:')} ${data.overallComplexity}`);
709
- }
710
-
711
- if (data.estimatedTimeline) {
712
- lines.push(` ${chalk.dim('Timeline:')} ${data.estimatedTimeline}`);
713
- }
714
-
715
- const priorityFn = BIZREQS_PRIORITY_COLORS[data.priority] || chalk.white;
716
- lines.push(` ${chalk.dim('Priority:')} ${priorityFn(data.priority)}`);
717
-
718
- if (data.components && Array.isArray(data.components) && data.components.length > 0) {
719
- lines.push('');
720
- lines.push(` ${chalk.dim('Components:')}`);
721
- for (const comp of data.components) {
722
- const name = comp.name || comp;
723
- const type = comp.type ? chalk.dim(` (${comp.type})`) : '';
724
- lines.push(` ${chalk.dim('•')} ${name}${type}`);
725
- }
726
- }
727
-
728
- lines.push('');
729
- lines.push(` ${chalk.dim('Spec:')} ${data.hasSpec ? chalk.green('Generated') + chalk.dim(` (${formatDate(data.specGeneratedAt)})`) : chalk.dim('Not yet')}`);
730
- lines.push(` ${chalk.dim('Submitted:')} ${formatDate(data.createdAt)}`);
731
- if (data.reviewedAt) {
732
- lines.push(` ${chalk.dim('Reviewed:')} ${formatDate(data.reviewedAt)}`);
733
- }
734
-
735
- lines.push('');
736
- console.log(lines.join('\n'));
737
- }
738
-
739
- export function formatRecommendationBox(rec) {
740
- const lines = [];
741
- const width = 65;
742
- const bdr = '\u2500'.repeat(width);
743
- const b = brand.darkGold;
744
-
745
- lines.push('');
746
- lines.push(` ${b('\u250C' + bdr + '\u2510')}`);
747
- lines.push(` ${b('\u2502')} ${brand.gold(chalk.bold(`RECOMMENDED SOLUTION: ${rec.solutionName}`)).padEnd(width - 1)}${b('\u2502')}`);
748
- if (rec.organizationName) {
749
- lines.push(` ${b('\u2502')} ${brand.teal(`For: ${rec.organizationName}`).padEnd(width - 1)}${b('\u2502')}`);
750
- }
751
- lines.push(` ${b('\u251C' + bdr + '\u2524')}`);
752
- lines.push(` ${b('\u2502')}${' '.repeat(width + 1)}${b('\u2502')}`);
753
-
754
- if (rec.components && Array.isArray(rec.components)) {
755
- for (let i = 0; i < rec.components.length; i++) {
756
- const comp = rec.components[i];
757
- const icon = comp.type === 'portal' ? '\uD83D\uDCF1'
758
- : comp.type === 'game' ? '\uD83C\uDFAE'
759
- : comp.type === 'agent' ? '\uD83E\uDD16'
760
- : comp.type === 'feed' ? '\uD83D\uDCCA'
761
- : comp.type === 'model' ? '\uD83E\uDDE0'
762
- : comp.type === 'voice' ? '\uD83C\uDFA4'
763
- : '\uD83D\uDCE6';
764
-
765
- const compLine = ` ${icon} Component ${i + 1}: ${comp.name}`;
766
- lines.push(` ${b('\u2502')} ${brand.cream(compLine).padEnd(width - 1)}${b('\u2502')}`);
767
-
768
- if (comp.description) {
769
- const descWords = comp.description.split(' ');
770
- let currentLine = ' ';
771
- for (const word of descWords) {
772
- if (currentLine.length + word.length + 1 > width - 4) {
773
- lines.push(` ${b('\u2502')} ${brand.teal(currentLine).padEnd(width - 1)}${b('\u2502')}`);
774
- currentLine = ' ' + word;
775
- } else {
776
- currentLine += (currentLine.length > 5 ? ' ' : '') + word;
777
- }
778
- }
779
- if (currentLine.trim()) {
780
- lines.push(` ${b('\u2502')} ${brand.teal(currentLine).padEnd(width - 1)}${b('\u2502')}`);
781
- }
782
- }
783
-
784
- if (comp.type) {
785
- const builtWith = ` Built with: myvillage ${comp.type}`;
786
- lines.push(` ${b('\u2502')} ${brand.gold(builtWith).padEnd(width - 1)}${b('\u2502')}`);
787
- }
788
-
789
- lines.push(` ${b('\u2502')}${' '.repeat(width + 1)}${b('\u2502')}`);
790
- }
791
- }
792
-
793
- lines.push(` ${b('\u251C' + bdr + '\u2524')}`);
794
-
795
- if (rec.estimatedTimeline) {
796
- const tl = ` Estimated Build Time: ${rec.estimatedTimeline}`;
797
- lines.push(` ${b('\u2502')} ${brand.cream(tl).padEnd(width - 1)}${b('\u2502')}`);
798
- }
799
- if (rec.estimatedMVT) {
800
- const mvt = ` Estimated MVT Budget: ${rec.estimatedMVT} MVT`;
801
- lines.push(` ${b('\u2502')} ${brand.cream(mvt).padEnd(width - 1)}${b('\u2502')}`);
802
- }
803
- if (rec.overallComplexity) {
804
- const cx = ` Complexity: ${rec.overallComplexity}`;
805
- lines.push(` ${b('\u2502')} ${brand.cream(cx).padEnd(width - 1)}${b('\u2502')}`);
806
- }
807
- lines.push(` ${b('\u2514' + bdr + '\u2518')}`);
808
- lines.push('');
809
-
810
- console.log(lines.join('\n'));
811
- }
812
-
813
633
  // ── Pagination ──────────────────────────────────────────
814
634
 
815
635
  export function formatPagination(meta) {