@vistagenic/vista 0.3.6 → 0.3.9

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.
Files changed (68) hide show
  1. package/bin/flashpack-agent-playground.mjs +134 -0
  2. package/bin/flashpack-boot.mjs +506 -0
  3. package/bin/flashpack-ssr-loader.mjs +42 -0
  4. package/bin/flashpack-ssr.mjs +202 -0
  5. package/bin/flashpack-vendor.mjs +97 -0
  6. package/bin/vista.js +56 -42
  7. package/dist/ai/providers/base.js +7 -1
  8. package/dist/bin/build-rsc.js +16 -0
  9. package/dist/bin/build.js +17 -11
  10. package/dist/bin/deploy.js +7 -0
  11. package/dist/bin/dev-client-runtime.d.ts +6 -0
  12. package/dist/bin/dev-client-runtime.js +99 -0
  13. package/dist/bin/dev-error-overlay-snippet.js +79 -21
  14. package/dist/bin/dev-error-overlay-snippet.ts +840 -0
  15. package/dist/bin/devtools-indicator-snippet.js +29 -13
  16. package/dist/bin/file-scanner.js +7 -24
  17. package/dist/bin/generate.js +94 -2
  18. package/dist/bin/webpack.config.js +3 -1
  19. package/dist/build/rsc/compiler.d.ts +14 -0
  20. package/dist/build/rsc/compiler.js +66 -6
  21. package/dist/build/rsc/server-manifest.js +5 -4
  22. package/dist/config.d.ts +5 -0
  23. package/dist/config.js +15 -1
  24. package/dist/deploy/adapters/render.js +2 -2
  25. package/dist/deploy/index.d.ts +1 -0
  26. package/dist/deploy/index.js +3 -0
  27. package/dist/deploy/runtime-pack.js +22 -1
  28. package/dist/deploy/utils.js +16 -6
  29. package/dist/flashpack/command.d.ts +1 -0
  30. package/dist/flashpack/command.js +42 -76
  31. package/dist/flashpack/runtime.d.ts +12 -0
  32. package/dist/flashpack/runtime.js +124 -22
  33. package/dist/metadata/generate.d.ts +1 -0
  34. package/dist/metadata/generate.js +117 -21
  35. package/dist/metadata/index.d.ts +5 -0
  36. package/dist/metadata/index.js +15 -1
  37. package/dist/metadata/json-ld.d.ts +15 -0
  38. package/dist/metadata/json-ld.js +19 -0
  39. package/dist/metadata/merge.d.ts +17 -0
  40. package/dist/metadata/merge.js +161 -0
  41. package/dist/metadata/routes.d.ts +66 -0
  42. package/dist/metadata/routes.js +143 -0
  43. package/dist/metadata/types.d.ts +1 -1
  44. package/dist/metadata/types.js +3 -1
  45. package/dist/og/image-response.d.ts +38 -0
  46. package/dist/og/image-response.js +88 -0
  47. package/dist/og/index.d.ts +2 -0
  48. package/dist/og/index.js +5 -0
  49. package/dist/rust/index.d.ts +13 -0
  50. package/dist/rust/index.js +132 -0
  51. package/dist/server/engine.js +13 -3
  52. package/dist/server/logger.js +2 -1
  53. package/dist/server/project-alias-resolver.d.ts +7 -0
  54. package/dist/server/project-alias-resolver.js +70 -0
  55. package/dist/server/rsc-engine.js +93 -16
  56. package/dist/server/static-generator.js +4 -3
  57. package/dist/server/typed-api-runtime.js +92 -0
  58. package/docs/ai.md +69 -0
  59. package/docs/app.md +30 -0
  60. package/docs/cli.md +29 -0
  61. package/docs/index.md +18 -0
  62. package/docs/rag.md +54 -0
  63. package/native/win32-x64/flashpack-cli.exe +0 -0
  64. package/package.json +196 -178
  65. package/skills/README.md +9 -0
  66. package/skills/vista-agent/SKILL.md +28 -0
  67. package/skills/vista-dev-loop/SKILL.md +25 -0
  68. package/skills/vista-rag/SKILL.md +26 -0
