@triedotdev/mcp 1.0.136 → 1.0.138

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 (105) hide show
  1. package/README.md +6 -6
  2. package/dist/{autonomy-config-QA6ATWLJ.js → autonomy-config-TZ6HF4FA.js} +3 -3
  3. package/dist/{chat-store-HFOOWZYN.js → chat-store-OJLJCJFI.js} +3 -3
  4. package/dist/{chunk-DFPVUMVE.js → chunk-23RJT5WT.js} +5 -4
  5. package/dist/chunk-23RJT5WT.js.map +1 -0
  6. package/dist/{chunk-4YJ6KLGI.js → chunk-3MUCUZ46.js} +8 -8
  7. package/dist/chunk-3MUCUZ46.js.map +1 -0
  8. package/dist/{chunk-6VIMBFUZ.js → chunk-3RRXWX3V.js} +21 -17
  9. package/dist/chunk-3RRXWX3V.js.map +1 -0
  10. package/dist/{chunk-WHIQAGB7.js → chunk-4C67GV3O.js} +2 -2
  11. package/dist/{chunk-WS6OA7H6.js → chunk-4MJ52WBH.js} +2 -3
  12. package/dist/chunk-4MJ52WBH.js.map +1 -0
  13. package/dist/{chunk-AJ34GCMD.js → chunk-67GSG2ST.js} +41 -38
  14. package/dist/chunk-67GSG2ST.js.map +1 -0
  15. package/dist/{chunk-UHX4462X.js → chunk-6LLH3TBZ.js} +24 -25
  16. package/dist/chunk-6LLH3TBZ.js.map +1 -0
  17. package/dist/{chunk-DFHMB44X.js → chunk-D3AS5LY7.js} +6 -10
  18. package/dist/chunk-D3AS5LY7.js.map +1 -0
  19. package/dist/{chunk-6OUWNVLX.js → chunk-EDDT4ZIH.js} +8 -8
  20. package/dist/chunk-EDDT4ZIH.js.map +1 -0
  21. package/dist/{chunk-Z4DN527J.js → chunk-FG467PDD.js} +156 -39
  22. package/dist/chunk-FG467PDD.js.map +1 -0
  23. package/dist/{chunk-T4THB2OR.js → chunk-FOCXXIXY.js} +49 -28
  24. package/dist/chunk-FOCXXIXY.js.map +1 -0
  25. package/dist/{goal-validator-PDKYZSNP.js → chunk-GFFUDJMK.js} +97 -40
  26. package/dist/chunk-GFFUDJMK.js.map +1 -0
  27. package/dist/{chunk-ZEXMMTIQ.js → chunk-J5EMP4XW.js} +2 -2
  28. package/dist/{chunk-UHMMANC2.js → chunk-LT6VUZG2.js} +21 -18
  29. package/dist/chunk-LT6VUZG2.js.map +1 -0
  30. package/dist/{chunk-55CBWOEZ.js → chunk-QSWUPSLK.js} +2 -2
  31. package/dist/{chunk-45Y5TLQZ.js → chunk-SH7H3WRU.js} +3 -6
  32. package/dist/chunk-SH7H3WRU.js.map +1 -0
  33. package/dist/{chunk-VRLMTOB6.js → chunk-TIMIKBY2.js} +1 -1
  34. package/dist/chunk-TIMIKBY2.js.map +1 -0
  35. package/dist/{chunk-POHBQUG7.js → chunk-X3F5QDER.js} +1224 -448
  36. package/dist/chunk-X3F5QDER.js.map +1 -0
  37. package/dist/{chunk-O6OTJI3W.js → chunk-Y32FM3MR.js} +2 -2
  38. package/dist/{chunk-G5PRBQIQ.js → chunk-YOKQ25IW.js} +102 -82
  39. package/dist/chunk-YOKQ25IW.js.map +1 -0
  40. package/dist/{chunk-JAKMZI5S.js → chunk-Z2P4WST6.js} +291 -180
  41. package/dist/chunk-Z2P4WST6.js.map +1 -0
  42. package/dist/cli/create-agent.js +1 -1
  43. package/dist/cli/main.js +113 -86
  44. package/dist/cli/main.js.map +1 -1
  45. package/dist/cli/yolo-daemon.js +19 -19
  46. package/dist/cli/yolo-daemon.js.map +1 -1
  47. package/dist/{client-BZHI675W.js → client-JTU5TRLB.js} +3 -3
  48. package/dist/{codebase-index-CR6Q2HEI.js → codebase-index-FNJ4GCBE.js} +3 -3
  49. package/dist/{goal-manager-FAK7H4RR.js → goal-manager-6BJQ36AH.js} +7 -8
  50. package/dist/goal-validator-GISXYANK.js +22 -0
  51. package/dist/{graph-PAUZ5EMP.js → graph-X2FMRQLG.js} +3 -3
  52. package/dist/{hypothesis-L5446W36.js → hypothesis-K3KQJOXJ.js} +7 -8
  53. package/dist/{incident-index-ZCDSJ42L.js → incident-index-BWW2UEY7.js} +3 -3
  54. package/dist/index.js +343 -288
  55. package/dist/index.js.map +1 -1
  56. package/dist/{insight-store-F5KDBY5Y.js → insight-store-A5XXMFD6.js} +6 -6
  57. package/dist/issue-store-BO5OWLJW.js +32 -0
  58. package/dist/{output-manager-BOTMXSND.js → output-manager-DZO5LGSG.js} +2 -2
  59. package/dist/{tiered-storage-QW2G7GSG.js → tiered-storage-VZL7KK64.js} +3 -3
  60. package/dist/trie-agent-XMSGMD7E.js +26 -0
  61. package/dist/trie-agent-XMSGMD7E.js.map +1 -0
  62. package/dist/ui/chat.html +260 -67
  63. package/dist/ui/goals.html +246 -3
  64. package/dist/ui/hypotheses.html +248 -5
  65. package/dist/ui/ledger.html +252 -9
  66. package/dist/ui/nudges.html +244 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-45Y5TLQZ.js.map +0 -1
  69. package/dist/chunk-4YJ6KLGI.js.map +0 -1
  70. package/dist/chunk-6OUWNVLX.js.map +0 -1
  71. package/dist/chunk-6VIMBFUZ.js.map +0 -1
  72. package/dist/chunk-AJ34GCMD.js.map +0 -1
  73. package/dist/chunk-DFHMB44X.js.map +0 -1
  74. package/dist/chunk-DFPVUMVE.js.map +0 -1
  75. package/dist/chunk-G5PRBQIQ.js.map +0 -1
  76. package/dist/chunk-JAKMZI5S.js.map +0 -1
  77. package/dist/chunk-PEJEYWVR.js +0 -135
  78. package/dist/chunk-PEJEYWVR.js.map +0 -1
  79. package/dist/chunk-POHBQUG7.js.map +0 -1
  80. package/dist/chunk-T4THB2OR.js.map +0 -1
  81. package/dist/chunk-UHMMANC2.js.map +0 -1
  82. package/dist/chunk-UHX4462X.js.map +0 -1
  83. package/dist/chunk-VRLMTOB6.js.map +0 -1
  84. package/dist/chunk-WS6OA7H6.js.map +0 -1
  85. package/dist/chunk-Z4DN527J.js.map +0 -1
  86. package/dist/goal-validator-PDKYZSNP.js.map +0 -1
  87. package/dist/guardian-agent-4RHGIXUD.js +0 -27
  88. package/dist/ledger-WKVJWHBX.js +0 -17
  89. /package/dist/{autonomy-config-QA6ATWLJ.js.map → autonomy-config-TZ6HF4FA.js.map} +0 -0
  90. /package/dist/{chat-store-HFOOWZYN.js.map → chat-store-OJLJCJFI.js.map} +0 -0
  91. /package/dist/{chunk-WHIQAGB7.js.map → chunk-4C67GV3O.js.map} +0 -0
  92. /package/dist/{chunk-ZEXMMTIQ.js.map → chunk-J5EMP4XW.js.map} +0 -0
  93. /package/dist/{chunk-55CBWOEZ.js.map → chunk-QSWUPSLK.js.map} +0 -0
  94. /package/dist/{chunk-O6OTJI3W.js.map → chunk-Y32FM3MR.js.map} +0 -0
  95. /package/dist/{client-BZHI675W.js.map → client-JTU5TRLB.js.map} +0 -0
  96. /package/dist/{codebase-index-CR6Q2HEI.js.map → codebase-index-FNJ4GCBE.js.map} +0 -0
  97. /package/dist/{goal-manager-FAK7H4RR.js.map → goal-manager-6BJQ36AH.js.map} +0 -0
  98. /package/dist/{graph-PAUZ5EMP.js.map → goal-validator-GISXYANK.js.map} +0 -0
  99. /package/dist/{guardian-agent-4RHGIXUD.js.map → graph-X2FMRQLG.js.map} +0 -0
  100. /package/dist/{hypothesis-L5446W36.js.map → hypothesis-K3KQJOXJ.js.map} +0 -0
  101. /package/dist/{incident-index-ZCDSJ42L.js.map → incident-index-BWW2UEY7.js.map} +0 -0
  102. /package/dist/{insight-store-F5KDBY5Y.js.map → insight-store-A5XXMFD6.js.map} +0 -0
  103. /package/dist/{ledger-WKVJWHBX.js.map → issue-store-BO5OWLJW.js.map} +0 -0
  104. /package/dist/{output-manager-BOTMXSND.js.map → output-manager-DZO5LGSG.js.map} +0 -0
  105. /package/dist/{tiered-storage-QW2G7GSG.js.map → tiered-storage-VZL7KK64.js.map} +0 -0
