codehaven 0.14.0__py3-none-any.whl
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.
- codehaven-0.14.0.dist-info/METADATA +686 -0
- codehaven-0.14.0.dist-info/RECORD +57 -0
- codehaven-0.14.0.dist-info/WHEEL +5 -0
- codehaven-0.14.0.dist-info/entry_points.txt +3 -0
- codehaven-0.14.0.dist-info/licenses/LICENSE +21 -0
- codehaven-0.14.0.dist-info/top_level.txt +1 -0
- offline_agent/__init__.py +2 -0
- offline_agent/__main__.py +4 -0
- offline_agent/agent.py +815 -0
- offline_agent/answers.py +438 -0
- offline_agent/arabic.py +106 -0
- offline_agent/changes.py +228 -0
- offline_agent/chats.py +121 -0
- offline_agent/cli.py +379 -0
- offline_agent/coder.py +199 -0
- offline_agent/dependencies.py +132 -0
- offline_agent/doctor.py +190 -0
- offline_agent/documents.py +189 -0
- offline_agent/edits.py +204 -0
- offline_agent/errors.py +41 -0
- offline_agent/evaluation.py +284 -0
- offline_agent/evidence.py +187 -0
- offline_agent/exclusions.py +95 -0
- offline_agent/export.py +27 -0
- offline_agent/gui.css +237 -0
- offline_agent/gui.html +177 -0
- offline_agent/gui.js +1213 -0
- offline_agent/gui.py +967 -0
- offline_agent/gui_arabic.js +226 -0
- offline_agent/guides.py +203 -0
- offline_agent/history.py +126 -0
- offline_agent/index_cache.py +78 -0
- offline_agent/insights.py +333 -0
- offline_agent/javascript.py +200 -0
- offline_agent/knowledge.py +569 -0
- offline_agent/languages.py +396 -0
- offline_agent/memory.py +192 -0
- offline_agent/messages.py +51 -0
- offline_agent/model.py +498 -0
- offline_agent/more_languages.py +253 -0
- offline_agent/ocr.py +204 -0
- offline_agent/prompts.py +130 -0
- offline_agent/references/langgraph-approvals.md +38 -0
- offline_agent/references/langgraph-checkpoints.md +37 -0
- offline_agent/references/langgraph-graphs.md +42 -0
- offline_agent/references/langgraph.md +49 -0
- offline_agent/review.py +205 -0
- offline_agent/scans.py +325 -0
- offline_agent/semantic.py +264 -0
- offline_agent/slash.py +53 -0
- offline_agent/study.py +210 -0
- offline_agent/symbols.py +201 -0
- offline_agent/tasks.py +164 -0
- offline_agent/test_runner.py +264 -0
- offline_agent/trace.py +239 -0
- offline_agent/tracebacks.py +98 -0
- offline_agent/workspace.py +419 -0
offline_agent/gui.html
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>CodeHaven</title>
|
|
7
|
+
<style>
|
|
8
|
+
/*__STYLE__*/</style>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div class="app">
|
|
12
|
+
<aside class="sidebar">
|
|
13
|
+
<div class="brand">
|
|
14
|
+
<svg class="logo" viewBox="0 0 48 48" role="img" aria-label="CodeHaven logo">
|
|
15
|
+
<path d="M24 3.5 41.5 10v13.6c0 10.4-7.3 18.6-17.5 21.4C13.8 42.2 6.5 34 6.5 23.6V10Z" fill="var(--accent)"/>
|
|
16
|
+
<path d="M24 8.6 37 13.4v10.2c0 7.8-5.3 14-13 16.5-7.7-2.5-13-8.7-13-16.5V13.4Z" fill="none" stroke="var(--accent-text)" stroke-opacity=".35" stroke-width="1.2"/>
|
|
17
|
+
<path d="m18.5 18.5-5.5 5.5 5.5 5.5M29.5 18.5l5.5 5.5-5.5 5.5M26.2 16.5l-4.4 15" fill="none" stroke="var(--accent-text)" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
18
|
+
</svg>
|
|
19
|
+
<div>
|
|
20
|
+
<h1>CodeHaven</h1>
|
|
21
|
+
<p class="slogan">Understands your code. Works offline.</p>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="offline-card">
|
|
25
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
26
|
+
<path d="M3 3l18 18"/><path d="M8.5 8.6A5 5 0 0 0 6.6 12 4 4 0 0 0 7 20h10.5M20.4 17.6A3.5 3.5 0 0 0 17.5 12h-.6a6 6 0 0 0-7-5.8"/>
|
|
27
|
+
</svg>
|
|
28
|
+
<div><strong>Offline and read-only</strong><span id="offline-text">Your code stays on this computer, and CodeHaven never changes your files.</span></div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="section">
|
|
31
|
+
<h2>Open a project</h2>
|
|
32
|
+
<input type="text" id="path" placeholder="/Users/you/dev/project" autocomplete="off" spellcheck="false" aria-label="Repository folder">
|
|
33
|
+
<div class="row">
|
|
34
|
+
<button id="browse">Browse…</button>
|
|
35
|
+
<button id="index" class="primary">Index</button>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="index-status" id="index-status">Choose your project folder, then click Index.</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="section" id="clone-section" hidden>
|
|
40
|
+
<h2>Or from GitHub</h2>
|
|
41
|
+
<input type="text" id="github" placeholder="github.com/owner/repository" autocomplete="off" spellcheck="false" aria-label="GitHub repository address">
|
|
42
|
+
<div class="row"><button id="clone">Download and index</button></div>
|
|
43
|
+
<div class="index-status" id="clone-status" title="Private repositories work only if git on this computer is already signed in to GitHub.">Downloads once, then opens offline. Nothing is uploaded, and CodeHaven never asks for your password.</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="section">
|
|
46
|
+
<h2>Or one file</h2>
|
|
47
|
+
<input type="file" id="file-input" hidden>
|
|
48
|
+
<div class="upload-row"><button id="upload">Upload a file…</button></div>
|
|
49
|
+
<div class="index-status" id="upload-status" title="Text files up to 64 KB. Notebooks (.ipynb), PDFs, and PNG or JPEG pictures of code up to 8 MB are read into a text file you can save. The copy CodeHaven reads is deleted when you open something else.">A text file, notebook, PDF, or picture of code. You can also drop or paste it anywhere on the page.</div>
|
|
50
|
+
<div class="index-status" id="picture-status" hidden></div>
|
|
51
|
+
<div class="upload-row" id="save-row" hidden><button id="save-text">Save the file…</button></div>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="section recent" id="recent-section" hidden>
|
|
54
|
+
<h2>Recent projects</h2>
|
|
55
|
+
<div id="recent"></div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="section recent">
|
|
58
|
+
<h2>Chats</h2>
|
|
59
|
+
<button id="new-chat" disabled>+ New chat</button>
|
|
60
|
+
<button id="save-chat" disabled title="Save this chat as a Markdown file, through your browser. Nothing leaves this computer.">Save chat…</button>
|
|
61
|
+
<button id="undo-change" hidden title="Put back the files of the last change CodeHaven made in this repository.">Undo last change</button>
|
|
62
|
+
<div id="chats-section" hidden title="Saved on this computer only. Click a chat to reopen it."><div id="chats"></div></div>
|
|
63
|
+
<div class="index-status" id="memory-status">Follow-up questions remember the last 8 questions.</div>
|
|
64
|
+
</div>
|
|
65
|
+
<details class="section settings" id="settings">
|
|
66
|
+
<summary>Settings</summary>
|
|
67
|
+
<label class="field" for="model">Model</label>
|
|
68
|
+
<select id="model" aria-label="Local model"><option>Loading…</option></select>
|
|
69
|
+
<div class="index-status" id="model-status">Models installed in Ollama on this computer.</div>
|
|
70
|
+
<div id="saved-section" hidden>
|
|
71
|
+
<div class="field">Memory</div>
|
|
72
|
+
<div class="index-status" id="saved-status"></div>
|
|
73
|
+
<div class="row"><button id="forget" disabled>Forget this project</button></div>
|
|
74
|
+
</div>
|
|
75
|
+
</details>
|
|
76
|
+
<div class="privacy">Runs on this computer with <span id="model-name">a local model</span>. <span id="privacy-network">Nothing is sent to the internet.</span><span id="privacy-saved"></span></div>
|
|
77
|
+
</aside>
|
|
78
|
+
|
|
79
|
+
<main class="main" data-drop="Drop a file to chat about it">
|
|
80
|
+
<div class="topbar">
|
|
81
|
+
<button id="menu" class="menu" aria-label="Open the sidebar" title="Projects, chats, and settings">☰</button>
|
|
82
|
+
<div class="repo empty" id="repo-label">No project open</div>
|
|
83
|
+
<div class="tabs" role="group" aria-label="View">
|
|
84
|
+
<button id="tab-chat" aria-pressed="true">Chat</button>
|
|
85
|
+
<button id="tab-map" aria-pressed="false" disabled>Map</button>
|
|
86
|
+
<button id="tab-cards" aria-pressed="false" disabled>Flashcards</button>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="spacer"></div>
|
|
89
|
+
<button id="language" class="lang" lang="ar" title="اعرض هذه الصفحة بالعربية">العربية</button>
|
|
90
|
+
<span class="pill" id="index-pill" hidden></span>
|
|
91
|
+
<span class="pill offline" id="offline-pill" title="CodeHaven runs only on this computer and never connects to the internet">Offline</span>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="view" id="view-chat">
|
|
94
|
+
<div class="messages" id="messages">
|
|
95
|
+
<div class="messages-inner" id="messages-inner">
|
|
96
|
+
<div class="empty-state" id="empty">
|
|
97
|
+
<h2 id="empty-title">Understand any codebase, offline</h2>
|
|
98
|
+
<p id="empty-text">Open a project folder or a single file, then ask how something works.<br>Answers cite the exact lines they rely on.</p>
|
|
99
|
+
<div class="start" id="start">
|
|
100
|
+
<button id="start-folder" class="primary">Choose a folder…</button>
|
|
101
|
+
<button id="start-file">Upload a file…</button>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="suggest-label" id="suggest-label" hidden>Try asking</div>
|
|
104
|
+
<div class="suggestions" id="suggestions" hidden></div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="composer">
|
|
109
|
+
<div class="composer-inner">
|
|
110
|
+
<button id="attach" title="Attach a file, notebook, PDF, or picture of code" aria-label="Attach a file, notebook, PDF, or picture of code"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 11.5l-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.9-8.9a3.7 3.7 0 0 1 5.2 5.2l-8.9 8.9a1.8 1.8 0 0 1-2.6-2.6l8.2-8.2"/></svg></button>
|
|
111
|
+
<textarea id="question" rows="1" dir="auto" placeholder="Open a project or upload a file first" disabled aria-label="Question"></textarea>
|
|
112
|
+
<button id="send" class="primary" disabled>Ask</button>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="hint">Enter to send · Shift+Enter for a new line · Name files and functions exactly for the best answers</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="view" id="view-map" hidden>
|
|
118
|
+
<div class="study-bar">
|
|
119
|
+
<span class="chosen none" data-chosen></span>
|
|
120
|
+
<button data-choose>Choose files…</button>
|
|
121
|
+
<button id="map-back" hidden>← All files</button>
|
|
122
|
+
<span class="spacer"></span>
|
|
123
|
+
<button id="map-draw" class="primary">Draw map</button>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="study-status" id="map-status">Choose one file to see its functions and classes and which call which, or several files to see how they import each other. The map is drawn from the code itself, without the model, so it is instant.</div>
|
|
126
|
+
<div class="map-scroll"><svg id="map-svg" role="img" aria-label="Structure map" width="0" height="0"></svg></div>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="view" id="view-cards" hidden>
|
|
129
|
+
<div class="study-bar">
|
|
130
|
+
<span class="chosen none" data-chosen></span>
|
|
131
|
+
<button data-choose>Choose files…</button>
|
|
132
|
+
<span class="spacer"></span>
|
|
133
|
+
<label>Cards per file <select id="cards-count"></select></label>
|
|
134
|
+
<button id="cards-make" class="primary">Make flashcards</button>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="study-status" id="cards-status">Choose one or more files and the local model writes question-and-answer cards about them. Each answer links to the lines it is about. One file takes about as long as one chat answer.</div>
|
|
137
|
+
<div class="cards-body">
|
|
138
|
+
<div class="deck" id="deck" hidden>
|
|
139
|
+
<div class="flashcard" id="flashcard" role="button" tabindex="0" aria-live="polite">
|
|
140
|
+
<span class="side" id="card-side"></span>
|
|
141
|
+
<div class="text" id="card-text"></div>
|
|
142
|
+
<div class="source" id="card-source"></div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="deck-nav">
|
|
145
|
+
<button id="card-prev">← Previous</button>
|
|
146
|
+
<span class="count" id="card-count"></span>
|
|
147
|
+
<button id="card-flip" class="primary">Show answer</button>
|
|
148
|
+
<button id="card-next">Next →</button>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="deck-tools"><button id="cards-shuffle">Shuffle</button><button id="cards-copy">Copy all as text</button><button id="cards-save" title="A text file with one card per line, question then answer, separated by a tab. Anki and most flashcard apps import it.">Save for Anki…</button></div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</main>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="overlay" id="overlay"></div>
|
|
158
|
+
<div class="toast" id="toast" role="alert" hidden></div>
|
|
159
|
+
<div class="modal" id="browser" role="dialog" aria-modal="true" aria-label="Choose a folder">
|
|
160
|
+
<header><button id="up" aria-label="Parent folder">↑</button><div class="where" id="browser-path"></div></header>
|
|
161
|
+
<div class="list" id="browser-list"></div>
|
|
162
|
+
<footer><button id="browser-cancel">Cancel</button><button id="browser-use" class="primary">Use this folder</button></footer>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="modal" id="picker" role="dialog" aria-modal="true" aria-label="Choose files">
|
|
165
|
+
<header><input type="text" class="picker-filter" id="picker-filter" placeholder="Filter files, such as pricing or tests/" autocomplete="off" spellcheck="false" aria-label="Filter files"></header>
|
|
166
|
+
<div class="list" id="picker-list"></div>
|
|
167
|
+
<footer><span class="note" id="picker-note"></span><button id="picker-clear">Clear</button><button id="picker-done" class="primary">Done</button></footer>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="drawer" id="drawer" role="dialog" aria-label="Cited code">
|
|
170
|
+
<header><div class="where" id="drawer-title"></div><a id="drawer-editor" hidden title="Opens this file at the cited line in VS Code on this computer. Nothing is sent anywhere.">Open in VS Code</a><button id="drawer-close">Close</button></header>
|
|
171
|
+
<div class="code" id="drawer-code"></div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<script nonce="__NONCE__">
|
|
175
|
+
/*__SCRIPT__*/</script>
|
|
176
|
+
</body>
|
|
177
|
+
</html>
|