@@ -17,6 +17,7 @@ function getDevErrorOverlayBootstrapSource() {
17
17
  var messageNode = null;
18
18
  var titleNode = null;
19
19
  var detailNode = null;
20
+ var stackNode = null;
20
21
  var filesWrapNode = null;
21
22
  var filesNode = null;
22
23
  var tabNameNodes = null;
@@ -189,7 +190,7 @@ function getDevErrorOverlayBootstrapSource() {
189
190
  var style = document.createElement('style');
190
191
  style.id = STYLE_ID;
191
192
  style.textContent = [
192
- '#' + ROOT_ID + '{position:fixed;inset:0;z-index:2147482500;display:flex;align-items:center;justify-content:center;padding:20px;overflow:hidden;}',
193
+ '#' + ROOT_ID + '{position:fixed;inset:0;z-index:2147482500;display:flex;align-items:center;justify-content:center;padding:20px;overflow:hidden;visibility:visible!important;}',
193
194
  '#' + ROOT_ID + '[hidden]{display:none;}',
194
195
  '#' + ROOT_ID + ' .vista-ov-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.72);}',
195
196
  '#' + ROOT_ID + ' .vista-ov-panel{position:relative;width:min(1180px,calc(100vw - 32px));height:min(820px,calc(100vh - 32px));display:flex;flex-direction:column;overflow:hidden;border-radius:8px;border:1px solid #2b2b2b;background:#1e1e1e;box-shadow:0 24px 80px rgba(0,0,0,0.62);color:#ededed;font-family:"Segoe UI",ui-sans-serif,system-ui,-apple-system,sans-serif;animation:vista-ov-in 160ms ease;}',
@@ -272,9 +273,12 @@ function getDevErrorOverlayBootstrapSource() {
272
273
  '#' + ROOT_ID + ' .vista-ov-source-badge.is-server{background:#1f6feb;}',
273
274
  '#' + ROOT_ID + ' .vista-ov-source-badge.is-hydration{background:#9e6a03;}',
274
275
  '#' + ROOT_ID + ' .vista-ov-source-badge.is-client{background:#238636;}',
275
- '#' + ROOT_ID + ' .vista-ov-title{margin:6px 0 0;font-size:13px;line-height:1.5;font-weight:500;color:#e6edf3;word-break:break-word;}',
276
- '#' + ROOT_ID + ' .vista-ov-detail{margin:6px 0 0;font-size:12px;line-height:1.5;color:#8b949e;white-space:pre-wrap;word-break:break-word;}',
276
+ '#' + ROOT_ID + ' .vista-ov-title{margin:6px 0 0;font-size:14px;line-height:1.45;font-weight:600;color:#e6edf3;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}',
277
+ '#' + ROOT_ID + ' .vista-ov-detail{margin:8px 0 0;font-size:12px;line-height:1.5;color:#8b949e;white-space:pre-wrap;word-break:break-word;}',
277
278
  '#' + ROOT_ID + ' .vista-ov-detail[hidden]{display:none;}',
279
+ '#' + ROOT_ID + ' .vista-ov-stack{margin:12px 0 0;padding:12px 14px;border:1px solid #30363d;border-radius:6px;background:#0d1117;color:#e6edf3;font-size:12px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre-wrap;word-break:break-word;overflow:auto;max-height:min(52vh,520px);}',
280
+ '#' + ROOT_ID + ' .vista-ov-stack[hidden]{display:none;}',
281
+ '#' + ROOT_ID + ' .vista-ov-stack .vista-ov-stack-file{color:#79c0ff;}',
278
282
  '@keyframes vista-ov-in{from{opacity:0;transform:translateY(8px) scale(0.98);}to{opacity:1;transform:translateY(0) scale(1);}}',
279
283
  '@media (max-width: 720px){',
280
284
  ' #' + ROOT_ID + '{padding:10px;}',
@@ -332,6 +336,7 @@ function getDevErrorOverlayBootstrapSource() {
332
336
  ' <p class="vista-ov-kind" data-vista-ov-kind>Build Error</p>',
333
337
  ' <h1 class="vista-ov-title" data-vista-ov-title>Build Error</h1>',
334
338
  ' <p class="vista-ov-detail" data-vista-ov-detail hidden></p>',
339
+ ' <pre class="vista-ov-stack" data-vista-ov-stack hidden></pre>',
335
340
  ' </div>',
336
341
  ' </div>',
337
342
  ' </div>',
@@ -347,6 +352,7 @@ function getDevErrorOverlayBootstrapSource() {
347
352
  messageNode = root.querySelector('[data-vista-message]');
348
353
  titleNode = root.querySelector('[data-vista-ov-title]');
349
354
  detailNode = root.querySelector('[data-vista-ov-detail]');
355
+ stackNode = root.querySelector('[data-vista-ov-stack]');
350
356
  filesWrapNode = root.querySelector('[data-vista-files-wrap]');
351
357
  tabNameNodes = root.querySelectorAll('[data-vista-tab-name]');
352
358
  crumbsNode = root.querySelector('[data-vista-crumbs]');
@@ -482,13 +488,38 @@ function getDevErrorOverlayBootstrapSource() {
482
488
  }
483
489
  }
484
490
 
485
- var title = trimmedLines.length ? trimmedLines[0] : 'Build Error';
486
- if (title.length > 140) {
487
- title = title.slice(0, 137) + '...';
491
+ var kind = 'build';
492
+ var headline = trimmedLines.length ? trimmedLines[0] : 'Build Error';
493
+ if (/hydration/i.test(headline) || /hydration|did not match|server rendered html/i.test(raw)) {
494
+ kind = 'hydration';
495
+ } else if (/server error|flight ssr|ssr failed/i.test(headline + ' ' + raw)) {
496
+ kind = 'server';
497
+ } else if (/runtime|unhandled promise/i.test(headline)) {
498
+ kind = 'runtime';
499
+ } else if (/TypeError|ReferenceError|SyntaxError|RangeError|EvalError|URIError|AggregateError/i.test(raw)) {
500
+ kind = 'runtime';
501
+ }
502
+
503
+ // Prefer the real exception line over a generic "Runtime Error" label.
504
+ var title = headline;
505
+ var exceptionLine = '';
506
+ for (var t = 0; t < trimmedLines.length; t += 1) {
507
+ if (/^(TypeError|ReferenceError|SyntaxError|RangeError|EvalError|URIError|AggregateError|Error)\b/.test(trimmedLines[t])) {
508
+ exceptionLine = trimmedLines[t];
509
+ break;
510
+ }
511
+ }
512
+ if (exceptionLine) {
513
+ title = exceptionLine;
514
+ } else if (kind === 'runtime' && trimmedLines.length > 1 && /^(runtime error|unhandled)/i.test(headline)) {
515
+ title = trimmedLines[1];
516
+ }
517
+ if (title.length > 180) {
518
+ title = title.slice(0, 177) + '...';
488
519
  }
489
520
 
490
521
  var files = [];
491
- var filePattern = /(?:[A-Za-z]:)?[\\/\w.@-]+\.(?:tsx?|jsx?|mjs|cjs|css|json|mdx?)(?::\d+(?::\d+)?)?/;
522
+ var filePattern = /(?:[A-Za-z]:)?[\\/\w.@+-]+\.(?:tsx?|jsx?|mjs|cjs|css|json|mdx?)(?::\d+(?::\d+)?)?/;
492
523
  for (var fileIdx = 0; fileIdx < lines.length; fileIdx += 1) {
493
524
  var maybeFile = lines[fileIdx].match(filePattern);
494
525
  if (!maybeFile) continue;
@@ -496,7 +527,22 @@ function getDevErrorOverlayBootstrapSource() {
496
527
  if (files.indexOf(normalized) === -1) {
497
528
  files.push(normalized);
498
529
  }
499
- if (files.length >= 5) break;
530
+ if (files.length >= 8) break;
531
+ }
532
+
533
+ var stackStart = -1;
534
+ for (var s = 0; s < lines.length; s += 1) {
535
+ if (/^\s*at\s+/.test(lines[s]) || /^(TypeError|ReferenceError|SyntaxError|RangeError|Error)\b/.test(lines[s].trim())) {
536
+ stackStart = s;
537
+ break;
538
+ }
539
+ }
540
+ var stackText = '';
541
+ if (stackStart !== -1) {
542
+ stackText = lines.slice(stackStart).join('\n').replace(/^\n+/, '').trim();
543
+ } else if (kind === 'runtime' || kind === 'server') {
544
+ var bodyLines = trimmedLines.slice(/^(runtime error|unhandled|server error)/i.test(headline) ? 1 : 0);
545
+ stackText = bodyLines.join('\n');
500
546
  }
501
547
 
502
548
  var hints = [];
@@ -515,20 +561,11 @@ function getDevErrorOverlayBootstrapSource() {
515
561
  if (/Structure Validation Failed/i.test(raw)) {
516
562
  hints.push('App structure rules failed. Verify route files, layout/page naming, and required conventions.');
517
563
  }
518
- if (hints.length === 0 && files.length > 0) {
519
- hints.push('Start with the first file above, then re-run after each fix.');
520
- }
521
- if (hints.length === 0) {
522
- hints.push('Resolve the top-most failure first, then reload to see remaining issues.');
564
+ if (/reading ['"]map['"]/i.test(raw)) {
565
+ hints.push('Something expected an array was undefined. Check the prop or data passed into .map().');
523
566
  }
524
-
525
- var kind = 'build';
526
- if (/hydration/i.test(title) || /hydration|did not match|server rendered html/i.test(raw)) {
527
- kind = 'hydration';
528
- } else if (/server error|flight ssr/i.test(title + ' ' + raw)) {
529
- kind = 'server';
530
- } else if (/runtime|unhandled promise/i.test(title)) {
531
- kind = 'runtime';
567
+ if (hints.length === 0 && files.length > 0 && kind === 'build') {
568
+ hints.push('Start with the first file above, then re-run after each fix.');
532
569
  }
533
570
 
534
571
  return {
@@ -536,6 +573,7 @@ function getDevErrorOverlayBootstrapSource() {
536
573
  title: title,
537
574
  files: files,
538
575
  hints: hints,
576
+ stack: stackText,
539
577
  kind: kind,
540
578
  timestamp: new Date(),
541
579
  };
@@ -613,6 +651,23 @@ function getDevErrorOverlayBootstrapSource() {
613
651
  detailNode.textContent = hintText;
614
652
  detailNode.hidden = hintText.length === 0;
615
653
  }
654
+ if (stackNode) {
655
+ var stackBody = String(parsed.stack || '').trim();
656
+ if (!stackBody && terminal) {
657
+ stackBody = String(parsed.raw || '').trim();
658
+ }
659
+ if (stackBody) {
660
+ var stackHtml = escapeHtml(stackBody).replace(
661
+ /((?:[A-Za-z]:)?[\\/\w.@+-]+\.(?:tsx?|jsx?|mjs|cjs)(?::\d+(?::\d+)?)?)/g,
662
+ '<span class="vista-ov-stack-file">$1</span>'
663
+ );
664
+ stackNode.innerHTML = stackHtml;
665
+ stackNode.hidden = false;
666
+ } else {
667
+ stackNode.textContent = '';
668
+ stackNode.hidden = true;
669
+ }
670
+ }
616
671
  if (fileTabsNode) {
617
672
  var tabs = '';
618
673
  for (var i = 0; i < files.length; i += 1) {
@@ -707,6 +762,9 @@ function getDevErrorOverlayBootstrapSource() {
707
762
  }
708
763
 
709
764
  function show(input) {
765
+ try {
766
+ document.documentElement.setAttribute('data-vista-ready', '');
767
+ } catch (err) {}
710
768
  ensureMounted();
711
769
  var messages = normalizeMessages(input);
712
770
  if (messages.length === 0) {