@@ -644,12 +644,255 @@ h4 { font-size: 14px; }
644
644
  flex: 1;
645
645
  }
646
646
 
647
+ /* Chat App Styles */
648
+ .chat-container {
649
+ display: flex;
650
+ flex-direction: column;
651
+ height: calc(100vh - 120px);
652
+ max-height: 800px;
653
+ margin-top: 16px;
654
+ }
655
+
656
+ .messages-container {
657
+ flex: 1;
658
+ overflow-y: auto;
659
+ padding: 16px;
660
+ border: 1px solid var(--trie-border);
661
+ border-radius: var(--radius) var(--radius) 0 0;
662
+ background: var(--trie-surface);
663
+ min-height: 400px;
664
+ }
665
+
666
+ .message {
667
+ margin-bottom: 16px;
668
+ padding: 12px 16px;
669
+ border-radius: var(--radius);
670
+ background: var(--trie-bg);
671
+ border: 1px solid var(--trie-border);
672
+ }
673
+
674
+ .message.user-message {
675
+ margin-left: 20%;
676
+ background: rgba(88, 166, 255, 0.1);
677
+ border-color: rgba(88, 166, 255, 0.3);
678
+ }
679
+
680
+ .message.assistant-message {
681
+ margin-right: 20%;
682
+ }
683
+
684
+ .message-header {
685
+ display: flex;
686
+ justify-content: space-between;
687
+ margin-bottom: 8px;
688
+ font-size: 12px;
689
+ color: var(--trie-text-muted);
690
+ }
691
+
692
+ .message-author {
693
+ font-weight: 600;
694
+ }
695
+
696
+ .message-content {
697
+ line-height: 1.6;
698
+ white-space: pre-wrap;
699
+ word-wrap: break-word;
700
+ }
701
+
702
+ .message-content pre {
703
+ background: var(--trie-surface);
704
+ border: 1px solid var(--trie-border);
705
+ border-radius: var(--radius);
706
+ padding: 12px;
707
+ margin: 8px 0;
708
+ overflow-x: auto;
709
+ font-family: var(--font-mono);
710
+ font-size: 12px;
711
+ }
712
+
713
+ .message-content code {
714
+ font-family: var(--font-mono);
715
+ font-size: 12px;
716
+ background: rgba(110, 118, 129, 0.2);
717
+ padding: 2px 6px;
718
+ border-radius: 4px;
719
+ }
720
+
721
+ .message-content pre code {
722
+ background: none;
723
+ padding: 0;
724
+ }
725
+
726
+ .typing-indicator {
727
+ display: flex;
728
+ gap: 4px;
729
+ align-items: center;
730
+ }
731
+
732
+ .typing-indicator span {
733
+ width: 8px;
734
+ height: 8px;
735
+ border-radius: 50%;
736
+ background: var(--trie-text-muted);
737
+ animation: typing 1.4s infinite ease-in-out;
738
+ }
739
+
740
+ .typing-indicator span:nth-child(1) { animation-delay: 0s; }
741
+ .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
742
+ .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
743
+
744
+ @keyframes typing {
745
+ 0%, 80%, 100% {
746
+ opacity: 0.3;
747
+ transform: scale(0.8);
748
+ }
749
+ 40% {
750
+ opacity: 1;
751
+ transform: scale(1);
752
+ }
753
+ }
754
+
755
+ .tool-calls {
756
+ margin-bottom: 12px;
757
+ padding: 12px;
758
+ background: var(--trie-surface);
759
+ border: 1px solid var(--trie-border);
760
+ border-radius: var(--radius);
761
+ font-family: var(--font-mono);
762
+ font-size: 12px;
763
+ }
764
+
765
+ .tool-call {
766
+ display: flex;
767
+ gap: 8px;
768
+ margin-bottom: 4px;
769
+ }
770
+
771
+ .tool-call:last-child {
772
+ margin-bottom: 0;
773
+ }
774
+
775
+ .tool-name {
776
+ color: var(--trie-primary);
777
+ font-weight: 600;
778
+ }
779
+
780
+ .tool-input {
781
+ color: var(--trie-text-muted);
782
+ }
783
+
784
+ .pending-fix {
785
+ margin-top: 12px;
786
+ padding: 16px;
787
+ background: rgba(210, 153, 34, 0.1);
788
+ border: 1px solid rgba(210, 153, 34, 0.3);
789
+ border-radius: var(--radius);
790
+ }
791
+
792
+ .fix-header {
793
+ margin-bottom: 12px;
794
+ color: var(--trie-warning);
795
+ }
796
+
797
+ .fix-details p {
798
+ margin-bottom: 8px;
799
+ font-size: 14px;
800
+ }
801
+
802
+ .fix-actions {
803
+ display: flex;
804
+ gap: 8px;
805
+ margin-top: 12px;
806
+ }
807
+
808
+ .chat-input-container {
809
+ background: var(--trie-surface);
810
+ border: 1px solid var(--trie-border);
811
+ border-top: none;
812
+ border-radius: 0 0 var(--radius) var(--radius);
813
+ padding: 16px;
814
+ flex-shrink: 0;
815
+ }
816
+
817
+ .input-wrapper {
818
+ display: flex;
819
+ gap: 12px;
820
+ align-items: flex-end;
821
+ }
822
+
823
+ .chat-input {
824
+ flex: 1;
825
+ min-height: 60px;
826
+ max-height: 120px;
827
+ padding: 12px;
828
+ font-size: 14px;
829
+ line-height: 1.5;
830
+ border: 1px solid var(--trie-border);
831
+ border-radius: var(--radius);
832
+ background: var(--trie-bg);
833
+ color: var(--trie-text);
834
+ resize: none;
835
+ font-family: var(--font-sans);
836
+ }
837
+
838
+ .chat-input:focus {
839
+ outline: none;
840
+ border-color: var(--trie-primary);
841
+ }
842
+
843
+ .chat-input::placeholder {
844
+ color: var(--trie-text-muted);
845
+ }
846
+
847
+ .send-button {
848
+ padding: 12px 24px;
849
+ font-size: 14px;
850
+ font-weight: 600;
851
+ border: none;
852
+ border-radius: var(--radius);
853
+ background: var(--trie-primary);
854
+ color: #fff;
855
+ cursor: pointer;
856
+ transition: all 0.15s ease;
857
+ flex-shrink: 0;
858
+ height: fit-content;
859
+ }
860
+
861
+ .send-button:hover:not(:disabled) {
862
+ background: rgba(88, 166, 255, 0.9);
863
+ }
864
+
865
+ .send-button:disabled {
866
+ opacity: 0.5;
867
+ cursor: not-allowed;
868
+ }
869
+
870
+ .input-help {
871
+ margin-top: 8px;
872
+ font-size: 12px;
873
+ color: var(--trie-text-muted);
874
+ text-align: center;
875
+ }
876
+
877
+ .app-header {
878
+ margin-bottom: 0;
879
+ }
880
+
881
+ .app-header h1 {
882
+ margin-bottom: 4px;
883
+ }
884
+
885
+ .app-header p {
886
+ color: var(--trie-text-muted);
887
+ margin-bottom: 0;
888
+ }
889
+
647
890
  </style>
