clay-server 2.33.1 → 2.34.0-beta.10
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/lib/ask-user-mcp-server.js +120 -0
- package/lib/config.js +9 -13
- package/lib/daemon.js +116 -55
- package/lib/mate-datastore.js +359 -0
- package/lib/mates.js +2 -2
- package/lib/os-users.js +70 -37
- package/lib/project-connection.js +16 -9
- package/lib/project-http.js +3 -4
- package/lib/project-image.js +3 -2
- package/lib/project-mate-datastore.js +232 -0
- package/lib/project-sessions.js +110 -7
- package/lib/project-user-message.js +4 -3
- package/lib/project.js +126 -10
- package/lib/public/app.js +2 -0
- package/lib/public/css/mates.css +228 -11
- package/lib/public/css/messages.css +23 -0
- package/lib/public/css/mobile-nav.css +0 -14
- package/lib/public/css/notifications-center.css +80 -0
- package/lib/public/css/sidebar.css +326 -101
- package/lib/public/index.html +24 -29
- package/lib/public/modules/app-dm.js +0 -2
- package/lib/public/modules/app-messages.js +23 -0
- package/lib/public/modules/app-rendering.js +0 -2
- package/lib/public/modules/diff.js +21 -7
- package/lib/public/modules/mate-datastore-ui.js +280 -0
- package/lib/public/modules/mate-sidebar.js +3 -9
- package/lib/public/modules/mate-wizard.js +15 -15
- package/lib/public/modules/sidebar-mobile.js +10 -20
- package/lib/public/modules/sidebar-sessions.js +490 -113
- package/lib/public/modules/sidebar.js +8 -6
- package/lib/public/modules/tools.js +115 -18
- package/lib/public/sw.js +1 -1
- package/lib/sdk-bridge.js +56 -41
- package/lib/sdk-message-processor.js +21 -4
- package/lib/server.js +28 -72
- package/lib/sessions.js +157 -20
- package/lib/updater.js +2 -2
- package/lib/users.js +2 -2
- package/lib/ws-schema.js +16 -0
- package/lib/yoke/adapters/claude-worker.js +114 -2
- package/lib/yoke/adapters/claude.js +56 -5
- package/lib/yoke/adapters/codex.js +350 -58
- package/lib/yoke/index.js +93 -48
- package/lib/yoke/instructions.js +0 -1
- package/lib/yoke/mcp-bridge-server.js +14 -6
- package/package.json +1 -2
- package/lib/yoke/adapters/gemini.js +0 -709
|
@@ -14,6 +14,7 @@ import { renderSessionList, updateSessionPresence, populateCliSessionList, handl
|
|
|
14
14
|
import { updateDmBadge, renderSidebarPresence, setMentionActive, renderUserStrip } from './sidebar-mates.js';
|
|
15
15
|
import { refreshMobileChatSheet } from './sidebar-mobile.js';
|
|
16
16
|
import { renderMateSessionList, handleMateSearchResults, updateMateSidebarProfile } from './mate-sidebar.js';
|
|
17
|
+
import { handleMateDatastoreTablesResult, handleMateDatastoreDescribeResult, handleMateDatastoreQueryResult, handleMateDatastoreError, handleMateDatastoreChange } from './mate-datastore-ui.js';
|
|
17
18
|
import { renderKnowledgeList, handleKnowledgeContent } from './mate-knowledge.js';
|
|
18
19
|
import { renderMemoryList } from './mate-memory.js';
|
|
19
20
|
import { handlePaletteSessionSwitch, setPaletteVersion } from './command-palette.js';
|
|
@@ -275,6 +276,26 @@ export function processMessage(msg) {
|
|
|
275
276
|
updateProjectList(msg);
|
|
276
277
|
break;
|
|
277
278
|
|
|
279
|
+
case "mate_db_tables_result":
|
|
280
|
+
handleMateDatastoreTablesResult(msg);
|
|
281
|
+
break;
|
|
282
|
+
|
|
283
|
+
case "mate_db_describe_result":
|
|
284
|
+
handleMateDatastoreDescribeResult(msg);
|
|
285
|
+
break;
|
|
286
|
+
|
|
287
|
+
case "mate_db_query_result":
|
|
288
|
+
handleMateDatastoreQueryResult(msg);
|
|
289
|
+
break;
|
|
290
|
+
|
|
291
|
+
case "mate_db_error":
|
|
292
|
+
handleMateDatastoreError(msg);
|
|
293
|
+
break;
|
|
294
|
+
|
|
295
|
+
case "mate_db_change":
|
|
296
|
+
handleMateDatastoreChange(msg);
|
|
297
|
+
break;
|
|
298
|
+
|
|
278
299
|
case "update_available":
|
|
279
300
|
// In multi-user mode, only show update UI to admins
|
|
280
301
|
if (store.get('isMultiUserMode')) {
|
|
@@ -711,6 +732,8 @@ export function processMessage(msg) {
|
|
|
711
732
|
getTools()[msg.id] = { el: null, name: msg.name, input: null, done: true, hidden: true };
|
|
712
733
|
} else if (msg.name === "propose_debate" || (msg.name && msg.name.indexOf("propose_debate") !== -1)) {
|
|
713
734
|
getTools()[msg.id] = { el: null, name: msg.name, input: null, done: true, hidden: true };
|
|
735
|
+
} else if (msg.name === "ask_user_questions") {
|
|
736
|
+
getTools()[msg.id] = { el: null, name: msg.name, input: null, done: true, hidden: true };
|
|
714
737
|
} else if (getTodoTools()[msg.name]) {
|
|
715
738
|
getTools()[msg.id] = { el: null, name: msg.name, input: null, done: true, hidden: true };
|
|
716
739
|
} else {
|
|
@@ -17,12 +17,10 @@ import { getScheduledMsgEl } from './app-rate-limit.js';
|
|
|
17
17
|
export var VENDOR_AVATARS = {
|
|
18
18
|
claude: "/claude-code-avatar.png",
|
|
19
19
|
codex: "/codex-avatar.png",
|
|
20
|
-
gemini: "/claude-code-avatar.png",
|
|
21
20
|
};
|
|
22
21
|
export var VENDOR_NAMES = {
|
|
23
22
|
claude: "Claude Code",
|
|
24
23
|
codex: "Codex",
|
|
25
|
-
gemini: "Gemini",
|
|
26
24
|
};
|
|
27
25
|
var NEW_MSG_BTN_DEFAULT = "\u2193 Latest";
|
|
28
26
|
var NEW_MSG_BTN_ACTIVITY = "\u2193 New activity";
|
|
@@ -238,25 +238,39 @@ export function renderSplitDiff(oldStr, newStr, lang) {
|
|
|
238
238
|
* Parses hunk headers for line numbers. Optional lang for syntax highlighting.
|
|
239
239
|
* Returns a DOM element.
|
|
240
240
|
*/
|
|
241
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Reconstruct old and new source text from a unified patch string.
|
|
243
|
+
* Skips file headers, "diff --git" lines, index lines, and hunk headers.
|
|
244
|
+
* Returns { oldStr, newStr }.
|
|
245
|
+
*/
|
|
246
|
+
export function reconstructPatchSources(text) {
|
|
242
247
|
var lines = text.split("\n");
|
|
243
|
-
|
|
244
|
-
// Reconstruct old and new source for highlighting
|
|
245
248
|
var oldSrc = [];
|
|
246
249
|
var newSrc = [];
|
|
247
250
|
for (var p = 0; p < lines.length; p++) {
|
|
248
251
|
var pl = lines[p];
|
|
249
|
-
if (pl.startsWith("
|
|
252
|
+
if (pl.startsWith("---") || pl.startsWith("+++")) continue;
|
|
253
|
+
if (pl.startsWith("diff ") || pl.startsWith("index ")) continue;
|
|
254
|
+
if (pl.startsWith("@@")) continue;
|
|
255
|
+
if (pl.startsWith("-")) {
|
|
250
256
|
oldSrc.push(pl.substring(1));
|
|
251
|
-
} else if (pl.startsWith("+")
|
|
257
|
+
} else if (pl.startsWith("+")) {
|
|
252
258
|
newSrc.push(pl.substring(1));
|
|
253
259
|
} else if (pl.startsWith(" ")) {
|
|
254
260
|
oldSrc.push(pl.substring(1));
|
|
255
261
|
newSrc.push(pl.substring(1));
|
|
256
262
|
}
|
|
257
263
|
}
|
|
258
|
-
|
|
259
|
-
|
|
264
|
+
return { oldStr: oldSrc.join("\n"), newStr: newSrc.join("\n") };
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export function renderPatchDiff(text, lang) {
|
|
268
|
+
var lines = text.split("\n");
|
|
269
|
+
|
|
270
|
+
// Reconstruct old and new source for highlighting
|
|
271
|
+
var sources = reconstructPatchSources(text);
|
|
272
|
+
var oldHL = highlightLines(sources.oldStr, lang);
|
|
273
|
+
var newHL = highlightLines(sources.newStr, lang);
|
|
260
274
|
var oldHLIdx = 0;
|
|
261
275
|
var newHLIdx = 0;
|
|
262
276
|
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { escapeHtml } from './utils.js';
|
|
2
|
+
import { refreshIcons } from './icons.js';
|
|
3
|
+
import { getWs } from './ws-ref.js';
|
|
4
|
+
|
|
5
|
+
var wsGetter = null;
|
|
6
|
+
var panelEl = null;
|
|
7
|
+
var tableListEl = null;
|
|
8
|
+
var tableNameEl = null;
|
|
9
|
+
var tableSchemaEl = null;
|
|
10
|
+
var resultEl = null;
|
|
11
|
+
var statusEl = null;
|
|
12
|
+
var dataBtnEl = null;
|
|
13
|
+
var mainColumnEl = null;
|
|
14
|
+
var currentTables = [];
|
|
15
|
+
var currentTable = null;
|
|
16
|
+
var panelOpen = false;
|
|
17
|
+
var routingToScheduler = false;
|
|
18
|
+
|
|
19
|
+
function sendWs(msg) {
|
|
20
|
+
var ws = wsGetter ? wsGetter() : getWs();
|
|
21
|
+
if (ws && ws.readyState === 1) ws.send(JSON.stringify(msg));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function quoteIdentifier(name) {
|
|
25
|
+
return '"' + String(name || "").replace(/"/g, '""') + '"';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function ensurePanel() {
|
|
29
|
+
if (panelEl) return;
|
|
30
|
+
mainColumnEl = document.getElementById("main-column");
|
|
31
|
+
if (!mainColumnEl) return;
|
|
32
|
+
|
|
33
|
+
panelEl = document.createElement("div");
|
|
34
|
+
panelEl.id = "mate-datastore-panel";
|
|
35
|
+
panelEl.className = "hidden";
|
|
36
|
+
|
|
37
|
+
panelEl.innerHTML =
|
|
38
|
+
'<div class="scheduler-top-bar mate-datastore-top-bar">' +
|
|
39
|
+
'<span class="scheduler-top-title mate-datastore-top-title"><i data-lucide="database"></i>Data</span>' +
|
|
40
|
+
'<div class="mate-datastore-top-actions">' +
|
|
41
|
+
'<button id="mate-db-refresh-btn" class="scheduler-close-btn" type="button" title="Refresh tables"><i data-lucide="refresh-cw"></i></button>' +
|
|
42
|
+
'<button id="mate-db-back-btn" class="scheduler-close-btn" type="button" title="Close"><i data-lucide="x"></i></button>' +
|
|
43
|
+
'</div>' +
|
|
44
|
+
'</div>' +
|
|
45
|
+
'<div class="mate-db-status" id="mate-db-status"></div>' +
|
|
46
|
+
'<div class="mate-db-layout">' +
|
|
47
|
+
'<div class="mate-db-table-column">' +
|
|
48
|
+
'<div class="mate-db-section-title">Objects</div>' +
|
|
49
|
+
'<div id="mate-db-table-list" class="mate-db-table-list"></div>' +
|
|
50
|
+
'</div>' +
|
|
51
|
+
'<div class="mate-db-detail">' +
|
|
52
|
+
'<div class="mate-db-section-title" id="mate-db-table-name">No table selected</div>' +
|
|
53
|
+
'<pre id="mate-db-table-schema" class="mate-db-table-schema"></pre>' +
|
|
54
|
+
'<div class="mate-db-section-title">Rows</div>' +
|
|
55
|
+
'<pre id="mate-db-result" class="mate-db-result"></pre>' +
|
|
56
|
+
'</div>' +
|
|
57
|
+
'</div>';
|
|
58
|
+
|
|
59
|
+
mainColumnEl.appendChild(panelEl);
|
|
60
|
+
tableListEl = document.getElementById("mate-db-table-list");
|
|
61
|
+
tableNameEl = document.getElementById("mate-db-table-name");
|
|
62
|
+
tableSchemaEl = document.getElementById("mate-db-table-schema");
|
|
63
|
+
resultEl = document.getElementById("mate-db-result");
|
|
64
|
+
statusEl = document.getElementById("mate-db-status");
|
|
65
|
+
|
|
66
|
+
var refreshBtn = document.getElementById("mate-db-refresh-btn");
|
|
67
|
+
var backBtn = document.getElementById("mate-db-back-btn");
|
|
68
|
+
|
|
69
|
+
if (refreshBtn) {
|
|
70
|
+
refreshBtn.addEventListener("click", function () {
|
|
71
|
+
requestTables();
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (backBtn) {
|
|
76
|
+
backBtn.addEventListener("click", function () {
|
|
77
|
+
setSectionVisibility(false);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
refreshIcons();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function setSectionVisibility(open) {
|
|
85
|
+
ensurePanel();
|
|
86
|
+
panelOpen = open;
|
|
87
|
+
if (panelEl) panelEl.classList.toggle("hidden", !open);
|
|
88
|
+
if (mainColumnEl) mainColumnEl.classList.toggle("mate-datastore-open", open);
|
|
89
|
+
if (dataBtnEl) dataBtnEl.classList.toggle("active", open);
|
|
90
|
+
refreshIcons();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function requestTables() {
|
|
94
|
+
sendWs({ type: "mate_db_tables" });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function renderStatus(text, kind) {
|
|
98
|
+
if (!statusEl) return;
|
|
99
|
+
statusEl.textContent = text || "";
|
|
100
|
+
statusEl.dataset.kind = kind || "";
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function renderResult(payload) {
|
|
104
|
+
if (!resultEl) return;
|
|
105
|
+
resultEl.textContent = JSON.stringify(payload, null, 2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function formatColumns(columns) {
|
|
109
|
+
var list = Array.isArray(columns) ? columns : [];
|
|
110
|
+
if (!list.length) return "No column information available.";
|
|
111
|
+
var lines = [];
|
|
112
|
+
for (var i = 0; i < list.length; i++) {
|
|
113
|
+
var col = list[i] || {};
|
|
114
|
+
var line = (col.name || "?") + " " + (col.type || "");
|
|
115
|
+
if (col.pk) line += " PRIMARY KEY";
|
|
116
|
+
if (col.notnull) line += " NOT NULL";
|
|
117
|
+
if (typeof col.dflt_value !== "undefined" && col.dflt_value !== null) line += " DEFAULT " + col.dflt_value;
|
|
118
|
+
lines.push(line.trim());
|
|
119
|
+
}
|
|
120
|
+
return lines.join("\n");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function renderTableList(objects) {
|
|
124
|
+
currentTables = objects || [];
|
|
125
|
+
if (!tableListEl) return;
|
|
126
|
+
tableListEl.innerHTML = "";
|
|
127
|
+
|
|
128
|
+
if (!currentTables.length) {
|
|
129
|
+
var empty = document.createElement("div");
|
|
130
|
+
empty.className = "mate-db-empty";
|
|
131
|
+
empty.textContent = "No tables or views found.";
|
|
132
|
+
tableListEl.appendChild(empty);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
for (var i = 0; i < currentTables.length; i++) {
|
|
137
|
+
(function (obj) {
|
|
138
|
+
var row = document.createElement("button");
|
|
139
|
+
row.type = "button";
|
|
140
|
+
row.className = "mate-db-table-item" + (currentTable === obj.name ? " active" : "");
|
|
141
|
+
var label = obj.type || "object";
|
|
142
|
+
row.innerHTML = '<span class="mate-db-table-item-name">' + escapeHtml(obj.name) + '</span>' +
|
|
143
|
+
'<span class="mate-db-table-item-type">' + escapeHtml(label) + '</span>';
|
|
144
|
+
row.addEventListener("click", function () {
|
|
145
|
+
selectTable(obj.name);
|
|
146
|
+
});
|
|
147
|
+
tableListEl.appendChild(row);
|
|
148
|
+
})(currentTables[i]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function findFirstDescribableObject(objects) {
|
|
153
|
+
var list = objects || [];
|
|
154
|
+
for (var i = 0; i < list.length; i++) {
|
|
155
|
+
if (list[i] && (list[i].type === "table" || list[i].type === "view")) return list[i];
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function findObjectByName(name) {
|
|
161
|
+
for (var i = 0; i < currentTables.length; i++) {
|
|
162
|
+
if (currentTables[i] && currentTables[i].name === name) return currentTables[i];
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function selectTable(tableName) {
|
|
168
|
+
currentTable = tableName;
|
|
169
|
+
renderTableList(currentTables);
|
|
170
|
+
var obj = findObjectByName(tableName);
|
|
171
|
+
if (!obj) return;
|
|
172
|
+
if (obj.type !== "table" && obj.type !== "view") {
|
|
173
|
+
renderStatus("Selected " + (obj.type || "object") + " " + tableName + ".", "ok");
|
|
174
|
+
if (tableNameEl) tableNameEl.textContent = tableName;
|
|
175
|
+
if (tableSchemaEl) tableSchemaEl.textContent = (obj.type || "object") + ": " + tableName;
|
|
176
|
+
renderResult(obj);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
renderStatus("Loading " + tableName + "...", "info");
|
|
180
|
+
sendWs({ type: "mate_db_describe", table: tableName });
|
|
181
|
+
sendWs({ type: "mate_db_query", sql: "SELECT * FROM " + quoteIdentifier(tableName) + " LIMIT 100", params: [] });
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function initMateDatastoreUI(getWsFn) {
|
|
185
|
+
wsGetter = getWsFn;
|
|
186
|
+
dataBtnEl = document.getElementById("mate-data-btn");
|
|
187
|
+
if (!dataBtnEl) return;
|
|
188
|
+
|
|
189
|
+
dataBtnEl.addEventListener("click", function () {
|
|
190
|
+
if (panelOpen) {
|
|
191
|
+
setSectionVisibility(false);
|
|
192
|
+
} else {
|
|
193
|
+
setSectionVisibility(true);
|
|
194
|
+
requestTables();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
document.addEventListener("click", function (e) {
|
|
199
|
+
var btn = e.target && e.target.closest ? e.target.closest("#scheduler-btn, #mate-scheduler-btn") : null;
|
|
200
|
+
if (!btn || !panelOpen || routingToScheduler) return;
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
e.stopPropagation();
|
|
203
|
+
if (typeof e.stopImmediatePropagation === "function") e.stopImmediatePropagation();
|
|
204
|
+
routingToScheduler = true;
|
|
205
|
+
setSectionVisibility(false);
|
|
206
|
+
setTimeout(function () {
|
|
207
|
+
var schedulerBtn = document.getElementById("scheduler-btn");
|
|
208
|
+
if (schedulerBtn) schedulerBtn.click();
|
|
209
|
+
routingToScheduler = false;
|
|
210
|
+
}, 0);
|
|
211
|
+
}, true);
|
|
212
|
+
|
|
213
|
+
setSectionVisibility(false);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function showMateDatastorePanel() {
|
|
217
|
+
setSectionVisibility(true);
|
|
218
|
+
requestTables();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function hideMateDatastorePanel() {
|
|
222
|
+
setSectionVisibility(false);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export function handleMateDatastoreTablesResult(msg) {
|
|
226
|
+
if (msg.ok === false) {
|
|
227
|
+
renderStatus(msg.message || "Failed to load datastore tables.", "error");
|
|
228
|
+
renderResult(msg);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
renderStatus(msg.warning || "Datastore tables loaded.", msg.warning ? "warn" : "ok");
|
|
232
|
+
renderTableList(msg.objects || []);
|
|
233
|
+
if (msg.objects && msg.objects.length > 0) {
|
|
234
|
+
var found = false;
|
|
235
|
+
for (var i = 0; i < msg.objects.length; i++) {
|
|
236
|
+
if (msg.objects[i].name === currentTable) {
|
|
237
|
+
found = true;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (!found) {
|
|
242
|
+
var firstObject = findFirstDescribableObject(msg.objects);
|
|
243
|
+
if (firstObject) selectTable(firstObject.name);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
renderResult(msg.objects || []);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export function handleMateDatastoreDescribeResult(msg) {
|
|
250
|
+
if (msg.ok === false) {
|
|
251
|
+
renderStatus(msg.message || "Failed to describe table.", "error");
|
|
252
|
+
renderResult(msg);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
renderStatus(msg.warning || ("Described " + (msg.table || "table") + "."), msg.warning ? "warn" : "ok");
|
|
256
|
+
if (tableNameEl) tableNameEl.textContent = msg.table || "Table";
|
|
257
|
+
if (tableSchemaEl) tableSchemaEl.textContent = formatColumns(msg.columns);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function handleMateDatastoreQueryResult(msg) {
|
|
261
|
+
if (msg.ok === false) {
|
|
262
|
+
renderStatus(msg.message || "Query failed.", "error");
|
|
263
|
+
renderResult(msg);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
var status = "Showing " + (msg.rows ? msg.rows.length : 0) + " row(s).";
|
|
267
|
+
if (msg.truncated) status = status.replace(".", " (truncated).");
|
|
268
|
+
renderStatus(msg.warning || status, msg.warning ? "warn" : "ok");
|
|
269
|
+
renderResult(msg.rows || []);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function handleMateDatastoreError(msg) {
|
|
273
|
+
renderStatus(msg.message || "Mate datastore error.", "error");
|
|
274
|
+
renderResult(msg);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function handleMateDatastoreChange(msg) {
|
|
278
|
+
renderStatus("Datastore changed.", "info");
|
|
279
|
+
if (panelOpen) requestTables();
|
|
280
|
+
}
|
|
@@ -3,6 +3,7 @@ import { escapeHtml } from './utils.js';
|
|
|
3
3
|
import { iconHtml, refreshIcons } from './icons.js';
|
|
4
4
|
import { store } from './store.js';
|
|
5
5
|
import { hideKnowledge } from './mate-knowledge.js';
|
|
6
|
+
import { hideMateDatastorePanel } from './mate-datastore-ui.js';
|
|
6
7
|
import { isSchedulerOpen, closeScheduler } from './scheduler.js';
|
|
7
8
|
import { hideNotes } from './sticky-notes.js';
|
|
8
9
|
import { openSearch as openSessionSearch } from './session-search.js';
|
|
@@ -134,6 +135,7 @@ export function initMateSidebar(wsGetter) {
|
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
export function showMateSidebar(mateId, mateData) {
|
|
138
|
+
if (hideMateDatastorePanel) hideMateDatastorePanel();
|
|
137
139
|
currentMateId = mateId;
|
|
138
140
|
currentMate = mateData;
|
|
139
141
|
cachedSessions = [];
|
|
@@ -223,15 +225,6 @@ export function showMateSidebar(mateId, mateData) {
|
|
|
223
225
|
if (sd.communicationStyle && sd.communicationStyle.length > 0) {
|
|
224
226
|
seedTooltip.appendChild(makeSeedTags("Style", sd.communicationStyle.map(function (s) { return s.replace(/_/g, " "); })));
|
|
225
227
|
}
|
|
226
|
-
if (sd.autonomy) {
|
|
227
|
-
var autonomyLabels = {
|
|
228
|
-
always_ask: "Ask me everything",
|
|
229
|
-
minor_stuff_ok: "Small stuff is fine",
|
|
230
|
-
mostly_autonomous: "Mostly free",
|
|
231
|
-
fully_autonomous: "Full freedom",
|
|
232
|
-
};
|
|
233
|
-
seedTooltip.appendChild(makeSeedRow("Autonomy", autonomyLabels[sd.autonomy] || sd.autonomy.replace(/_/g, " ")));
|
|
234
|
-
}
|
|
235
228
|
}
|
|
236
229
|
|
|
237
230
|
// Clear session list
|
|
@@ -366,6 +359,7 @@ export function getMateSessions() {
|
|
|
366
359
|
}
|
|
367
360
|
|
|
368
361
|
export function hideMateSidebar() {
|
|
362
|
+
if (hideMateDatastorePanel) hideMateDatastorePanel();
|
|
369
363
|
currentMateId = null;
|
|
370
364
|
currentMate = null;
|
|
371
365
|
cachedSessions = [];
|
|
@@ -6,7 +6,7 @@ var mateWizardData = {
|
|
|
6
6
|
relationship: null,
|
|
7
7
|
activity: [],
|
|
8
8
|
communicationStyle: [],
|
|
9
|
-
|
|
9
|
+
vendor: "claude",
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
var _sendWs = null;
|
|
@@ -85,19 +85,19 @@ export function initMateWizard(sendWs, onMateCreated) {
|
|
|
85
85
|
})(styleCards[i]);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
// Step 4:
|
|
89
|
-
var
|
|
90
|
-
for (var i = 0; i <
|
|
88
|
+
// Step 4: Vendor button clicks
|
|
89
|
+
var vendorBtns = document.querySelectorAll("#mate-wizard .mate-vendor-option-btn");
|
|
90
|
+
for (var i = 0; i < vendorBtns.length; i++) {
|
|
91
91
|
(function (btn) {
|
|
92
92
|
btn.addEventListener("click", function () {
|
|
93
|
-
var allBtns = document.querySelectorAll("#mate-wizard .mate-
|
|
93
|
+
var allBtns = document.querySelectorAll("#mate-wizard .mate-vendor-option-btn");
|
|
94
94
|
for (var j = 0; j < allBtns.length; j++) {
|
|
95
95
|
allBtns[j].classList.remove("active");
|
|
96
96
|
}
|
|
97
97
|
btn.classList.add("active");
|
|
98
|
-
mateWizardData.
|
|
98
|
+
mateWizardData.vendor = btn.dataset.value;
|
|
99
99
|
});
|
|
100
|
-
})(
|
|
100
|
+
})(vendorBtns[i]);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -107,7 +107,7 @@ export function openMateWizard() {
|
|
|
107
107
|
relationship: null,
|
|
108
108
|
activity: [],
|
|
109
109
|
communicationStyle: [],
|
|
110
|
-
|
|
110
|
+
vendor: "claude",
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
// Reset UI
|
|
@@ -136,12 +136,12 @@ export function openMateWizard() {
|
|
|
136
136
|
styleCards[i].classList.remove("selected");
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
// Reset
|
|
140
|
-
var
|
|
141
|
-
for (var i = 0; i <
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
139
|
+
// Reset vendor
|
|
140
|
+
var vendorBtns = el.querySelectorAll(".mate-vendor-option-btn");
|
|
141
|
+
for (var i = 0; i < vendorBtns.length; i++) {
|
|
142
|
+
vendorBtns[i].classList.remove("active");
|
|
143
|
+
if (vendorBtns[i].dataset.value === "claude") {
|
|
144
|
+
vendorBtns[i].classList.add("active");
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -220,7 +220,7 @@ function collectMateWizardData() {
|
|
|
220
220
|
mateWizardData.communicationStyle.push(selectedStyles[i].dataset.value);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
//
|
|
223
|
+
// Vendor (already set via button clicks)
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
function mateWizardNext() {
|
|
@@ -11,7 +11,8 @@ import { getMateSessions } from './mate-sidebar.js';
|
|
|
11
11
|
import { openProjectSettings } from './project-settings.js';
|
|
12
12
|
import {
|
|
13
13
|
getCachedSessions,
|
|
14
|
-
getDateGroup
|
|
14
|
+
getDateGroup,
|
|
15
|
+
openResumePicker
|
|
15
16
|
} from './sidebar-sessions.js';
|
|
16
17
|
import {
|
|
17
18
|
getCachedProjectList,
|
|
@@ -389,12 +390,6 @@ function createMobileSessionItem(s) {
|
|
|
389
390
|
|
|
390
391
|
var titleSpan = document.createElement("span");
|
|
391
392
|
titleSpan.className = "mobile-session-title";
|
|
392
|
-
if (s.bookmarked) {
|
|
393
|
-
var bookmarkIcon = document.createElement("span");
|
|
394
|
-
bookmarkIcon.className = "mobile-session-bookmark";
|
|
395
|
-
bookmarkIcon.innerHTML = iconHtml("star");
|
|
396
|
-
titleSpan.appendChild(bookmarkIcon);
|
|
397
|
-
}
|
|
398
393
|
titleSpan.appendChild(document.createTextNode(s.title || "New Session"));
|
|
399
394
|
el.appendChild(titleSpan);
|
|
400
395
|
|
|
@@ -720,8 +715,7 @@ function renderMobileSessionsInto(container) {
|
|
|
720
715
|
importBtn.innerHTML = '<i data-lucide="import" style="width:16px;height:16px"></i> Import session';
|
|
721
716
|
importBtn.addEventListener("click", function () {
|
|
722
717
|
closeMobileSheet();
|
|
723
|
-
|
|
724
|
-
if (targetBtn) setTimeout(function () { targetBtn.click(); }, 250);
|
|
718
|
+
setTimeout(function () { openResumePicker(); }, 250);
|
|
725
719
|
});
|
|
726
720
|
container.appendChild(importBtn);
|
|
727
721
|
|
|
@@ -784,7 +778,7 @@ function renderMobileSessionsInto(container) {
|
|
|
784
778
|
if (bookmarkedItems.length > 0) {
|
|
785
779
|
var bookmarkedHeader = document.createElement("div");
|
|
786
780
|
bookmarkedHeader.className = "mobile-sheet-group";
|
|
787
|
-
bookmarkedHeader.textContent = "
|
|
781
|
+
bookmarkedHeader.textContent = "Favorites";
|
|
788
782
|
container.appendChild(bookmarkedHeader);
|
|
789
783
|
|
|
790
784
|
for (var bi = 0; bi < bookmarkedItems.length; bi++) {
|
|
@@ -798,10 +792,12 @@ function renderMobileSessionsInto(container) {
|
|
|
798
792
|
var group = getDateGroup(item.lastActivity || 0);
|
|
799
793
|
if (group !== currentGroup) {
|
|
800
794
|
currentGroup = group;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
795
|
+
if (group !== "Today") {
|
|
796
|
+
var header = document.createElement("div");
|
|
797
|
+
header.className = "mobile-sheet-group";
|
|
798
|
+
header.textContent = group;
|
|
799
|
+
container.appendChild(header);
|
|
800
|
+
}
|
|
805
801
|
}
|
|
806
802
|
if (item.type === "loop") {
|
|
807
803
|
container.appendChild(createMobileLoopGroup(item.loopId, item.children, item.groupKey));
|
|
@@ -977,12 +973,6 @@ function renderSearchResults(container, query) {
|
|
|
977
973
|
|
|
978
974
|
var titleSpan = document.createElement("span");
|
|
979
975
|
titleSpan.className = "mobile-session-title";
|
|
980
|
-
if (s.bookmarked) {
|
|
981
|
-
var bookmarkIcon = document.createElement("span");
|
|
982
|
-
bookmarkIcon.className = "mobile-session-bookmark";
|
|
983
|
-
bookmarkIcon.innerHTML = iconHtml("star");
|
|
984
|
-
titleSpan.appendChild(bookmarkIcon);
|
|
985
|
-
}
|
|
986
976
|
titleSpan.appendChild(document.createTextNode(title));
|
|
987
977
|
el.appendChild(titleSpan);
|
|
988
978
|
|