coder-agent 0.1.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.
- coder_agent-0.1.0.dist-info/METADATA +262 -0
- coder_agent-0.1.0.dist-info/RECORD +163 -0
- coder_agent-0.1.0.dist-info/WHEEL +5 -0
- coder_agent-0.1.0.dist-info/entry_points.txt +2 -0
- coder_agent-0.1.0.dist-info/licenses/LICENSE.md +21 -0
- coder_agent-0.1.0.dist-info/top_level.txt +1 -0
- coderagent/__init__.py +20 -0
- coderagent/compat/__init__.py +27 -0
- coderagent/compat/cache_control.py +69 -0
- coderagent/compat/config_spec.py +60 -0
- coderagent/compat/exceptions.py +20 -0
- coderagent/compat/retry.py +27 -0
- coderagent/compat/serialize.py +31 -0
- coderagent/config/__init__.py +1 -0
- coderagent/config/defaults.yaml +103 -0
- coderagent/config/loader.py +264 -0
- coderagent/config/schema.py +548 -0
- coderagent/config/writer.py +218 -0
- coderagent/core/__init__.py +1 -0
- coderagent/core/budget.py +47 -0
- coderagent/core/capabilities.py +136 -0
- coderagent/core/checkpoint.py +164 -0
- coderagent/core/content.py +156 -0
- coderagent/core/context.py +618 -0
- coderagent/core/events.py +83 -0
- coderagent/core/history.py +56 -0
- coderagent/core/instructions.py +99 -0
- coderagent/core/loop.py +702 -0
- coderagent/core/memory.py +56 -0
- coderagent/core/mentions.py +81 -0
- coderagent/core/os_sandbox.py +191 -0
- coderagent/core/otel.py +214 -0
- coderagent/core/protocols.py +38 -0
- coderagent/core/redact.py +49 -0
- coderagent/core/sandbox.py +82 -0
- coderagent/core/schema.py +107 -0
- coderagent/core/session.py +344 -0
- coderagent/core/shell_env.py +74 -0
- coderagent/core/subagent.py +474 -0
- coderagent/core/summarize.py +312 -0
- coderagent/core/telemetry.py +209 -0
- coderagent/core/tokens.py +132 -0
- coderagent/core/trust.py +301 -0
- coderagent/environments/__init__.py +11 -0
- coderagent/environments/bubblewrap.py +150 -0
- coderagent/environments/contree.py +146 -0
- coderagent/environments/docker.py +160 -0
- coderagent/environments/local.py +110 -0
- coderagent/environments/singularity.py +138 -0
- coderagent/environments/swerex_docker.py +79 -0
- coderagent/environments/swerex_modal.py +123 -0
- coderagent/eval/__init__.py +1 -0
- coderagent/eval/compare.py +190 -0
- coderagent/eval/report.py +141 -0
- coderagent/eval/runner.py +368 -0
- coderagent/eval/task.py +194 -0
- coderagent/extensions/__init__.py +1 -0
- coderagent/extensions/hooks.py +121 -0
- coderagent/extensions/plugins.py +217 -0
- coderagent/extensions/reflect.py +342 -0
- coderagent/models/__init__.py +33 -0
- coderagent/models/backends.py +218 -0
- coderagent/models/call.py +18 -0
- coderagent/models/check.py +139 -0
- coderagent/models/gateway.py +60 -0
- coderagent/models/litellm_config.py +70 -0
- coderagent/models/provider.py +98 -0
- coderagent/models/reasoning.py +28 -0
- coderagent/models/router.py +136 -0
- coderagent/models/settings.py +172 -0
- coderagent/models/streaming.py +122 -0
- coderagent/models/verbosity.py +14 -0
- coderagent/paths.py +31 -0
- coderagent/run.py +454 -0
- coderagent/skills/__init__.py +119 -0
- coderagent/skills/errors.py +11 -0
- coderagent/skills/install.py +340 -0
- coderagent/skills/presets/code-review/SKILL.md +35 -0
- coderagent/skills/presets/codebase-onboarding/SKILL.md +33 -0
- coderagent/skills/presets/data-analysis/SKILL.md +35 -0
- coderagent/skills/presets/deep-research/SKILL.md +38 -0
- coderagent/skills/presets/frontend-dev/SKILL.md +32 -0
- coderagent/skills/presets/long-document/SKILL.md +37 -0
- coderagent/skills/presets/long-document/scripts/pdf_text.py +37 -0
- coderagent/skills/presets/office-docx/SKILL.md +36 -0
- coderagent/skills/presets/office-docx/scripts/docx_text.py +36 -0
- coderagent/skills/presets/office-pptx/SKILL.md +32 -0
- coderagent/skills/presets/office-xlsx/SKILL.md +34 -0
- coderagent/skills/presets/office-xlsx/scripts/xlsx_text.py +72 -0
- coderagent/skills/presets/writing/SKILL.md +31 -0
- coderagent/skills/sandbox.py +269 -0
- coderagent/skills/sites.py +177 -0
- coderagent/skills/source.py +404 -0
- coderagent/testing/__init__.py +5 -0
- coderagent/testing/factory.py +59 -0
- coderagent/testing/scripted_model.py +54 -0
- coderagent/tools/__init__.py +1 -0
- coderagent/tools/base.py +54 -0
- coderagent/tools/bash_policy.py +486 -0
- coderagent/tools/builtin/__init__.py +35 -0
- coderagent/tools/builtin/fs.py +283 -0
- coderagent/tools/builtin/patch.py +279 -0
- coderagent/tools/builtin/search.py +242 -0
- coderagent/tools/builtin/shell.py +336 -0
- coderagent/tools/builtin/skill.py +41 -0
- coderagent/tools/builtin/task.py +53 -0
- coderagent/tools/builtin/todo.py +63 -0
- coderagent/tools/executor.py +243 -0
- coderagent/tools/mcp.py +317 -0
- coderagent/tools/permissions.py +472 -0
- coderagent/tools/registry.py +83 -0
- coderagent/tools/rules.py +138 -0
- coderagent/ui/__init__.py +1 -0
- coderagent/ui/cli.py +498 -0
- coderagent/ui/commands/__init__.py +109 -0
- coderagent/ui/commands/builtin.py +778 -0
- coderagent/ui/commands/compact.py +12 -0
- coderagent/ui/commands/resume.py +26 -0
- coderagent/ui/commands/review.py +73 -0
- coderagent/ui/commands/rewind.py +28 -0
- coderagent/ui/custom_commands.py +179 -0
- coderagent/ui/notify.py +46 -0
- coderagent/ui/open_file.py +48 -0
- coderagent/ui/render.py +62 -0
- coderagent/ui/spinner.py +68 -0
- coderagent/ui/tui.py +610 -0
- coderagent/ui/widgets/__init__.py +29 -0
- coderagent/ui/widgets/approval_prompt.py +129 -0
- coderagent/ui/widgets/diff_view.py +97 -0
- coderagent/ui/widgets/file_tree.py +105 -0
- coderagent/ui/widgets/markdown_message.py +44 -0
- coderagent/ui/widgets/markup.py +10 -0
- coderagent/ui/widgets/message_block.py +61 -0
- coderagent/ui/widgets/path_suggester.py +66 -0
- coderagent/ui/widgets/session_picker.py +49 -0
- coderagent/ui/widgets/status_bar.py +44 -0
- coderagent/ui/widgets/todo_panel.py +40 -0
- coderagent/ui/widgets/tool_card.py +104 -0
- coderagent/ui/widgets/working_dots.py +26 -0
- coderagent/version.py +7 -0
- coderagent/web/__init__.py +5 -0
- coderagent/web/api.py +449 -0
- coderagent/web/app.py +113 -0
- coderagent/web/approver.py +73 -0
- coderagent/web/config_api.py +53 -0
- coderagent/web/events.py +159 -0
- coderagent/web/files.py +115 -0
- coderagent/web/i18n.py +346 -0
- coderagent/web/server.py +100 -0
- coderagent/web/sessions.py +404 -0
- coderagent/web/skills_api.py +376 -0
- coderagent/web/static/app.css +283 -0
- coderagent/web/static/app.js +1466 -0
- coderagent/web/templates/en/base.html +31 -0
- coderagent/web/templates/en/chat.html +60 -0
- coderagent/web/templates/en/macros.html +9 -0
- coderagent/web/templates/en/settings.html +80 -0
- coderagent/web/templates/en/skills.html +64 -0
- coderagent/web/templates/zh/base.html +31 -0
- coderagent/web/templates/zh/chat.html +60 -0
- coderagent/web/templates/zh/macros.html +9 -0
- coderagent/web/templates/zh/settings.html +77 -0
- coderagent/web/templates/zh/skills.html +61 -0
|
@@ -0,0 +1,31 @@
|
|
|
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>{% block title %}coder{% endblock %}</title>
|
|
7
|
+
<link rel="stylesheet" href="/static/app.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<header class="topbar">
|
|
11
|
+
<a class="brand" href="/">coder</a>
|
|
12
|
+
<nav>
|
|
13
|
+
<a href="/">Chat</a>
|
|
14
|
+
<a href="/skills">Skills</a>
|
|
15
|
+
<a href="/settings">Settings</a>
|
|
16
|
+
</nav>
|
|
17
|
+
<span class="spacer"></span>
|
|
18
|
+
<select class="language" title="the language you pick here wins over the region of your address"
|
|
19
|
+
onchange="chooseLanguage(this.value)">
|
|
20
|
+
{% for option in languages %}
|
|
21
|
+
<option value="{{ option.code }}"{% if option.code == language %} selected{% endif %}>{{ option.name }}</option>
|
|
22
|
+
{% endfor %}
|
|
23
|
+
</select>
|
|
24
|
+
<span class="status" id="status">no session</span>
|
|
25
|
+
</header>
|
|
26
|
+
{% block content %}{% endblock %}
|
|
27
|
+
<script>window.STRINGS = {{ strings | tojson }};</script>
|
|
28
|
+
<script>window.DOT_FRAMES = {{ dots | tojson }};</script>
|
|
29
|
+
<script src="/static/app.js"></script>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% import "macros.html" as macros %}
|
|
3
|
+
{% block title %}coder — chat{% endblock %}
|
|
4
|
+
{% block content %}
|
|
5
|
+
<div class="layout">
|
|
6
|
+
<aside class="sidebar">
|
|
7
|
+
<section>
|
|
8
|
+
<h2>Sessions</h2>
|
|
9
|
+
<button id="new-session" class="primary">New session</button>
|
|
10
|
+
<ul id="sessions" class="list"></ul>
|
|
11
|
+
</section>
|
|
12
|
+
<section>
|
|
13
|
+
<h2>Files</h2>
|
|
14
|
+
<div class="row">
|
|
15
|
+
<input id="file-path" placeholder="path" value=".">
|
|
16
|
+
<button id="list-files">List</button>
|
|
17
|
+
</div>
|
|
18
|
+
<ul id="files" class="list"></ul>
|
|
19
|
+
</section>
|
|
20
|
+
</aside>
|
|
21
|
+
|
|
22
|
+
<main class="conversation">
|
|
23
|
+
<div id="messages" class="messages"></div>
|
|
24
|
+
<button id="to-latest" class="to-latest" hidden>Jump to the newest</button>
|
|
25
|
+
<form id="composer" class="composer">
|
|
26
|
+
<div id="attachments" class="attachments"></div>
|
|
27
|
+
<div class="composer-row">
|
|
28
|
+
<button type="button" id="attach-image" class="attach" title="{{ strings.attach_image }}" aria-label="{{ strings.attach_image }}">
|
|
29
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
30
|
+
<path d="M8 2.5v11M2.5 8h11" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" fill="none" />
|
|
31
|
+
</svg>
|
|
32
|
+
</button>
|
|
33
|
+
<textarea id="input" rows="2" placeholder="Message the agent, or a command like /help"></textarea>
|
|
34
|
+
<input type="file" id="attach" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden>
|
|
35
|
+
<button type="submit" class="primary">Send</button>
|
|
36
|
+
</div>
|
|
37
|
+
</form>
|
|
38
|
+
<div class="row commands">
|
|
39
|
+
<select id="command-list"></select>
|
|
40
|
+
<button id="run-command">Run</button>
|
|
41
|
+
<button id="review">Review the changes</button>
|
|
42
|
+
<button id="interrupt">Interrupt</button>
|
|
43
|
+
</div>
|
|
44
|
+
</main>
|
|
45
|
+
|
|
46
|
+
<aside class="inspector">
|
|
47
|
+
<h2>Permissions</h2>
|
|
48
|
+
<label>Mode {{ macros.permission_modes("permission-mode") }}</label>
|
|
49
|
+
<p class="note" id="mode-note"></p>
|
|
50
|
+
<h2>Status</h2>
|
|
51
|
+
<dl id="status-fields"></dl>
|
|
52
|
+
<h2>Sub agents</h2>
|
|
53
|
+
<div id="agents"></div>
|
|
54
|
+
<h2>Changes</h2>
|
|
55
|
+
<div id="changes"></div>
|
|
56
|
+
<h2>File</h2>
|
|
57
|
+
<pre id="file-view"></pre>
|
|
58
|
+
</aside>
|
|
59
|
+
</div>
|
|
60
|
+
{% endblock %}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{% macro permission_modes(element_id) %}
|
|
2
|
+
<select id="{{ element_id }}">
|
|
3
|
+
<option value="default" title="Every tool that changes something asks for approval.">default</option>
|
|
4
|
+
<option value="acceptEdits" title="The writes go through, everything else asks for approval.">acceptEdits</option>
|
|
5
|
+
<option value="plan" title="Read only: the agent looks around and writes down the plan.">plan</option>
|
|
6
|
+
<option value="readonly" title="Read only: the agent looks around and answers.">readonly</option>
|
|
7
|
+
<option value="bypass" title="Nothing is asked: every tool call is allowed. For unattended runs.">bypass</option>
|
|
8
|
+
</select>
|
|
9
|
+
{% endmacro %}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% import "macros.html" as macros %}
|
|
3
|
+
{% block title %}coder — settings{% endblock %}
|
|
4
|
+
{% block content %}
|
|
5
|
+
<main class="page">
|
|
6
|
+
<h1>Model</h1>
|
|
7
|
+
<p class="note">
|
|
8
|
+
The settings are written to the user level configuration file
|
|
9
|
+
(<code id="config-path">~/.coderagent/config.yaml</code>). The project level file is never written.
|
|
10
|
+
A new session picks the new settings up; the running session keeps the model it has.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<form id="model-form">
|
|
14
|
+
<label>Model name
|
|
15
|
+
<input id="model-name" placeholder="deepseek/deepseek-flash">
|
|
16
|
+
<small id="model-provider" class="source"></small>
|
|
17
|
+
<small class="source">the provider may be written in front of the name (<code>openai/MiniMax-M2.7</code>, <code>openai:MiniMax-M2.7</code>) or left out (<code>MiniMax-M2.7</code>). Without one, the endpoint and the family of the model decide</small>
|
|
18
|
+
</label>
|
|
19
|
+
<label>API base
|
|
20
|
+
<input id="api-base" placeholder="https://api.deepseek.com">
|
|
21
|
+
</label>
|
|
22
|
+
<label>API key
|
|
23
|
+
<input id="api-key" type="password" placeholder="click to show it">
|
|
24
|
+
<small id="model-key-source" class="source"></small>
|
|
25
|
+
<small class="source">a click shows the key, a second click hides it again</small>
|
|
26
|
+
</label>
|
|
27
|
+
<label>Max retries
|
|
28
|
+
<input id="max-retries" type="number" min="0" max="20">
|
|
29
|
+
</label>
|
|
30
|
+
<p class="note">
|
|
31
|
+
The rest of the model (the thinking budget, the routing, the extra
|
|
32
|
+
parameters) is written in the configuration file.
|
|
33
|
+
</p>
|
|
34
|
+
<div class="row">
|
|
35
|
+
<button type="submit" class="primary">Save</button>
|
|
36
|
+
<button type="button" id="model-test">Test</button>
|
|
37
|
+
<span id="config-message" class="note"></span>
|
|
38
|
+
</div>
|
|
39
|
+
<p class="note" id="model-test-result"></p>
|
|
40
|
+
<p class="note">
|
|
41
|
+
The test tries the settings of this form out. It writes nothing: saving is
|
|
42
|
+
a step of its own, and a setting that does not work yet is worth writing down.
|
|
43
|
+
</p>
|
|
44
|
+
</form>
|
|
45
|
+
|
|
46
|
+
<h2>Permissions</h2>
|
|
47
|
+
<p class="note">
|
|
48
|
+
The permissions go to the same user level configuration file. A new session
|
|
49
|
+
picks the mode up; the running session keeps the mode it has. The mode of a
|
|
50
|
+
running session is in the chat page.
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<form id="permissions-form">
|
|
54
|
+
<label>Mode
|
|
55
|
+
{{ macros.permission_modes("permission-mode") }}
|
|
56
|
+
<small id="source-mode" class="source"></small>
|
|
57
|
+
</label>
|
|
58
|
+
<label>Denied paths
|
|
59
|
+
<textarea id="deny-paths" rows="3" placeholder="secrets/"></textarea>
|
|
60
|
+
<small class="source">one path per line: the agent may not touch them</small>
|
|
61
|
+
</label>
|
|
62
|
+
<label>Extra directories
|
|
63
|
+
<textarea id="include-dirs" rows="3" placeholder="/path/to/other/project"></textarea>
|
|
64
|
+
<small class="source">one path per line: directories outside the working directory the agent may still touch</small>
|
|
65
|
+
</label>
|
|
66
|
+
<label>Network
|
|
67
|
+
<select id="network">
|
|
68
|
+
<option value="allow" title="The commands that reach the network ask for approval.">allow</option>
|
|
69
|
+
<option value="deny" title="The commands that reach the network are refused.">deny</option>
|
|
70
|
+
</select>
|
|
71
|
+
<small id="source-network" class="source"></small>
|
|
72
|
+
</label>
|
|
73
|
+
<div class="row">
|
|
74
|
+
<button type="submit" class="primary">Save</button>
|
|
75
|
+
<span id="permissions-message" class="note"></span>
|
|
76
|
+
</div>
|
|
77
|
+
<p class="note" id="server-mode-note"></p>
|
|
78
|
+
</form>
|
|
79
|
+
</main>
|
|
80
|
+
{% endblock %}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% block title %}coder — skills{% endblock %}
|
|
3
|
+
{% block content %}
|
|
4
|
+
<main class="page" id="skills-page">
|
|
5
|
+
<h1>Skills</h1>
|
|
6
|
+
<p class="note">
|
|
7
|
+
A skill is a package of instructions the model may load when a task fits it.
|
|
8
|
+
The ones below are in <code>~/.coderagent/skills/</code>. The ones with a source
|
|
9
|
+
came from the network, the others are yours.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<h2>Installed</h2>
|
|
13
|
+
<div id="skills-installed"></div>
|
|
14
|
+
|
|
15
|
+
<h2>Built in</h2>
|
|
16
|
+
<p class="note">
|
|
17
|
+
These skills come with the agent. A skill of yours with the same name
|
|
18
|
+
replaces one of them.
|
|
19
|
+
</p>
|
|
20
|
+
<div id="skills-builtin"></div>
|
|
21
|
+
|
|
22
|
+
<h2>Install from the network</h2>
|
|
23
|
+
<p class="note">
|
|
24
|
+
A source is a GitHub repository (<code>owner/repo</code>, <code>owner/repo@v1.2.0</code>,
|
|
25
|
+
<code>owner/repo/skills/pdf-report@v1</code>), the address of one <code>SKILL.md</code>,
|
|
26
|
+
or a git URL. Nothing is installed before you have read it.
|
|
27
|
+
</p>
|
|
28
|
+
<form id="skills-form">
|
|
29
|
+
<label>Source
|
|
30
|
+
<input id="skill-source" placeholder="owner/repo/skills/pdf-report@v1.2.0">
|
|
31
|
+
</label>
|
|
32
|
+
<div class="row">
|
|
33
|
+
<button type="submit" class="primary" id="skills-download">Download and preview</button>
|
|
34
|
+
<span id="skills-message" class="note"></span>
|
|
35
|
+
</div>
|
|
36
|
+
</form>
|
|
37
|
+
|
|
38
|
+
<div id="skills-registries"></div>
|
|
39
|
+
|
|
40
|
+
<h2 id="skills-sites-title">Skill sites</h2>
|
|
41
|
+
<p class="note">
|
|
42
|
+
The three sites below are the repositories with the most stars that really
|
|
43
|
+
hold skills. A click on a skill downloads it and shows what is in it:
|
|
44
|
+
nothing is installed before you have read it.
|
|
45
|
+
</p>
|
|
46
|
+
<div id="skills-sites" class="tabs"></div>
|
|
47
|
+
<div id="skills-site-panel" class="site-panel"></div>
|
|
48
|
+
</main>
|
|
49
|
+
|
|
50
|
+
<dialog id="skills-preview">
|
|
51
|
+
<div class="preview-head">
|
|
52
|
+
<strong id="preview-name"></strong>
|
|
53
|
+
<button type="button" id="preview-close" class="close">×</button>
|
|
54
|
+
</div>
|
|
55
|
+
<div id="preview-meta" class="note"></div>
|
|
56
|
+
<div id="preview-warnings"></div>
|
|
57
|
+
<pre id="preview-body"></pre>
|
|
58
|
+
<div id="preview-files" class="note"></div>
|
|
59
|
+
<div class="row">
|
|
60
|
+
<button type="button" id="preview-cancel">Cancel</button>
|
|
61
|
+
<button type="button" id="preview-install" class="primary">Install</button>
|
|
62
|
+
</div>
|
|
63
|
+
</dialog>
|
|
64
|
+
{% endblock %}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{% block title %}coder{% endblock %}</title>
|
|
7
|
+
<link rel="stylesheet" href="/static/app.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<header class="topbar">
|
|
11
|
+
<a class="brand" href="/">coder</a>
|
|
12
|
+
<nav>
|
|
13
|
+
<a href="/">聊天</a>
|
|
14
|
+
<a href="/skills">技能</a>
|
|
15
|
+
<a href="/settings">设置</a>
|
|
16
|
+
</nav>
|
|
17
|
+
<span class="spacer"></span>
|
|
18
|
+
<select class="language" title="这里选的语言比地址所在的地区说了算"
|
|
19
|
+
onchange="chooseLanguage(this.value)">
|
|
20
|
+
{% for option in languages %}
|
|
21
|
+
<option value="{{ option.code }}"{% if option.code == language %} selected{% endif %}>{{ option.name }}</option>
|
|
22
|
+
{% endfor %}
|
|
23
|
+
</select>
|
|
24
|
+
<span class="status" id="status">没有会话</span>
|
|
25
|
+
</header>
|
|
26
|
+
{% block content %}{% endblock %}
|
|
27
|
+
<script>window.STRINGS = {{ strings | tojson }};</script>
|
|
28
|
+
<script>window.DOT_FRAMES = {{ dots | tojson }};</script>
|
|
29
|
+
<script src="/static/app.js"></script>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% import "macros.html" as macros %}
|
|
3
|
+
{% block title %}coder — 聊天{% endblock %}
|
|
4
|
+
{% block content %}
|
|
5
|
+
<div class="layout">
|
|
6
|
+
<aside class="sidebar">
|
|
7
|
+
<section>
|
|
8
|
+
<h2>会话</h2>
|
|
9
|
+
<button id="new-session" class="primary">新会话</button>
|
|
10
|
+
<ul id="sessions" class="list"></ul>
|
|
11
|
+
</section>
|
|
12
|
+
<section>
|
|
13
|
+
<h2>文件</h2>
|
|
14
|
+
<div class="row">
|
|
15
|
+
<input id="file-path" placeholder="路径" value=".">
|
|
16
|
+
<button id="list-files">列出</button>
|
|
17
|
+
</div>
|
|
18
|
+
<ul id="files" class="list"></ul>
|
|
19
|
+
</section>
|
|
20
|
+
</aside>
|
|
21
|
+
|
|
22
|
+
<main class="conversation">
|
|
23
|
+
<div id="messages" class="messages"></div>
|
|
24
|
+
<button id="to-latest" class="to-latest" hidden>跳到最新</button>
|
|
25
|
+
<form id="composer" class="composer">
|
|
26
|
+
<div id="attachments" class="attachments"></div>
|
|
27
|
+
<div class="composer-row">
|
|
28
|
+
<button type="button" id="attach-image" class="attach" title="{{ strings.attach_image }}" aria-label="{{ strings.attach_image }}">
|
|
29
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
30
|
+
<path d="M8 2.5v11M2.5 8h11" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" fill="none" />
|
|
31
|
+
</svg>
|
|
32
|
+
</button>
|
|
33
|
+
<textarea id="input" rows="2" placeholder="跟 agent 说点什么,或者一条 /help 这样的命令"></textarea>
|
|
34
|
+
<input type="file" id="attach" accept="image/png,image/jpeg,image/gif,image/webp" multiple hidden>
|
|
35
|
+
<button type="submit" class="primary">发送</button>
|
|
36
|
+
</div>
|
|
37
|
+
</form>
|
|
38
|
+
<div class="row commands">
|
|
39
|
+
<select id="command-list"></select>
|
|
40
|
+
<button id="run-command">运行</button>
|
|
41
|
+
<button id="review">评审改动</button>
|
|
42
|
+
<button id="interrupt">打断</button>
|
|
43
|
+
</div>
|
|
44
|
+
</main>
|
|
45
|
+
|
|
46
|
+
<aside class="inspector">
|
|
47
|
+
<h2>权限</h2>
|
|
48
|
+
<label>模式 {{ macros.permission_modes("permission-mode") }}</label>
|
|
49
|
+
<p class="note" id="mode-note"></p>
|
|
50
|
+
<h2>状态</h2>
|
|
51
|
+
<dl id="status-fields"></dl>
|
|
52
|
+
<h2>子 agent</h2>
|
|
53
|
+
<div id="agents"></div>
|
|
54
|
+
<h2>改动</h2>
|
|
55
|
+
<div id="changes"></div>
|
|
56
|
+
<h2>文件</h2>
|
|
57
|
+
<pre id="file-view"></pre>
|
|
58
|
+
</aside>
|
|
59
|
+
</div>
|
|
60
|
+
{% endblock %}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{% macro permission_modes(element_id) %}
|
|
2
|
+
<select id="{{ element_id }}">
|
|
3
|
+
<option value="default" title="凡是会改东西的工具都要审批。">default</option>
|
|
4
|
+
<option value="acceptEdits" title="写操作直接放行,其余的还是要问。">acceptEdits</option>
|
|
5
|
+
<option value="plan" title="只读:agent 只看不改,把计划写出来。">plan</option>
|
|
6
|
+
<option value="readonly" title="只读:agent 只看不改,把看到的说出来。">readonly</option>
|
|
7
|
+
<option value="bypass" title="一律不问,所有工具调用都放行——无人值守跑的时候用。">bypass</option>
|
|
8
|
+
</select>
|
|
9
|
+
{% endmacro %}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% import "macros.html" as macros %}
|
|
3
|
+
{% block title %}coder — 设置{% endblock %}
|
|
4
|
+
{% block content %}
|
|
5
|
+
<main class="page">
|
|
6
|
+
<h1>模型</h1>
|
|
7
|
+
<p class="note">
|
|
8
|
+
设置写到用户级配置文件(<code id="config-path">~/.coderagent/config.yaml</code>),项目级的那份永远不写。
|
|
9
|
+
新会话读新的设置;跑着的会话还是它原来那个模型。
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<form id="model-form">
|
|
13
|
+
<label>模型名
|
|
14
|
+
<input id="model-name" placeholder="deepseek/deepseek-flash">
|
|
15
|
+
<small id="model-provider" class="source"></small>
|
|
16
|
+
<small class="source">厂商可以写在名字前面(<code>openai/MiniMax-M2.7</code>、<code>openai:MiniMax-M2.7</code>),也可以不写(<code>MiniMax-M2.7</code>)。不写的时候由接口地址和模型系列来定</small>
|
|
17
|
+
</label>
|
|
18
|
+
<label>接口地址
|
|
19
|
+
<input id="api-base" placeholder="https://api.deepseek.com">
|
|
20
|
+
</label>
|
|
21
|
+
<label>API key
|
|
22
|
+
<input id="api-key" type="password" placeholder="点一下显示">
|
|
23
|
+
<small id="model-key-source" class="source"></small>
|
|
24
|
+
<small class="source">点一下显示 key,再点一下收起来</small>
|
|
25
|
+
</label>
|
|
26
|
+
<label>最多重试
|
|
27
|
+
<input id="max-retries" type="number" min="0" max="20">
|
|
28
|
+
</label>
|
|
29
|
+
<p class="note">
|
|
30
|
+
模型的其他设置(思考预算、路由、附加参数)写在配置文件里。
|
|
31
|
+
</p>
|
|
32
|
+
<div class="row">
|
|
33
|
+
<button type="submit" class="primary">保存</button>
|
|
34
|
+
<button type="button" id="model-test">测试</button>
|
|
35
|
+
<span id="config-message" class="note"></span>
|
|
36
|
+
</div>
|
|
37
|
+
<p class="note" id="model-test-result"></p>
|
|
38
|
+
<p class="note">
|
|
39
|
+
测试只是把这份表单里的设置试一遍,它什么都不写。保存是另一步,
|
|
40
|
+
暂时还不好使的设置也值得先写下来。
|
|
41
|
+
</p>
|
|
42
|
+
</form>
|
|
43
|
+
|
|
44
|
+
<h2>权限</h2>
|
|
45
|
+
<p class="note">
|
|
46
|
+
权限写进同一个用户级配置文件。新会话读新的模式;跑着的会话还是它原来的模式。
|
|
47
|
+
跑着的会话在聊天页里切。
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
<form id="permissions-form">
|
|
51
|
+
<label>模式
|
|
52
|
+
{{ macros.permission_modes("permission-mode") }}
|
|
53
|
+
<small id="source-mode" class="source"></small>
|
|
54
|
+
</label>
|
|
55
|
+
<label>禁止的路径
|
|
56
|
+
<textarea id="deny-paths" rows="3" placeholder="secrets/"></textarea>
|
|
57
|
+
<small class="source">一行一个路径:agent 不许碰它们</small>
|
|
58
|
+
</label>
|
|
59
|
+
<label>额外的目录
|
|
60
|
+
<textarea id="include-dirs" rows="3" placeholder="/path/to/other/project"></textarea>
|
|
61
|
+
<small class="source">一行一个目录:工作目录以外、agent 仍然可以碰的目录</small>
|
|
62
|
+
</label>
|
|
63
|
+
<label>网络
|
|
64
|
+
<select id="network">
|
|
65
|
+
<option value="allow" title="要出网的命令会先问一次。">allow</option>
|
|
66
|
+
<option value="deny" title="要出网的命令一律拒绝。">deny</option>
|
|
67
|
+
</select>
|
|
68
|
+
<small id="source-network" class="source"></small>
|
|
69
|
+
</label>
|
|
70
|
+
<div class="row">
|
|
71
|
+
<button type="submit" class="primary">保存</button>
|
|
72
|
+
<span id="permissions-message" class="note"></span>
|
|
73
|
+
</div>
|
|
74
|
+
<p class="note" id="server-mode-note"></p>
|
|
75
|
+
</form>
|
|
76
|
+
</main>
|
|
77
|
+
{% endblock %}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% block title %}coder — 技能{% endblock %}
|
|
3
|
+
{% block content %}
|
|
4
|
+
<main class="page" id="skills-page">
|
|
5
|
+
<h1>技能</h1>
|
|
6
|
+
<p class="note">
|
|
7
|
+
技能是一包说明,任务对得上的时候模型会加载它。下面这些在
|
|
8
|
+
<code>~/.coderagent/skills/</code> 里:标了来源的是从网上装来的,其余是你自己的。
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<h2>已安装</h2>
|
|
12
|
+
<div id="skills-installed"></div>
|
|
13
|
+
|
|
14
|
+
<h2>自带</h2>
|
|
15
|
+
<p class="note">
|
|
16
|
+
这些技能随 agent 发布,你现在就能用。你自己同名的技能会盖掉它们。
|
|
17
|
+
</p>
|
|
18
|
+
<div id="skills-builtin"></div>
|
|
19
|
+
|
|
20
|
+
<h2>从网络安装</h2>
|
|
21
|
+
<p class="note">
|
|
22
|
+
来源可以是 GitHub 仓库(<code>owner/repo</code>、<code>owner/repo@v1.2.0</code>、
|
|
23
|
+
<code>owner/repo/skills/pdf-report@v1</code>),一个 <code>SKILL.md</code> 的地址,
|
|
24
|
+
或者一个 git 地址。没看过内容之前,什么都不会装上。
|
|
25
|
+
</p>
|
|
26
|
+
<form id="skills-form">
|
|
27
|
+
<label>来源
|
|
28
|
+
<input id="skill-source" placeholder="owner/repo/skills/pdf-report@v1.2.0">
|
|
29
|
+
</label>
|
|
30
|
+
<div class="row">
|
|
31
|
+
<button type="submit" class="primary" id="skills-download">下载并预览</button>
|
|
32
|
+
<span id="skills-message" class="note"></span>
|
|
33
|
+
</div>
|
|
34
|
+
</form>
|
|
35
|
+
|
|
36
|
+
<div id="skills-registries"></div>
|
|
37
|
+
|
|
38
|
+
<h2 id="skills-sites-title">技能站点</h2>
|
|
39
|
+
<p class="note">
|
|
40
|
+
下面三个是 star 最多、又真的装着技能的仓库。点一个技能就把它下载下来,
|
|
41
|
+
先给你看里面的东西,看过之前什么都不会装上。
|
|
42
|
+
</p>
|
|
43
|
+
<div id="skills-sites" class="tabs"></div>
|
|
44
|
+
<div id="skills-site-panel" class="site-panel"></div>
|
|
45
|
+
</main>
|
|
46
|
+
|
|
47
|
+
<dialog id="skills-preview">
|
|
48
|
+
<div class="preview-head">
|
|
49
|
+
<strong id="preview-name"></strong>
|
|
50
|
+
<button type="button" id="preview-close" class="close">×</button>
|
|
51
|
+
</div>
|
|
52
|
+
<div id="preview-meta" class="note"></div>
|
|
53
|
+
<div id="preview-warnings"></div>
|
|
54
|
+
<pre id="preview-body"></pre>
|
|
55
|
+
<div id="preview-files" class="note"></div>
|
|
56
|
+
<div class="row">
|
|
57
|
+
<button type="button" id="preview-cancel">取消</button>
|
|
58
|
+
<button type="button" id="preview-install" class="primary">安装</button>
|
|
59
|
+
</div>
|
|
60
|
+
</dialog>
|
|
61
|
+
{% endblock %}
|