648
891
  </head>
649
892
  <body>
650
893
  <div id="app" class="container"></div>
651
894
  <script type="module">
652
- var g=Object.defineProperty;var m=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>m(n,typeof e!="symbol"?e+"":e,t);function v(n,e,t){let a=document.createElement(n);if(e)for(let[s,i]of Object.entries(e))s==="className"?a.className=String(i):typeof i=="boolean"?i&&a.setAttribute(s,""):a.setAttribute(s,String(i));if(t)for(let s of t)typeof s=="string"?a.appendChild(document.createTextNode(s)):a.appendChild(s);return a}var r=v;function h(n){return r("div",{className:"loading"},[r("div",{className:"spinner"}),n?r("span",{className:"ml-2"},[n]):document.createTextNode("")])}function p(n,e="Loading..."){n.innerHTML="",n.appendChild(h(e))}function c(n,e){n.innerHTML="",n.appendChild(r("div",{className:"error-state"},[r("div",{className:"error-icon"},["\u26A0\uFE0F"]),r("p",{className:"error-message"},[e])]))}function u(n){document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("app");if(!e){console.error("App container not found");return}try{new n(e)}catch(t){c(e,`Failed to initialize app: ${t}`)}})}var d=class{constructor(e){l(this,"container");l(this,"goals",[]);l(this,"selectedGoal",null);this.container=e,this.init()}async init(){await this.loadData(),this.render(),this.setupEventListeners()}async loadData(){try{p(this.container,"Loading goals..."),this.goals=[{id:"goal-1",description:"Eliminate all emoji usage from codebase",type:"reduction",status:"active",currentValue:2,target:0,startValue:15,category:"quality",autoGenerated:!1,createdAt:new Date(Date.now()-864e5*3).toISOString(),updatedAt:new Date().toISOString()},{id:"goal-2",description:"Increase test coverage to 85%",type:"increase",status:"active",currentValue:72,target:85,startValue:65,category:"coverage",autoGenerated:!0,createdAt:new Date(Date.now()-864e5).toISOString(),updatedAt:new Date().toISOString()},{id:"goal-3",description:"Remove all TODO comments",type:"reduction",status:"achieved",currentValue:0,target:0,startValue:8,category:"quality",autoGenerated:!1,createdAt:new Date(Date.now()-864e5*7).toISOString(),updatedAt:new Date(Date.now()-864e5*2).toISOString(),achievedAt:new Date(Date.now()-864e5*2).toISOString()}]}catch(e){c(this.container,`Failed to load goals: ${e}`)}}render(){let e=this.goals.filter(i=>i.status==="active"),t=this.goals.filter(i=>i.status==="achieved"),a=this.goals.filter(i=>i.status==="rejected"),s=`
895
+ var g=Object.defineProperty;var m=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>m(n,typeof e!="symbol"?e+"":e,t);function v(n,e,t){let a=document.createElement(n);if(e)for(let[s,i]of Object.entries(e))s==="className"?a.className=String(i):typeof i=="boolean"?i&&a.setAttribute(s,""):a.setAttribute(s,String(i));if(t)for(let s of t)typeof s=="string"?a.appendChild(document.createTextNode(s)):a.appendChild(s);return a}var r=v;function h(n){return r("div",{className:"loading"},[r("div",{className:"spinner"}),n?r("span",{className:"ml-2"},[n]):document.createTextNode("")])}function p(n,e="Loading..."){n.innerHTML="",n.appendChild(h(e))}function c(n,e){n.innerHTML="",n.appendChild(r("div",{className:"error-state"},[r("div",{className:"error-icon"},["\u26A0\uFE0F"]),r("p",{className:"error-message"},[e])]))}function u(n){document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("app");if(!e){console.error("App container not found");return}try{new n(e)}catch(t){c(e,`Failed to initialize app: ${t}`)}})}var d=class{constructor(e){l(this,"container");l(this,"goals",[]);this.container=e,this.init()}async init(){await this.loadData(),this.render(),this.setupEventListeners()}async loadData(){try{p(this.container,"Loading goals..."),this.goals=[{id:"goal-1",description:"Eliminate all emoji usage from codebase",type:"reduction",status:"active",currentValue:2,target:0,startValue:15,category:"quality",autoGenerated:!1,createdAt:new Date(Date.now()-864e5*3).toISOString(),updatedAt:new Date().toISOString()},{id:"goal-2",description:"Increase test coverage to 85%",type:"increase",status:"active",currentValue:72,target:85,startValue:65,category:"coverage",autoGenerated:!0,createdAt:new Date(Date.now()-864e5).toISOString(),updatedAt:new Date().toISOString()},{id:"goal-3",description:"Remove all TODO comments",type:"reduction",status:"achieved",currentValue:0,target:0,startValue:8,category:"quality",autoGenerated:!1,createdAt:new Date(Date.now()-864e5*7).toISOString(),updatedAt:new Date(Date.now()-864e5*2).toISOString(),achievedAt:new Date(Date.now()-864e5*2).toISOString()}]}catch(e){c(this.container,`Failed to load goals: ${e}`)}}render(){let e=this.goals.filter(i=>i.status==="active"),t=this.goals.filter(i=>i.status==="achieved"),a=this.goals.filter(i=>i.status==="rejected"),s=`
653
896
  <div class="app-header">
654
897
  <h1>Goals & Progress</h1>
655
898
  <p>Track your code quality and improvement goals</p>
@@ -713,11 +956,11 @@ var g=Object.defineProperty;var m=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configura
713
956
  `:""}
714
957
  </div>
715
958
  </div>
716
- `}calculateGoalProgress(e){if(e.target<=0)return 0;let t=e.startValue??e.currentValue;if(t>e.target){let a=t-e.target,s=t-e.currentValue;return Math.min(100,Math.max(0,Math.round(s/a*100)))}return Math.min(100,Math.max(0,Math.round(e.currentValue/e.target*100)))}calculateOverallProgress(){let e=this.goals.filter(a=>a.status==="active");return e.length===0?100:e.reduce((a,s)=>a+this.calculateGoalProgress(s),0)/e.length}createProgressBar(e){let a=10-Math.round(e/10);return`
959
+ `}calculateGoalProgress(e){if(e.target<=0)return 0;let t=e.startValue??e.currentValue;if(t>e.target){let a=t-e.target,s=t-e.currentValue;return Math.min(100,Math.max(0,Math.round(s/a*100)))}return Math.min(100,Math.max(0,Math.round(e.currentValue/e.target*100)))}calculateOverallProgress(){let e=this.goals.filter(a=>a.status==="active");return e.length===0?100:e.reduce((a,s)=>a+this.calculateGoalProgress(s),0)/e.length}createProgressBar(e){return`
717
960
  <div class="progress-bar">
718
961
  <div class="progress-fill" style="width: ${e}%"></div>
719
962
  </div>
720
- `}formatTimeAgo(e){let t=Date.now(),a=new Date(e).getTime(),s=t-a,i=Math.floor(s/(1e3*60));if(i<60)return`${i}m ago`;let o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}setupEventListeners(){this.container.addEventListener("click",e=>{let a=e.target.closest(".goal-card");if(a){let s=a.getAttribute("data-goal-id"),i=this.goals.find(o=>o.id===s);i&&(this.selectedGoal=i)}}),window.checkGoal=e=>{console.log("Checking goal:",e)},window.completeGoal=e=>{console.log("Completing goal:",e)}}};u(d);
963
+ `}formatTimeAgo(e){let t=Date.now(),a=new Date(e).getTime(),s=t-a,i=Math.floor(s/(1e3*60));if(i<60)return`${i}m ago`;let o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}setupEventListeners(){this.container.addEventListener("click",e=>{let a=e.target.closest(".goal-card");if(a){let s=a.getAttribute("data-goal-id"),i=this.goals.find(o=>o.id===s)}}),window.checkGoal=e=>{console.log("Checking goal:",e)},window.completeGoal=e=>{console.log("Completing goal:",e)}}};u(d);
721
964
 
722
965
  </script>
723
966
  </body>
@@ -644,12 +644,255 @@ h4 { font-size: 14px; }
644
644
  flex: 1;
645
645
  }
646
646
 
647
+ /* Chat App Styles */
648
+ .chat-container {
649
+ display: flex;
650
+ flex-direction: column;
651
+ height: calc(100vh - 120px);
652
+ max-height: 800px;
653
+ margin-top: 16px;
654
+ }
655
+
656
+ .messages-container {
657
+ flex: 1;
658
+ overflow-y: auto;
659
+ padding: 16px;
660
+ border: 1px solid var(--trie-border);
661
+ border-radius: var(--radius) var(--radius) 0 0;
662
+ background: var(--trie-surface);
663
+ min-height: 400px;
664
+ }
665
+
666
+ .message {
667
+ margin-bottom: 16px;
668
+ padding: 12px 16px;
669
+ border-radius: var(--radius);
670
+ background: var(--trie-bg);
671
+ border: 1px solid var(--trie-border);
672
+ }
673
+
674
+ .message.user-message {
675
+ margin-left: 20%;
676
+ background: rgba(88, 166, 255, 0.1);
677
+ border-color: rgba(88, 166, 255, 0.3);
678
+ }
679
+
680
+ .message.assistant-message {
681
+ margin-right: 20%;
682
+ }
683
+
684
+ .message-header {
685
+ display: flex;
686
+ justify-content: space-between;
687
+ margin-bottom: 8px;
688
+ font-size: 12px;
689
+ color: var(--trie-text-muted);
690
+ }
691
+
692
+ .message-author {
693
+ font-weight: 600;
694
+ }
695
+
696
+ .message-content {
697
+ line-height: 1.6;
698
+ white-space: pre-wrap;
699
+ word-wrap: break-word;
700
+ }
701
+
702
+ .message-content pre {
703
+ background: var(--trie-surface);
704
+ border: 1px solid var(--trie-border);
705
+ border-radius: var(--radius);
706
+ padding: 12px;
707
+ margin: 8px 0;
708
+ overflow-x: auto;
709
+ font-family: var(--font-mono);
710
+ font-size: 12px;
711
+ }
712
+
713
+ .message-content code {
714
+ font-family: var(--font-mono);
715
+ font-size: 12px;
716
+ background: rgba(110, 118, 129, 0.2);
717
+ padding: 2px 6px;
718
+ border-radius: 4px;
719
+ }
720
+
721
+ .message-content pre code {
722
+ background: none;
723
+ padding: 0;
724
+ }
725
+
726
+ .typing-indicator {
727
+ display: flex;
728
+ gap: 4px;
729
+ align-items: center;
730
+ }
731
+
732
+ .typing-indicator span {
733
+ width: 8px;
734
+ height: 8px;
735
+ border-radius: 50%;
736
+ background: var(--trie-text-muted);
737
+ animation: typing 1.4s infinite ease-in-out;
738
+ }
739
+
740
+ .typing-indicator span:nth-child(1) { animation-delay: 0s; }
741
+ .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
742
+ .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
743
+
744
+ @keyframes typing {
745
+ 0%, 80%, 100% {
746
+ opacity: 0.3;
747
+ transform: scale(0.8);
748
+ }
749
+ 40% {
750
+ opacity: 1;
751
+ transform: scale(1);
752
+ }
753
+ }
754
+
755
+ .tool-calls {
756
+ margin-bottom: 12px;
757
+ padding: 12px;
758
+ background: var(--trie-surface);
759
+ border: 1px solid var(--trie-border);
760
+ border-radius: var(--radius);
761
+ font-family: var(--font-mono);
762
+ font-size: 12px;
763
+ }
764
+
765
+ .tool-call {
766
+ display: flex;
767
+ gap: 8px;
768
+ margin-bottom: 4px;
769
+ }
770
+
771
+ .tool-call:last-child {
772
+ margin-bottom: 0;
773
+ }
774
+
775
+ .tool-name {
776
+ color: var(--trie-primary);
777
+ font-weight: 600;
778
+ }
779
+
780
+ .tool-input {
781
+ color: var(--trie-text-muted);
782
+ }
783
+
784
+ .pending-fix {
785
+ margin-top: 12px;
786
+ padding: 16px;
787
+ background: rgba(210, 153, 34, 0.1);
788
+ border: 1px solid rgba(210, 153, 34, 0.3);
789
+ border-radius: var(--radius);
790
+ }
791
+
792
+ .fix-header {
793
+ margin-bottom: 12px;
794
+ color: var(--trie-warning);
795
+ }
796
+
797
+ .fix-details p {
798
+ margin-bottom: 8px;
799
+ font-size: 14px;
800
+ }
801
+
802
+ .fix-actions {
803
+ display: flex;
804
+ gap: 8px;
805
+ margin-top: 12px;
806
+ }
807
+
808
+ .chat-input-container {
809
+ background: var(--trie-surface);
810
+ border: 1px solid var(--trie-border);
811
+ border-top: none;
812
+ border-radius: 0 0 var(--radius) var(--radius);
813
+ padding: 16px;
814
+ flex-shrink: 0;
815
+ }
816
+
817
+ .input-wrapper {
818
+ display: flex;
819
+ gap: 12px;
820
+ align-items: flex-end;
821
+ }
822
+
823
+ .chat-input {
824
+ flex: 1;
825
+ min-height: 60px;
826
+ max-height: 120px;
827
+ padding: 12px;
828
+ font-size: 14px;
829
+ line-height: 1.5;
830
+ border: 1px solid var(--trie-border);
831
+ border-radius: var(--radius);
832
+ background: var(--trie-bg);
833
+ color: var(--trie-text);
834
+ resize: none;
835
+ font-family: var(--font-sans);
836
+ }
837
+
838
+ .chat-input:focus {
839
+ outline: none;
840
+ border-color: var(--trie-primary);
841
+ }
842
+
843
+ .chat-input::placeholder {
844
+ color: var(--trie-text-muted);
845
+ }
846
+
847
+ .send-button {
848
+ padding: 12px 24px;
849
+ font-size: 14px;
850
+ font-weight: 600;
851
+ border: none;
852
+ border-radius: var(--radius);
853
+ background: var(--trie-primary);
854
+ color: #fff;
855
+ cursor: pointer;
856
+ transition: all 0.15s ease;
857
+ flex-shrink: 0;
858
+ height: fit-content;
859
+ }
860
+
861
+ .send-button:hover:not(:disabled) {
862
+ background: rgba(88, 166, 255, 0.9);
863
+ }
864
+
865
+ .send-button:disabled {
866
+ opacity: 0.5;
867
+ cursor: not-allowed;
868
+ }
869
+
870
+ .input-help {
871
+ margin-top: 8px;
872
+ font-size: 12px;
873
+ color: var(--trie-text-muted);
874
+ text-align: center;
875
+ }
876
+
877
+ .app-header {
878
+ margin-bottom: 0;
879
+ }
880
+
881
+ .app-header h1 {
882
+ margin-bottom: 4px;
883
+ }
884
+
885
+ .app-header p {
886
+ color: var(--trie-text-muted);
887
+ margin-bottom: 0;
888
+ }
889
+
647
890
  </style>
648
891
  </head>
649
892
  <body>
650
893
  <div id="app" class="container"></div>
651
894
  <script type="module">
652
- var g=Object.defineProperty;var v=(s,e,t)=>e in s?g(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var c=(s,e,t)=>v(s,typeof e!="symbol"?e+"":e,t);function h(s,e,t){let i=document.createElement(s);if(e)for(let[a,n]of Object.entries(e))a==="className"?i.className=String(n):typeof n=="boolean"?n&&i.setAttribute(a,""):i.setAttribute(a,String(n));if(t)for(let a of t)typeof a=="string"?i.appendChild(document.createTextNode(a)):i.appendChild(a);return i}var o=h;function m(s){return o("div",{className:"loading"},[o("div",{className:"spinner"}),s?o("span",{className:"ml-2"},[s]):document.createTextNode("")])}function p(s,e="Loading..."){s.innerHTML="",s.appendChild(m(e))}function d(s,e){s.innerHTML="",s.appendChild(o("div",{className:"error-state"},[o("div",{className:"error-icon"},["\u26A0\uFE0F"]),o("p",{className:"error-message"},[e])]))}function u(s){document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("app");if(!e){console.error("App container not found");return}try{new s(e)}catch(t){d(e,`Failed to initialize app: ${t}`)}})}var l=class{constructor(e){c(this,"container");c(this,"hypotheses",[]);c(this,"selectedHypothesis",null);c(this,"viewMode","list");this.container=e,this.init()}async init(){await this.loadData(),this.render(),this.setupEventListeners()}async loadData(){try{p(this.container,"Loading hypotheses..."),this.hypotheses=[{id:"hyp-1",statement:"Reducing code complexity in the auth module will decrease bug reports by 40%",confidence:.7,status:"testing",evidence:[{id:"ev-1",description:"Complexity metric dropped from 15 to 8 after refactoring",type:"supporting",timestamp:new Date(Date.now()-864e5).toISOString(),source:"static analysis",confidence:.8},{id:"ev-2",description:"No new auth-related bugs reported in last 2 weeks",type:"supporting",timestamp:new Date(Date.now()-864e5*3).toISOString(),source:"bug tracking",confidence:.6}],createdAt:new Date(Date.now()-864e5*14).toISOString(),updatedAt:new Date(Date.now()-864e5).toISOString(),testCriteria:"Track bug reports for 1 month after refactoring",category:"quality"},{id:"hyp-2",statement:"Adding TypeScript to legacy JavaScript modules will improve development velocity",confidence:.6,status:"proposed",evidence:[],createdAt:new Date(Date.now()-864e5*7).toISOString(),updatedAt:new Date(Date.now()-864e5*7).toISOString(),testCriteria:"Measure feature delivery time before and after TypeScript adoption",category:"productivity"},{id:"hyp-3",statement:"Daily code reviews reduce critical bugs more than automated testing alone",confidence:.9,status:"validated",evidence:[{id:"ev-3",description:"Critical bug count decreased 60% after implementing daily reviews",type:"supporting",timestamp:new Date(Date.now()-864e5*30).toISOString(),source:"bug tracking analysis",confidence:.9},{id:"ev-4",description:"Code review participation at 95% over 3 months",type:"supporting",timestamp:new Date(Date.now()-864e5*15).toISOString(),source:"git analytics",confidence:.8}],createdAt:new Date(Date.now()-864e5*90).toISOString(),updatedAt:new Date(Date.now()-864e5*5).toISOString(),testCriteria:"Compare bug rates with and without mandatory code reviews",category:"process"}]}catch(e){d(this.container,`Failed to load hypotheses: ${e}`)}}render(){this.viewMode==="detail"&&this.selectedHypothesis?this.renderDetailView():this.renderListView()}renderListView(){let e=this.groupByStatus(),t=this.hypotheses.reduce((n,r)=>n+r.evidence.length,0),i=this.hypotheses.length>0?this.hypotheses.reduce((n,r)=>n+r.confidence,0)/this.hypotheses.length:0,a=`
895
+ var g=Object.defineProperty;var v=(a,e,t)=>e in a?g(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var c=(a,e,t)=>v(a,typeof e!="symbol"?e+"":e,t);function h(a,e,t){let i=document.createElement(a);if(e)for(let[s,n]of Object.entries(e))s==="className"?i.className=String(n):typeof n=="boolean"?n&&i.setAttribute(s,""):i.setAttribute(s,String(n));if(t)for(let s of t)typeof s=="string"?i.appendChild(document.createTextNode(s)):i.appendChild(s);return i}var o=h;function m(a){return o("div",{className:"loading"},[o("div",{className:"spinner"}),a?o("span",{className:"ml-2"},[a]):document.createTextNode("")])}function p(a,e="Loading..."){a.innerHTML="",a.appendChild(m(e))}function d(a,e){a.innerHTML="",a.appendChild(o("div",{className:"error-state"},[o("div",{className:"error-icon"},["\u26A0\uFE0F"]),o("p",{className:"error-message"},[e])]))}function u(a){document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("app");if(!e){console.error("App container not found");return}try{new a(e)}catch(t){d(e,`Failed to initialize app: ${t}`)}})}var l=class{constructor(e){c(this,"container");c(this,"hypotheses",[]);c(this,"selectedHypothesis",null);c(this,"viewMode","list");this.container=e,this.init()}async init(){await this.loadData(),this.render(),this.setupEventListeners()}async loadData(){try{p(this.container,"Loading hypotheses..."),this.hypotheses=[{id:"hyp-1",statement:"Reducing code complexity in the auth module will decrease bug reports by 40%",confidence:.7,status:"testing",evidence:[{id:"ev-1",description:"Complexity metric dropped from 15 to 8 after refactoring",type:"supporting",timestamp:new Date(Date.now()-864e5).toISOString(),source:"static analysis",confidence:.8},{id:"ev-2",description:"No new auth-related bugs reported in last 2 weeks",type:"supporting",timestamp:new Date(Date.now()-864e5*3).toISOString(),source:"bug tracking",confidence:.6}],createdAt:new Date(Date.now()-864e5*14).toISOString(),updatedAt:new Date(Date.now()-864e5).toISOString(),testCriteria:"Track bug reports for 1 month after refactoring",category:"quality"},{id:"hyp-2",statement:"Adding TypeScript to legacy JavaScript modules will improve development velocity",confidence:.6,status:"proposed",evidence:[],createdAt:new Date(Date.now()-864e5*7).toISOString(),updatedAt:new Date(Date.now()-864e5*7).toISOString(),testCriteria:"Measure feature delivery time before and after TypeScript adoption",category:"productivity"},{id:"hyp-3",statement:"Daily code reviews reduce critical bugs more than automated testing alone",confidence:.9,status:"validated",evidence:[{id:"ev-3",description:"Critical bug count decreased 60% after implementing daily reviews",type:"supporting",timestamp:new Date(Date.now()-864e5*30).toISOString(),source:"bug tracking analysis",confidence:.9},{id:"ev-4",description:"Code review participation at 95% over 3 months",type:"supporting",timestamp:new Date(Date.now()-864e5*15).toISOString(),source:"git analytics",confidence:.8}],createdAt:new Date(Date.now()-864e5*90).toISOString(),updatedAt:new Date(Date.now()-864e5*5).toISOString(),testCriteria:"Compare bug rates with and without mandatory code reviews",category:"process"}]}catch(e){d(this.container,`Failed to load hypotheses: ${e}`)}}render(){this.viewMode==="detail"&&this.selectedHypothesis?this.renderDetailView():this.renderListView()}renderListView(){let e=this.groupByStatus(),t=this.hypotheses.reduce((n,r)=>n+r.evidence.length,0),i=this.hypotheses.length>0?this.hypotheses.reduce((n,r)=>n+r.confidence,0)/this.hypotheses.length:0,s=`
653
896
  <div class="app-header">
654
897
  <h1>Hypotheses</h1>
655
898
  <p>Track and validate development theories with evidence-based reasoning</p>
@@ -671,7 +914,7 @@ var g=Object.defineProperty;var v=(s,e,t)=>e in s?g(s,e,{enumerable:!0,configura
671
914
  </div>
672
915
 
673
916
  ${Object.entries(e).map(([n,r])=>this.renderStatusSection(n,r)).join("")}
674
- `;this.container.innerHTML=a}renderDetailView(){if(!this.selectedHypothesis)return;let e=this.selectedHypothesis,t=e.evidence.filter(n=>n.type==="supporting"),i=e.evidence.filter(n=>n.type==="contradicting"),a=`
917
+ `;this.container.innerHTML=s}renderDetailView(){if(!this.selectedHypothesis)return;let e=this.selectedHypothesis,t=e.evidence.filter(n=>n.type==="supporting"),i=e.evidence.filter(n=>n.type==="contradicting"),s=`
675
918
  <div class="app-header">
676
919
  <button class="btn btn-back" onclick="goBackToList()">\u2190 Back to List</button>
677
920
  <h1>Hypothesis Detail</h1>
@@ -717,11 +960,11 @@ var g=Object.defineProperty;var v=(s,e,t)=>e in s?g(s,e,{enumerable:!0,configura
717
960
  <button class="btn" onclick="updateStatus('${e.id}')">Update Status</button>
718
961
  </div>
719
962
  </div>
720
- `;this.container.innerHTML=a}renderStatusSection(e,t){return t.length===0?"":`
963
+ `;this.container.innerHTML=s}renderStatusSection(e,t){return t.length===0?"":`
721
964
  <div class="section">
722
965
  <h2 class="section-title">${{proposed:"Proposed",testing:"Under Testing",validated:"Validated",refuted:"Refuted",inconclusive:"Inconclusive"}[e]||e} (${t.length})</h2>
723
966
  <div class="hypotheses-list">
724
- ${t.map(a=>this.renderHypothesisCard(a)).join("")}
967
+ ${t.map(s=>this.renderHypothesisCard(s)).join("")}
725
968
  </div>
726
969
  </div>
727
970
  `}renderHypothesisCard(e){let t=e.confidence>=.8?"high":e.confidence>=.6?"medium":"low";return`
@@ -761,7 +1004,7 @@ var g=Object.defineProperty;var v=(s,e,t)=>e in s?g(s,e,{enumerable:!0,configura
761
1004
  <span>${this.formatTimeAgo(e.timestamp)}</span>
762
1005
  </div>
763
1006
  </div>
764
- `}groupByStatus(){let e={};return["testing","proposed","validated","refuted","inconclusive"].forEach(i=>{e[i]=[]}),this.hypotheses.forEach(i=>{e[i.status]||(e[i.status]=[]),e[i.status].push(i)}),e}formatTimeAgo(e){let t=Date.now(),i=new Date(e).getTime(),a=t-i,n=Math.floor(a/(1e3*60*60*24));if(n>0)return`${n}d ago`;let r=Math.floor(a/(1e3*60*60));return r>0?`${r}h ago`:`${Math.floor(a/(1e3*60))}m ago`}formatDate(e){return new Date(e).toLocaleDateString()}setupEventListeners(){window.selectHypothesis=e=>{let t=this.hypotheses.find(i=>i.id===e);t&&(this.selectedHypothesis=t,this.viewMode="detail",this.render(),this.setupEventListeners())},window.goBackToList=()=>{this.viewMode="list",this.selectedHypothesis=null,this.render(),this.setupEventListeners()},window.addEvidence=e=>{console.log("Adding evidence for hypothesis:",e)},window.updateStatus=e=>{console.log("Updating status for hypothesis:",e)}}};u(l);
1007
+ `}groupByStatus(){let e={};return["testing","proposed","validated","refuted","inconclusive"].forEach(i=>{e[i]=[]}),this.hypotheses.forEach(i=>{e[i.status]||(e[i.status]=[]);let s=e[i.status];s&&s.push(i)}),e}formatTimeAgo(e){let t=Date.now(),i=new Date(e).getTime(),s=t-i,n=Math.floor(s/(1e3*60*60*24));if(n>0)return`${n}d ago`;let r=Math.floor(s/(1e3*60*60));return r>0?`${r}h ago`:`${Math.floor(s/(1e3*60))}m ago`}formatDate(e){return new Date(e).toLocaleDateString()}setupEventListeners(){window.selectHypothesis=e=>{let t=this.hypotheses.find(i=>i.id===e);t&&(this.selectedHypothesis=t,this.viewMode="detail",this.render(),this.setupEventListeners())},window.goBackToList=()=>{this.viewMode="list",this.selectedHypothesis=null,this.render(),this.setupEventListeners()},window.addEvidence=e=>{console.log("Adding evidence for hypothesis:",e)},window.updateStatus=e=>{console.log("Updating status for hypothesis:",e)}}};u(l);
765
1008
 
766
1009
  </script>
767
1010
  </body>