@indiccoder/mentis-cli 1.1.4 → 1.1.5
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/.claude/settings.local.json +8 -0
- package/.mentis/session.json +15 -0
- package/.mentis/sessions/1769189035730.json +23 -0
- package/.mentis/sessions/1769189569160.json +23 -0
- package/.mentis/sessions/1769767538672.json +23 -0
- package/.mentis/sessions/1769767785155.json +23 -0
- package/.mentis/sessions/1769768745802.json +23 -0
- package/.mentis/sessions/1769769600884.json +31 -0
- package/.mentis/sessions/1769770030160.json +31 -0
- package/.mentis/sessions/1769770606004.json +78 -0
- package/.mentis/sessions/1769771084515.json +141 -0
- package/.mentis/sessions/1769881926630.json +57 -0
- package/README.md +17 -0
- package/dist/checkpoint/CheckpointManager.js +92 -0
- package/dist/debug_google.js +61 -0
- package/dist/debug_lite.js +49 -0
- package/dist/debug_lite_headers.js +57 -0
- package/dist/debug_search.js +16 -0
- package/dist/index.js +10 -0
- package/dist/mcp/JsonRpcClient.js +16 -0
- package/dist/mcp/McpConfig.js +132 -0
- package/dist/mcp/McpManager.js +189 -0
- package/dist/repl/PersistentShell.js +20 -1
- package/dist/repl/ReplManager.js +410 -138
- package/dist/tools/AskQuestionTool.js +172 -0
- package/dist/tools/EditFileTool.js +141 -0
- package/dist/tools/FileTools.js +7 -1
- package/dist/tools/PlanModeTool.js +53 -0
- package/dist/tools/WebSearchTool.js +190 -27
- package/dist/ui/DiffViewer.js +110 -0
- package/dist/ui/InputBox.js +16 -2
- package/dist/ui/MultiFileSelector.js +123 -0
- package/dist/ui/PlanModeUI.js +105 -0
- package/dist/ui/ToolExecutor.js +154 -0
- package/dist/ui/UIManager.js +12 -2
- package/docs/MCP_INTEGRATION.md +290 -0
- package/google_dump.html +18 -0
- package/lite_dump.html +176 -0
- package/lite_headers_dump.html +176 -0
- package/package.json +16 -5
- package/scripts/test_exa_mcp.ts +90 -0
- package/src/checkpoint/CheckpointManager.ts +102 -0
- package/src/debug_google.ts +30 -0
- package/src/debug_lite.ts +18 -0
- package/src/debug_lite_headers.ts +25 -0
- package/src/debug_search.ts +18 -0
- package/src/index.ts +12 -0
- package/src/mcp/JsonRpcClient.ts +19 -0
- package/src/mcp/McpConfig.ts +153 -0
- package/src/mcp/McpManager.ts +224 -0
- package/src/repl/PersistentShell.ts +24 -1
- package/src/repl/ReplManager.ts +1521 -1204
- package/src/tools/AskQuestionTool.ts +197 -0
- package/src/tools/EditFileTool.ts +172 -0
- package/src/tools/FileTools.ts +3 -0
- package/src/tools/PlanModeTool.ts +50 -0
- package/src/tools/WebSearchTool.ts +235 -63
- package/src/ui/DiffViewer.ts +117 -0
- package/src/ui/InputBox.ts +17 -2
- package/src/ui/MultiFileSelector.ts +135 -0
- package/src/ui/PlanModeUI.ts +121 -0
- package/src/ui/ToolExecutor.ts +182 -0
- package/src/ui/UIManager.ts +15 -2
- package/console.log(tick) +0 -0
package/lite_dump.html
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<link rel="canonical" href="https://duckduckgo.com/">
|
|
7
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1">
|
|
9
|
+
<meta name="referrer" content="origin">
|
|
10
|
+
<title>
|
|
11
|
+
DuckDuckGo
|
|
12
|
+
</title>
|
|
13
|
+
<link rel="preload" href="/font/ProximaNova-Reg-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
14
|
+
<link rel="preload" href="/font/ProximaNova-Sbold-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
15
|
+
<link title="DuckDuckGo (Lite)" type="application/opensearchdescription+xml" rel="search" href="//duckduckgo.com/opensearch_lite_v2.xml">
|
|
16
|
+
<link rel="icon" href="//duckduckgo.com/favicon.ico" type="image/x-icon"/>
|
|
17
|
+
<link id="icon60" rel="apple-touch-icon" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_60x60.png?v=2"/>
|
|
18
|
+
<link id="icon76" rel="apple-touch-icon" sizes="76x76" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_76x76.png?v=2"/>
|
|
19
|
+
<link id="icon120" rel="apple-touch-icon" sizes="120x120" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_120x120.png?v=2"/>
|
|
20
|
+
<link id="icon152" rel="apple-touch-icon" sizes="152x152" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_152x152.png?v=2"/>
|
|
21
|
+
<link rel="image_src" href="//duckduckgo.com/assets/icons/meta/DDG-icon_256x256.png">
|
|
22
|
+
<link rel="stylesheet" media="handheld, all" href="//duckduckgo.com/dist/l.dedf9a21e97bacda4782.css" type="text/css"/>
|
|
23
|
+
<link rel="stylesheet" media="handheld, all" href="//duckduckgo.com/dist/lc.ddfa8c0ba43459a9159a.css" type="text/css"/>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
<a name="top"></a>
|
|
28
|
+
<center id="lite_wrapper">
|
|
29
|
+
<br>
|
|
30
|
+
<a class="header-url" href="/lite/">
|
|
31
|
+
<span class="header">DuckDuckGo</span>
|
|
32
|
+
</a>
|
|
33
|
+
<br><br>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<iframe name="ifr" width="0" height="0" border="0" class="hidden"></iframe>
|
|
37
|
+
<form id="img-form" action="//duckduckgo.com/anomaly.js?sv=lite&cc=botnet&ti=1769771205&gk=d4cd0dabcf4caa22ad92fab40844c786&p=23c1e3ae8ce8443183e624800acf2f47-400de96bf6344506909c47d5093eabfb-90c5b3630f8e4591b0eb3421592a6746-720d685b76ac4756a2055ac8fa9bfb46-748ec91a224748989ac18427b8cb595c-8950ccf4e47548c8acf6b48fd473d015-55451630e1a144eab7326e72a6e79b26-571e657124f444999081d61ce564a3ea-c0ee79efe0fa4b29b99c8dd9a8f250ed&q=expo go latest sdk&o=Q8TM7JxY%2F9CEEkw7G7UEUCYhJfMQEQUha%2BlqaB3%2B60s%3D%0A&r=inc" target="ifr" method="POST"></form>
|
|
38
|
+
<form id="challenge-form" action="//duckduckgo.com/anomaly.js?sv=lite&cc=botnet&st=1769771205&gk=d4cd0dabcf4caa22ad92fab40844c786&p=23c1e3ae8ce8443183e624800acf2f47-400de96bf6344506909c47d5093eabfb-90c5b3630f8e4591b0eb3421592a6746-720d685b76ac4756a2055ac8fa9bfb46-748ec91a224748989ac18427b8cb595c-8950ccf4e47548c8acf6b48fd473d015-55451630e1a144eab7326e72a6e79b26-571e657124f444999081d61ce564a3ea-c0ee79efe0fa4b29b99c8dd9a8f250ed&q=expo go latest sdk&o=Q8TM7JxY%2F9CEEkw7G7UEUCYhJfMQEQUha%2BlqaB3%2B60s%3D%0A&r=inc" method="POST">
|
|
39
|
+
<div class="anomaly-modal__mask">
|
|
40
|
+
<div class="anomaly-modal__modal is-ie" data-testid="anomaly-modal">
|
|
41
|
+
<div class="anomaly-modal__title">Unfortunately, bots use DuckDuckGo too.</div>
|
|
42
|
+
<div class="anomaly-modal__description">Please complete the following challenge to confirm this search was made by a human.</div>
|
|
43
|
+
<div class="anomaly-modal__instructions">Select all squares containing a duck:</div>
|
|
44
|
+
<div class="anomaly-modal__puzzle-margins">
|
|
45
|
+
<div class="anomaly-modal__puzzle">
|
|
46
|
+
|
|
47
|
+
<div class="anomaly-modal__box" data-index="0">
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<label class="" for="image-check_23c1e3ae8ce8443183e624800acf2f47" data-testid="anomaly-modal-tile-0">
|
|
51
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_23c1e3ae8ce8443183e624800acf2f47" id="image-check_23c1e3ae8ce8443183e624800acf2f47">
|
|
52
|
+
<img class="anomaly-modal__image" alt=" " id="image-23c1e3ae8ce8443183e624800acf2f47" src="../assets/anomaly/images/challenge/23c1e3ae8ce8443183e624800acf2f47.jpg" data-id="23c1e3ae8ce8443183e624800acf2f47.jpg" data-testid="anomaly-modal-image-0"></img>
|
|
53
|
+
</label>
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="anomaly-modal__box" data-index="1">
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<label class="" for="image-check_400de96bf6344506909c47d5093eabfb" data-testid="anomaly-modal-tile-1">
|
|
61
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_400de96bf6344506909c47d5093eabfb" id="image-check_400de96bf6344506909c47d5093eabfb">
|
|
62
|
+
<img class="anomaly-modal__image" alt=" " id="image-400de96bf6344506909c47d5093eabfb" src="../assets/anomaly/images/challenge/400de96bf6344506909c47d5093eabfb.jpg" data-id="400de96bf6344506909c47d5093eabfb.jpg" data-testid="anomaly-modal-image-1"></img>
|
|
63
|
+
</label>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="anomaly-modal__box" data-index="2">
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<label class="" for="image-check_90c5b3630f8e4591b0eb3421592a6746" data-testid="anomaly-modal-tile-2">
|
|
71
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_90c5b3630f8e4591b0eb3421592a6746" id="image-check_90c5b3630f8e4591b0eb3421592a6746">
|
|
72
|
+
<img class="anomaly-modal__image" alt=" " id="image-90c5b3630f8e4591b0eb3421592a6746" src="../assets/anomaly/images/challenge/90c5b3630f8e4591b0eb3421592a6746.jpg" data-id="90c5b3630f8e4591b0eb3421592a6746.jpg" data-testid="anomaly-modal-image-2"></img>
|
|
73
|
+
</label>
|
|
74
|
+
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="anomaly-modal__box" data-index="3">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<label class="" for="image-check_720d685b76ac4756a2055ac8fa9bfb46" data-testid="anomaly-modal-tile-3">
|
|
81
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_720d685b76ac4756a2055ac8fa9bfb46" id="image-check_720d685b76ac4756a2055ac8fa9bfb46">
|
|
82
|
+
<img class="anomaly-modal__image" alt=" " id="image-720d685b76ac4756a2055ac8fa9bfb46" src="../assets/anomaly/images/challenge/720d685b76ac4756a2055ac8fa9bfb46.jpg" data-id="720d685b76ac4756a2055ac8fa9bfb46.jpg" data-testid="anomaly-modal-image-3"></img>
|
|
83
|
+
</label>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="anomaly-modal__box" data-index="4">
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<label class="" for="image-check_748ec91a224748989ac18427b8cb595c" data-testid="anomaly-modal-tile-4">
|
|
91
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_748ec91a224748989ac18427b8cb595c" id="image-check_748ec91a224748989ac18427b8cb595c">
|
|
92
|
+
<img class="anomaly-modal__image" alt=" " id="image-748ec91a224748989ac18427b8cb595c" src="../assets/anomaly/images/challenge/748ec91a224748989ac18427b8cb595c.jpg" data-id="748ec91a224748989ac18427b8cb595c.jpg" data-testid="anomaly-modal-image-4"></img>
|
|
93
|
+
</label>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="anomaly-modal__box" data-index="5">
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<label class="" for="image-check_8950ccf4e47548c8acf6b48fd473d015" data-testid="anomaly-modal-tile-5">
|
|
101
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_8950ccf4e47548c8acf6b48fd473d015" id="image-check_8950ccf4e47548c8acf6b48fd473d015">
|
|
102
|
+
<img class="anomaly-modal__image" alt=" " id="image-8950ccf4e47548c8acf6b48fd473d015" src="../assets/anomaly/images/challenge/8950ccf4e47548c8acf6b48fd473d015.jpg" data-id="8950ccf4e47548c8acf6b48fd473d015.jpg" data-testid="anomaly-modal-image-5"></img>
|
|
103
|
+
</label>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="anomaly-modal__box" data-index="6">
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<label class="" for="image-check_55451630e1a144eab7326e72a6e79b26" data-testid="anomaly-modal-tile-6">
|
|
111
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_55451630e1a144eab7326e72a6e79b26" id="image-check_55451630e1a144eab7326e72a6e79b26">
|
|
112
|
+
<img class="anomaly-modal__image" alt=" " id="image-55451630e1a144eab7326e72a6e79b26" src="../assets/anomaly/images/challenge/55451630e1a144eab7326e72a6e79b26.jpg" data-id="55451630e1a144eab7326e72a6e79b26.jpg" data-testid="anomaly-modal-image-6"></img>
|
|
113
|
+
</label>
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="anomaly-modal__box" data-index="7">
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<label class="" for="image-check_571e657124f444999081d61ce564a3ea" data-testid="anomaly-modal-tile-7">
|
|
121
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_571e657124f444999081d61ce564a3ea" id="image-check_571e657124f444999081d61ce564a3ea">
|
|
122
|
+
<img class="anomaly-modal__image" alt=" " id="image-571e657124f444999081d61ce564a3ea" src="../assets/anomaly/images/challenge/571e657124f444999081d61ce564a3ea.jpg" data-id="571e657124f444999081d61ce564a3ea.jpg" data-testid="anomaly-modal-image-7"></img>
|
|
123
|
+
</label>
|
|
124
|
+
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="anomaly-modal__box" data-index="8">
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
<label class="" for="image-check_c0ee79efe0fa4b29b99c8dd9a8f250ed" data-testid="anomaly-modal-tile-8">
|
|
131
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_c0ee79efe0fa4b29b99c8dd9a8f250ed" id="image-check_c0ee79efe0fa4b29b99c8dd9a8f250ed">
|
|
132
|
+
<img class="anomaly-modal__image" alt=" " id="image-c0ee79efe0fa4b29b99c8dd9a8f250ed" src="../assets/anomaly/images/challenge/c0ee79efe0fa4b29b99c8dd9a8f250ed.jpg" data-id="c0ee79efe0fa4b29b99c8dd9a8f250ed.jpg" data-testid="anomaly-modal-image-8"></img>
|
|
133
|
+
</label>
|
|
134
|
+
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<div class="anomaly-modal__controls">
|
|
140
|
+
<button name="challenge-submit" class="btn btn--primary anomaly-modal__submit js-anomaly-modal-submit" form="challenge-form" value="d4cd0dabcf4caa22ad92fab40844c786" >Submit</button>
|
|
141
|
+
<p></p>
|
|
142
|
+
<input class="feedback-toggle" type="checkbox" id="feedback" unchecked />
|
|
143
|
+
<label for="feedback" class="feedback-text">Images not loading?</label>
|
|
144
|
+
<div class="feedback-content">
|
|
145
|
+
<label class="feedback-instructions">Please email the following code to:</label>
|
|
146
|
+
<p class="feedback-instructions">error-lite@duckduckgo.com</p>
|
|
147
|
+
<p><label class="feedback-instructions">Code: d4cd0dabcf4caa22ad92fab40844c786</label></p>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</form>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
<br>
|
|
162
|
+
<p class='html-only'>
|
|
163
|
+
<!-- This is the Lite version. Get the full-JS version <a href="https://duckduckgo.com/">here</a>. //-->
|
|
164
|
+
</p>
|
|
165
|
+
</center>
|
|
166
|
+
|
|
167
|
+
<img src="//duckduckgo.com/t/tqadb?1932999&s=lite&cc=botnet&gk=d4cd0dabcf4caa22ad92fab40844c786&iadb=0&o=Q8TM7JxY%2F9CEEkw7G7UEUCYhJfMQEQUha%2BlqaB3%2B60s%3D%0A&p=23c1e3ae8ce8443183e624800acf2f47-400de96bf6344506909c47d5093eabfb-90c5b3630f8e4591b0eb3421592a6746-720d685b76ac4756a2055ac8fa9bfb46-748ec91a224748989ac18427b8cb595c-8950ccf4e47548c8acf6b48fd473d015-55451630e1a144eab7326e72a6e79b26-571e657124f444999081d61ce564a3ea-c0ee79efe0fa4b29b99c8dd9a8f250ed&c=dadb&r=inc&i=-1&e=0&sc=1"/>
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
</body>
|
|
175
|
+
|
|
176
|
+
</html>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<link rel="canonical" href="https://duckduckgo.com/">
|
|
7
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1">
|
|
9
|
+
<meta name="referrer" content="origin">
|
|
10
|
+
<title>
|
|
11
|
+
DuckDuckGo
|
|
12
|
+
</title>
|
|
13
|
+
<link rel="preload" href="/font/ProximaNova-Reg-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
14
|
+
<link rel="preload" href="/font/ProximaNova-Sbold-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
15
|
+
<link title="DuckDuckGo (Lite)" type="application/opensearchdescription+xml" rel="search" href="//duckduckgo.com/opensearch_lite_v2.xml">
|
|
16
|
+
<link rel="icon" href="//duckduckgo.com/favicon.ico" type="image/x-icon"/>
|
|
17
|
+
<link id="icon60" rel="apple-touch-icon" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_60x60.png?v=2"/>
|
|
18
|
+
<link id="icon76" rel="apple-touch-icon" sizes="76x76" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_76x76.png?v=2"/>
|
|
19
|
+
<link id="icon120" rel="apple-touch-icon" sizes="120x120" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_120x120.png?v=2"/>
|
|
20
|
+
<link id="icon152" rel="apple-touch-icon" sizes="152x152" href="//duckduckgo.com/assets/icons/meta/DDG-iOS-icon_152x152.png?v=2"/>
|
|
21
|
+
<link rel="image_src" href="//duckduckgo.com/assets/icons/meta/DDG-icon_256x256.png">
|
|
22
|
+
<link rel="stylesheet" media="handheld, all" href="//duckduckgo.com/dist/l.dedf9a21e97bacda4782.css" type="text/css"/>
|
|
23
|
+
<link rel="stylesheet" media="handheld, all" href="//duckduckgo.com/dist/lc.ddfa8c0ba43459a9159a.css" type="text/css"/>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
<a name="top"></a>
|
|
28
|
+
<center id="lite_wrapper">
|
|
29
|
+
<br>
|
|
30
|
+
<a class="header-url" href="/lite/">
|
|
31
|
+
<span class="header">DuckDuckGo</span>
|
|
32
|
+
</a>
|
|
33
|
+
<br><br>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<iframe name="ifr" width="0" height="0" border="0" class="hidden"></iframe>
|
|
37
|
+
<form id="img-form" action="//duckduckgo.com/anomaly.js?sv=lite&cc=botnet&ti=1769771309&gk=d4cd0dabcf4caa22ad92fab40844c786&p=078f1b87107343b28c36b8cfc729b1f9-fa19bf9cb7c04c279d9201410defba41-efb9e03dea9c46f9a941639244745e40-7b9e6c0806b840fe8b427def216567ed-56217cb505c24098a3c51de321427f3b-cd92bc4698c2415e83fee212adba185e-82cc79af9a3d42799a5059d572da5297-aba51dbc3cdf4a07809f6fdabe4a5909-3af2b7c055c148e9abeb619bdbb8a91f&q=expo go latest sdk&o=xThbisvBIGndgdSvosz4lHBmBYx4LW%2F78C8zrNjk0r8%3D%0A&r=inc" target="ifr" method="POST"></form>
|
|
38
|
+
<form id="challenge-form" action="//duckduckgo.com/anomaly.js?sv=lite&cc=botnet&st=1769771309&gk=d4cd0dabcf4caa22ad92fab40844c786&p=078f1b87107343b28c36b8cfc729b1f9-fa19bf9cb7c04c279d9201410defba41-efb9e03dea9c46f9a941639244745e40-7b9e6c0806b840fe8b427def216567ed-56217cb505c24098a3c51de321427f3b-cd92bc4698c2415e83fee212adba185e-82cc79af9a3d42799a5059d572da5297-aba51dbc3cdf4a07809f6fdabe4a5909-3af2b7c055c148e9abeb619bdbb8a91f&q=expo go latest sdk&o=xThbisvBIGndgdSvosz4lHBmBYx4LW%2F78C8zrNjk0r8%3D%0A&r=inc" method="POST">
|
|
39
|
+
<div class="anomaly-modal__mask">
|
|
40
|
+
<div class="anomaly-modal__modal is-ie" data-testid="anomaly-modal">
|
|
41
|
+
<div class="anomaly-modal__title">Unfortunately, bots use DuckDuckGo too.</div>
|
|
42
|
+
<div class="anomaly-modal__description">Please complete the following challenge to confirm this search was made by a human.</div>
|
|
43
|
+
<div class="anomaly-modal__instructions">Select all squares containing a duck:</div>
|
|
44
|
+
<div class="anomaly-modal__puzzle-margins">
|
|
45
|
+
<div class="anomaly-modal__puzzle">
|
|
46
|
+
|
|
47
|
+
<div class="anomaly-modal__box" data-index="0">
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<label class="" for="image-check_078f1b87107343b28c36b8cfc729b1f9" data-testid="anomaly-modal-tile-0">
|
|
51
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_078f1b87107343b28c36b8cfc729b1f9" id="image-check_078f1b87107343b28c36b8cfc729b1f9">
|
|
52
|
+
<img class="anomaly-modal__image" alt=" " id="image-078f1b87107343b28c36b8cfc729b1f9" src="../assets/anomaly/images/challenge/078f1b87107343b28c36b8cfc729b1f9.jpg" data-id="078f1b87107343b28c36b8cfc729b1f9.jpg" data-testid="anomaly-modal-image-0"></img>
|
|
53
|
+
</label>
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="anomaly-modal__box" data-index="1">
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<label class="" for="image-check_fa19bf9cb7c04c279d9201410defba41" data-testid="anomaly-modal-tile-1">
|
|
61
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_fa19bf9cb7c04c279d9201410defba41" id="image-check_fa19bf9cb7c04c279d9201410defba41">
|
|
62
|
+
<img class="anomaly-modal__image" alt=" " id="image-fa19bf9cb7c04c279d9201410defba41" src="../assets/anomaly/images/challenge/fa19bf9cb7c04c279d9201410defba41.jpg" data-id="fa19bf9cb7c04c279d9201410defba41.jpg" data-testid="anomaly-modal-image-1"></img>
|
|
63
|
+
</label>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="anomaly-modal__box" data-index="2">
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<label class="" for="image-check_efb9e03dea9c46f9a941639244745e40" data-testid="anomaly-modal-tile-2">
|
|
71
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_efb9e03dea9c46f9a941639244745e40" id="image-check_efb9e03dea9c46f9a941639244745e40">
|
|
72
|
+
<img class="anomaly-modal__image" alt=" " id="image-efb9e03dea9c46f9a941639244745e40" src="../assets/anomaly/images/challenge/efb9e03dea9c46f9a941639244745e40.jpg" data-id="efb9e03dea9c46f9a941639244745e40.jpg" data-testid="anomaly-modal-image-2"></img>
|
|
73
|
+
</label>
|
|
74
|
+
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="anomaly-modal__box" data-index="3">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<label class="" for="image-check_7b9e6c0806b840fe8b427def216567ed" data-testid="anomaly-modal-tile-3">
|
|
81
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_7b9e6c0806b840fe8b427def216567ed" id="image-check_7b9e6c0806b840fe8b427def216567ed">
|
|
82
|
+
<img class="anomaly-modal__image" alt=" " id="image-7b9e6c0806b840fe8b427def216567ed" src="../assets/anomaly/images/challenge/7b9e6c0806b840fe8b427def216567ed.jpg" data-id="7b9e6c0806b840fe8b427def216567ed.jpg" data-testid="anomaly-modal-image-3"></img>
|
|
83
|
+
</label>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="anomaly-modal__box" data-index="4">
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<label class="" for="image-check_56217cb505c24098a3c51de321427f3b" data-testid="anomaly-modal-tile-4">
|
|
91
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_56217cb505c24098a3c51de321427f3b" id="image-check_56217cb505c24098a3c51de321427f3b">
|
|
92
|
+
<img class="anomaly-modal__image" alt=" " id="image-56217cb505c24098a3c51de321427f3b" src="../assets/anomaly/images/challenge/56217cb505c24098a3c51de321427f3b.jpg" data-id="56217cb505c24098a3c51de321427f3b.jpg" data-testid="anomaly-modal-image-4"></img>
|
|
93
|
+
</label>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="anomaly-modal__box" data-index="5">
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<label class="" for="image-check_cd92bc4698c2415e83fee212adba185e" data-testid="anomaly-modal-tile-5">
|
|
101
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_cd92bc4698c2415e83fee212adba185e" id="image-check_cd92bc4698c2415e83fee212adba185e">
|
|
102
|
+
<img class="anomaly-modal__image" alt=" " id="image-cd92bc4698c2415e83fee212adba185e" src="../assets/anomaly/images/challenge/cd92bc4698c2415e83fee212adba185e.jpg" data-id="cd92bc4698c2415e83fee212adba185e.jpg" data-testid="anomaly-modal-image-5"></img>
|
|
103
|
+
</label>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="anomaly-modal__box" data-index="6">
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<label class="" for="image-check_82cc79af9a3d42799a5059d572da5297" data-testid="anomaly-modal-tile-6">
|
|
111
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_82cc79af9a3d42799a5059d572da5297" id="image-check_82cc79af9a3d42799a5059d572da5297">
|
|
112
|
+
<img class="anomaly-modal__image" alt=" " id="image-82cc79af9a3d42799a5059d572da5297" src="../assets/anomaly/images/challenge/82cc79af9a3d42799a5059d572da5297.jpg" data-id="82cc79af9a3d42799a5059d572da5297.jpg" data-testid="anomaly-modal-image-6"></img>
|
|
113
|
+
</label>
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="anomaly-modal__box" data-index="7">
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<label class="" for="image-check_aba51dbc3cdf4a07809f6fdabe4a5909" data-testid="anomaly-modal-tile-7">
|
|
121
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_aba51dbc3cdf4a07809f6fdabe4a5909" id="image-check_aba51dbc3cdf4a07809f6fdabe4a5909">
|
|
122
|
+
<img class="anomaly-modal__image" alt=" " id="image-aba51dbc3cdf4a07809f6fdabe4a5909" src="../assets/anomaly/images/challenge/aba51dbc3cdf4a07809f6fdabe4a5909.jpg" data-id="aba51dbc3cdf4a07809f6fdabe4a5909.jpg" data-testid="anomaly-modal-image-7"></img>
|
|
123
|
+
</label>
|
|
124
|
+
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="anomaly-modal__box" data-index="8">
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
<label class="" for="image-check_3af2b7c055c148e9abeb619bdbb8a91f" data-testid="anomaly-modal-tile-8">
|
|
131
|
+
<input type="checkbox" class="anomaly-modal__check" name="image-check_3af2b7c055c148e9abeb619bdbb8a91f" id="image-check_3af2b7c055c148e9abeb619bdbb8a91f">
|
|
132
|
+
<img class="anomaly-modal__image" alt=" " id="image-3af2b7c055c148e9abeb619bdbb8a91f" src="../assets/anomaly/images/challenge/3af2b7c055c148e9abeb619bdbb8a91f.jpg" data-id="3af2b7c055c148e9abeb619bdbb8a91f.jpg" data-testid="anomaly-modal-image-8"></img>
|
|
133
|
+
</label>
|
|
134
|
+
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<div class="anomaly-modal__controls">
|
|
140
|
+
<button name="challenge-submit" class="btn btn--primary anomaly-modal__submit js-anomaly-modal-submit" form="challenge-form" value="d4cd0dabcf4caa22ad92fab40844c786" >Submit</button>
|
|
141
|
+
<p></p>
|
|
142
|
+
<input class="feedback-toggle" type="checkbox" id="feedback" unchecked />
|
|
143
|
+
<label for="feedback" class="feedback-text">Images not loading?</label>
|
|
144
|
+
<div class="feedback-content">
|
|
145
|
+
<label class="feedback-instructions">Please email the following code to:</label>
|
|
146
|
+
<p class="feedback-instructions">error-lite@duckduckgo.com</p>
|
|
147
|
+
<p><label class="feedback-instructions">Code: d4cd0dabcf4caa22ad92fab40844c786</label></p>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</form>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
<br>
|
|
162
|
+
<p class='html-only'>
|
|
163
|
+
<!-- This is the Lite version. Get the full-JS version <a href="https://duckduckgo.com/">here</a>. //-->
|
|
164
|
+
</p>
|
|
165
|
+
</center>
|
|
166
|
+
|
|
167
|
+
<img src="//duckduckgo.com/t/tqadb?1745768&s=lite&cc=botnet&p=078f1b87107343b28c36b8cfc729b1f9-fa19bf9cb7c04c279d9201410defba41-efb9e03dea9c46f9a941639244745e40-7b9e6c0806b840fe8b427def216567ed-56217cb505c24098a3c51de321427f3b-cd92bc4698c2415e83fee212adba185e-82cc79af9a3d42799a5059d572da5297-aba51dbc3cdf4a07809f6fdabe4a5909-3af2b7c055c148e9abeb619bdbb8a91f&r=inc&e=0&gk=d4cd0dabcf4caa22ad92fab40844c786&c=dadb&iadb=0&sc=1&i=-1&o=xThbisvBIGndgdSvosz4lHBmBYx4LW%2F78C8zrNjk0r8%3D%0A"/>
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
</body>
|
|
175
|
+
|
|
176
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indiccoder/mentis-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"cli-cursor": "^5.0.0",
|
|
39
39
|
"cli-highlight": "^2.1.11",
|
|
40
40
|
"commander": "^14.0.2",
|
|
41
|
+
"diff": "^8.0.3",
|
|
41
42
|
"dotenv": "^17.2.3",
|
|
42
43
|
"duck-duck-scrape": "^2.2.7",
|
|
43
44
|
"fast-glob": "^3.3.3",
|
|
@@ -71,10 +72,20 @@
|
|
|
71
72
|
"jest": {
|
|
72
73
|
"preset": "ts-jest",
|
|
73
74
|
"testEnvironment": "node",
|
|
74
|
-
"roots": [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
75
|
+
"roots": [
|
|
76
|
+
"<rootDir>/src"
|
|
77
|
+
],
|
|
78
|
+
"testMatch": [
|
|
79
|
+
"**/__tests__/**/*.ts",
|
|
80
|
+
"**/?(*.)+(spec|test).ts"
|
|
81
|
+
],
|
|
82
|
+
"collectCoverageFrom": [
|
|
83
|
+
"src/**/*.ts",
|
|
84
|
+
"!src/**/*.d.ts"
|
|
85
|
+
],
|
|
86
|
+
"transformIgnorePatterns": [
|
|
87
|
+
"node_modules/(?!(chalk)/)"
|
|
88
|
+
],
|
|
78
89
|
"coverageThreshold": {
|
|
79
90
|
"global": {
|
|
80
91
|
"branches": 20,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test script for Exa MCP server integration
|
|
5
|
+
* This script demonstrates how to use the Exa MCP server for web search
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { McpManager } from '../src/mcp/McpManager';
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
|
|
11
|
+
async function testExaMcp() {
|
|
12
|
+
console.log(chalk.cyan.bold('Testing Exa MCP Server Integration\n'));
|
|
13
|
+
|
|
14
|
+
const mcpManager = new McpManager();
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
// Check if Exa API key is available
|
|
18
|
+
if (!process.env.EXA_API_KEY) {
|
|
19
|
+
console.log(chalk.yellow('⚠️ EXA_API_KEY environment variable not set.'));
|
|
20
|
+
console.log(chalk.dim('Set it with: export EXA_API_KEY=your_api_key'));
|
|
21
|
+
console.log(chalk.dim('Or the MCP server will prompt you for it.\n'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Connect to Exa Search server
|
|
25
|
+
console.log(chalk.blue('Connecting to Exa Search MCP server...'));
|
|
26
|
+
const connection = await mcpManager.connectToServer('Exa Search');
|
|
27
|
+
|
|
28
|
+
if (!connection) {
|
|
29
|
+
console.log(chalk.red('❌ Failed to connect to Exa Search server'));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log(chalk.green('✅ Successfully connected to Exa Search!'));
|
|
34
|
+
|
|
35
|
+
// List available tools
|
|
36
|
+
const tools = connection.tools;
|
|
37
|
+
console.log(chalk.blue(`\n📦 Available tools (${tools.length}):`));
|
|
38
|
+
|
|
39
|
+
for (const tool of tools) {
|
|
40
|
+
console.log(chalk.dim(` • ${chalk.cyan(tool.name)}: ${tool.description}`));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Test a search if search tool is available
|
|
44
|
+
const searchTool = tools.find(t => t.name.toLowerCase().includes('search'));
|
|
45
|
+
if (searchTool) {
|
|
46
|
+
console.log(chalk.blue(`\n🔍 Testing ${searchTool.name}...`));
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const result = await searchTool.execute({
|
|
50
|
+
query: 'Mentis CLI MCP integration',
|
|
51
|
+
count: 3
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(chalk.green('✅ Search executed successfully!'));
|
|
55
|
+
console.log(chalk.dim('\nSearch results preview:'));
|
|
56
|
+
console.log(result.substring(0, 500) + (result.length > 500 ? '...' : ''));
|
|
57
|
+
} catch (error: any) {
|
|
58
|
+
console.log(chalk.red(`❌ Search failed: ${error.message}`));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// List all configured servers
|
|
63
|
+
console.log(chalk.blue('\n📋 All configured MCP servers:'));
|
|
64
|
+
await mcpManager.listServers();
|
|
65
|
+
|
|
66
|
+
// Test connection health
|
|
67
|
+
console.log(chalk.blue('\n🏥 Testing connection health...'));
|
|
68
|
+
const isHealthy = await mcpManager.testConnection('Exa Search');
|
|
69
|
+
console.log(isHealthy ?
|
|
70
|
+
chalk.green('✅ Connection is healthy') :
|
|
71
|
+
chalk.red('❌ Connection test failed')
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
// Disconnect
|
|
75
|
+
console.log(chalk.blue('\n🔌 Disconnecting...'));
|
|
76
|
+
await mcpManager.disconnectFromServer('Exa Search');
|
|
77
|
+
console.log(chalk.green('✅ Disconnected successfully'));
|
|
78
|
+
|
|
79
|
+
} catch (error: any) {
|
|
80
|
+
console.error(chalk.red(`❌ Error: ${error.message}`));
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Run the test
|
|
86
|
+
if (require.main === module) {
|
|
87
|
+
testExaMcp().catch(console.error);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { testExaMcp };
|
|
@@ -58,4 +58,106 @@ export class CheckpointManager {
|
|
|
58
58
|
const filePath = path.join(this.checkpointDir, `${name}.json`);
|
|
59
59
|
return fs.existsSync(filePath);
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
// ─── Per-Directory Local Session Methods ───────────────────────────────
|
|
63
|
+
|
|
64
|
+
private getLocalSessionsDir(cwd: string): string {
|
|
65
|
+
return path.join(cwd, '.mentis', 'sessions');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public saveLocalSession(cwd: string, history: ChatMessage[], files: string[]): string {
|
|
69
|
+
const timestamp = Date.now();
|
|
70
|
+
const checkpoint: Checkpoint = {
|
|
71
|
+
timestamp,
|
|
72
|
+
name: `session-${timestamp}`,
|
|
73
|
+
history,
|
|
74
|
+
files
|
|
75
|
+
};
|
|
76
|
+
const sessionsDir = this.getLocalSessionsDir(cwd);
|
|
77
|
+
fs.ensureDirSync(sessionsDir);
|
|
78
|
+
const filePath = path.join(sessionsDir, `${timestamp}.json`);
|
|
79
|
+
fs.writeJsonSync(filePath, checkpoint, { spaces: 2 });
|
|
80
|
+
return filePath;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public loadLocalSession(cwd: string, sessionId?: string): Checkpoint | null {
|
|
84
|
+
const sessionsDir = this.getLocalSessionsDir(cwd);
|
|
85
|
+
if (!fs.existsSync(sessionsDir)) return null;
|
|
86
|
+
|
|
87
|
+
let filePath: string;
|
|
88
|
+
if (sessionId) {
|
|
89
|
+
filePath = path.join(sessionsDir, `${sessionId}.json`);
|
|
90
|
+
} else {
|
|
91
|
+
// Load most recent
|
|
92
|
+
const sessions = this.listLocalSessions(cwd);
|
|
93
|
+
if (sessions.length === 0) return null;
|
|
94
|
+
filePath = path.join(sessionsDir, `${sessions[0].id}.json`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (fs.existsSync(filePath)) {
|
|
98
|
+
return fs.readJsonSync(filePath) as Checkpoint;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public listLocalSessions(cwd: string): Array<{ id: string; timestamp: number; messageCount: number; preview: string }> {
|
|
104
|
+
const sessionsDir = this.getLocalSessionsDir(cwd);
|
|
105
|
+
if (!fs.existsSync(sessionsDir)) return [];
|
|
106
|
+
|
|
107
|
+
const files = fs.readdirSync(sessionsDir);
|
|
108
|
+
|
|
109
|
+
return files
|
|
110
|
+
.filter(f => f.endsWith('.json'))
|
|
111
|
+
.map(f => {
|
|
112
|
+
const filePath = path.join(sessionsDir, f);
|
|
113
|
+
try {
|
|
114
|
+
const data = fs.readJsonSync(filePath) as Checkpoint;
|
|
115
|
+
// Extract meaningful preview from LAST user message (to show current state)
|
|
116
|
+
const lastUserMsg = [...(data.history || [])].reverse().find(m => m.role === 'user');
|
|
117
|
+
let preview = 'No preview';
|
|
118
|
+
if (lastUserMsg?.content) {
|
|
119
|
+
let clean = lastUserMsg.content;
|
|
120
|
+
|
|
121
|
+
// 1. Remove Repository Structure (explicitly)
|
|
122
|
+
clean = clean.replace(/Repository Structure:[\s\S]*?(?=\n\n|$)/g, '');
|
|
123
|
+
|
|
124
|
+
// 2. Remove "User Question:" label (if context insertion logic used it)
|
|
125
|
+
clean = clean.replace(/User Question:\s*/g, '');
|
|
126
|
+
|
|
127
|
+
// 3. Remove "Available Custom Commands" block
|
|
128
|
+
clean = clean.replace(/Available Custom Commands:[\s\S]*?(?=\n\n|$)/g, '');
|
|
129
|
+
|
|
130
|
+
// 4. Remove "Available Skills" block (if present)
|
|
131
|
+
clean = clean.replace(/Available Skills \([\s\S]*?(?=\n\n|$)/g, '');
|
|
132
|
+
clean = clean.replace(/Available Skills:[\s\S]*?(?=\n\n|$)/g, '');
|
|
133
|
+
|
|
134
|
+
// 5. Remove [SYSTEM: ...] instructions at the end
|
|
135
|
+
clean = clean.replace(/\n\[SYSTEM:[\s\S]*?\]$/g, '');
|
|
136
|
+
|
|
137
|
+
// 6. Clean up code blocks references/markdown if they were just context
|
|
138
|
+
const text = clean.trim();
|
|
139
|
+
if (text) {
|
|
140
|
+
// Take the first 50 chars of what's left
|
|
141
|
+
preview = text.substring(0, 50).replace(/\n/g, ' ');
|
|
142
|
+
} else {
|
|
143
|
+
preview = 'New Session';
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
id: f.replace('.json', ''),
|
|
148
|
+
timestamp: data.timestamp,
|
|
149
|
+
messageCount: data.history?.length || 0,
|
|
150
|
+
preview: preview.length >= 50 ? preview + '...' : preview
|
|
151
|
+
};
|
|
152
|
+
} catch {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
.filter((s): s is { id: string; timestamp: number; messageCount: number; preview: string } => s !== null)
|
|
157
|
+
.sort((a, b) => b.timestamp - a.timestamp); // Most recent first
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
public localSessionExists(cwd: string): boolean {
|
|
161
|
+
return this.listLocalSessions(cwd).length > 0;
|
|
162
|
+
}
|
|
61
163
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
import { execSync } from 'child_process';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
|
|
5
|
+
const query = "expo go latest sdk";
|
|
6
|
+
const url = `https://www.google.com/search?q=${encodeURIComponent(query)}&hl=en`;
|
|
7
|
+
console.log(`Fetching Google: ${url}`);
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
// Mimic standard browser
|
|
11
|
+
const userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
|
|
12
|
+
const cmd = `curl -s -L -A "${userAgent}" "${url}"`;
|
|
13
|
+
const html = execSync(cmd, { encoding: 'utf-8' });
|
|
14
|
+
|
|
15
|
+
fs.writeFileSync('google_dump.html', html);
|
|
16
|
+
console.log('Dumped HTML to google_dump.html. Length:', html.length);
|
|
17
|
+
|
|
18
|
+
if (html.includes('Captcha') || html.includes('unusual traffic')) {
|
|
19
|
+
console.log('BLOCKED by Google Captcha');
|
|
20
|
+
} else {
|
|
21
|
+
console.log('Seems OK? Checking for result markers...');
|
|
22
|
+
// Google uses complex class names, but often "h3" is title
|
|
23
|
+
if (html.includes('<h3')) {
|
|
24
|
+
console.log('Found h3 tags (likely titles).');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
} catch (e: any) {
|
|
29
|
+
console.error('Error:', e.message);
|
|
30
|
+
}
|