main
html 136 lines 6.06 KB
Raw
1 <html>
2 <head>
3 <title>Working directory</title>
4
5 <script type="module">
6 import { store } from "/components/settings/settings-store.js";
7 import { store as fileBrowserStore } from "/components/modals/file-browser/file-browser-store.js";
8 </script>
9 </head>
10
11 <body>
12 <div x-data>
13 <template x-if="$store.settings?.settings">
14 <div>
15 <div class="section-title">Default working directory</div>
16 <div class="section-description">
17 The fallback workspace for chats that are not attached to a project.
18 </div>
19
20 <div class="field">
21 <div class="field-label">
22 <div class="field-title">Workdir path</div>
23 <div class="field-description">Use a Linux path inside the container, for example <code>/a0/usr/workdir</code>.</div>
24 </div>
25 <div class="field-control">
26 <input type="text" x-model="$store.settings.settings.workdir_path" />
27 <button class="btn btn-field settings-inline-button" @click="$store.fileBrowser.open($store.settings.settings.workdir_path)">Browse</button>
28 </div>
29 </div>
30
31 <div class="field">
32 <div class="field-label">
33 <div class="field-title">Remember last file browser location</div>
34 <div class="field-description">
35 Open the file browser at the most recently visited directory when no specific path is requested.
36 </div>
37 </div>
38 <div class="field-control">
39 <label class="toggle">
40 <input type="checkbox" x-model="$store.settings.settings.file_browser_remember_last_directory" />
41 <span class="toggler"></span>
42 </label>
43 </div>
44 </div>
45
46 <div class="field">
47 <div class="field-label">
48 <div class="field-title">Show workdir structure to the agent</div>
49 <div class="field-description">
50 Give the agent a compact map of the workspace at the start of a task.
51 </div>
52 </div>
53 <div class="field-control">
54 <label class="toggle">
55 <input type="checkbox" x-model="$store.settings.settings.workdir_show" />
56 <span class="toggler"></span>
57 </label>
58 </div>
59 </div>
60
61 <template x-if="$store.settings.settings.workdir_show">
62 <div class="settings-advanced-section" x-data="{ advOpen: false }">
63 <button type="button" class="settings-advanced-toggle" @click="advOpen = !advOpen">
64 <x-icon class="settings-advanced-toggle-icon"
65 :style="advOpen ? 'transform:rotate(90deg)' : ''" name="chevron_right"></x-icon>
66 <span>Advanced Settings</span>
67 </button>
68
69 <div class="settings-advanced-body" x-show="advOpen" x-transition.opacity>
70 <div class="field">
71 <div class="field-label">
72 <div class="field-title">Depth limit</div>
73 <div class="field-description">How many folder levels to include. Use 0 for no depth limit.</div>
74 </div>
75 <div class="field-control">
76 <input type="number" x-model.number="$store.settings.settings.workdir_max_depth" min="0" step="1" />
77 </div>
78 </div>
79
80 <div class="field">
81 <div class="field-label">
82 <div class="field-title">Line budget</div>
83 <div class="field-description">Maximum lines shown to the agent. Use 0 for no line limit.</div>
84 </div>
85 <div class="field-control">
86 <input type="number" x-model.number="$store.settings.settings.workdir_max_lines" min="0" step="1" />
87 </div>
88 </div>
89
90 <div class="field">
91 <div class="field-label">
92 <div class="field-title">Folder limit</div>
93 <div class="field-description">Maximum subfolders shown per folder. Use 0 for no folder limit.</div>
94 </div>
95 <div class="field-control">
96 <input type="number" x-model.number="$store.settings.settings.workdir_max_folders" min="0" step="1" />
97 </div>
98 </div>
99
100 <div class="field">
101 <div class="field-label">
102 <div class="field-title">File limit</div>
103 <div class="field-description">Maximum files shown per folder. Use 0 for no file limit.</div>
104 </div>
105 <div class="field-control">
106 <input type="number" x-model.number="$store.settings.settings.workdir_max_files" min="0" step="1" />
107 </div>
108 </div>
109
110 <div class="field field-full">
111 <div class="field-label">
112 <div class="field-title">Ignored files and folders</div>
113 <div class="field-description">Gitignore-style patterns that should stay out of the agent’s workspace map.</div>
114 </div>
115 <div class="field-control">
116 <textarea x-model="$store.settings.settings.workdir_gitignore" rows="5" placeholder="node_modules/&#10;.git/&#10;*.log"></textarea>
117 </div>
118 </div>
119
120 <div class="field">
121 <div class="field-label">
122 <div class="field-title">Preview workspace map</div>
123 <div class="field-description">See exactly what the agent will receive before saving the limits.</div>
124 </div>
125 <div class="field-control">
126 <button class="btn btn-field" @click="$store.settings.testWorkdirFileStructure()">Preview</button>
127 </div>
128 </div>
129 </div>
130 </div>
131 </template>
132 </div>
133 </template>
134 </div>
135 </body>
136 </html>